diff --git a/.env.local b/.env.local new file mode 100644 index 00000000..f8410e3e --- /dev/null +++ b/.env.local @@ -0,0 +1 @@ +SEQUELIZE_SECRET=7a947f4b6b5cd4c769029f7b5130c85fe2d3484758c0eeee351cd2e2d2c3bd59 diff --git a/_server.js b/_server.js new file mode 100644 index 00000000..a9bd1089 --- /dev/null +++ b/_server.js @@ -0,0 +1,37 @@ +var path = require('path'); +var express = require('express'); + +var app = express(); +var port = process.env.PORT || 3000; + +if (process.env.NODE_ENV !== 'production') { + var webpack = require('webpack'); + var config = require('./webpack.config.dev'); + var compiler = webpack(config); + + app.use(require('webpack-dev-middleware')(compiler, { + noInfo: true, + publicPath: config.output.publicPath + })); + app.use(require('webpack-hot-middleware')(compiler)); +} else { + app.use('/static', express.static('dist')); +} + +// Frontend +app.get('/service-worker.js', function(req, res) { + res.header("Content-Type", "application/javascript"); + res.sendFile(path.join(__dirname, 'service-worker.js')); +}); +app.get('*', function(req, res) { + res.sendFile(path.join(__dirname, 'index.html')); +}); + +app.listen(port, function(err) { + if (err) { + console.log(err); + return; + } + + console.log('Listening at ' + port); +}); diff --git a/dist/bundle.js b/dist/bundle.js index 63fa58d4..9fe72d92 100644 --- a/dist/bundle.js +++ b/dist/bundle.js @@ -1,10 +1,10 @@ -!function(e){function t(r){if(n[r])return n[r].exports;var i=n[r]={exports:{},id:r,loaded:!1};return e[r].call(i.exports,i,i.exports,t),i.loaded=!0,i.exports}var n={};return t.m=e,t.c=n,t.p="/static/",t(0)}([function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function i(e){return e&&e.__esModule?e:{"default":e}}var o=n(4),a=i(o),s=n(90),u=n(51),l=n(98),c=n(77),f=n(308),d=r(f),p=n(301),h=i(p),m=n(79),v=i(m),g=n(37),y=(i(g),n(149)),b=i(y),x=n(153),A=i(x),w=n(156),k=(i(w),n(80)),P=(i(k),d.reducer(b["default"])),C=(0,h["default"])("atlas-store"),T=d.createMiddleware(C),E=(0,c.applyMiddleware)(T)(c.createStore),S=E(P),N=d.createLoader(C);N(S),(0,s.render)(a["default"].createElement(u.Provider,{store:S},a["default"].createElement(l.Router,{history:v["default"]},a["default"].createElement(l.Route,{path:"/",component:A["default"]}))),document.getElementById("root"))},function(e,t,n){"use strict";function r(e,t,n,r,i,o,a,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,i,o,a,s],c=0;u=new Error(t.replace(/%s/g,function(){return l[c++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}}e.exports=r},function(e,t,n){"use strict";var r=n(13),i=r;e.exports=i},function(e,t){"use strict";function n(e,t){if(null==e)throw new TypeError("Object.assign target cannot be null or undefined");for(var n=Object(e),r=Object.prototype.hasOwnProperty,i=1;i2?n-2:0),i=2;n>i;i++)r[i-2]=arguments[i]}t.__esModule=!0,t["default"]=i;var o=n(15);r(o);e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){for(var n=Math.min(e.length,t.length),r=0;n>r;r++)if(e.charAt(r)!==t.charAt(r))return r;return e.length===t.length?-1:n}function i(e){return e?e.nodeType===X?e.documentElement:e.firstChild:null}function o(e){var t=i(e);return t&&Y.getID(t)}function a(e){var t=s(e);if(t)if(F.hasOwnProperty(t)){var n=F[t];n!==e&&(f(n,t)?I(!1):void 0,F[t]=e)}else F[t]=e;return t}function s(e){return e&&e.getAttribute&&e.getAttribute(W)||""}function u(e,t){var n=s(e);n!==t&&delete F[n],e.setAttribute(W,t),F[t]=e}function l(e){return F.hasOwnProperty(e)&&f(F[e],e)||(F[e]=Y.findReactNodeByID(e)),F[e]}function c(e){var t=T.get(e)._rootNodeID;return P.isNullComponentID(t)?null:(F.hasOwnProperty(t)&&f(F[t],t)||(F[t]=Y.findReactNodeByID(t)),F[t])}function f(e,t){if(e){s(e)!==t?I(!1):void 0;var n=Y.findReactContainerForID(t);if(n&&j(n,e))return!0}return!1}function d(e){delete F[e]}function p(e){var t=F[e];return t&&f(t,e)?void(J=t):!1}function h(e){J=null,C.traverseAncestors(e,p);var t=J;return J=null,t}function m(e,t,n,r,i,o){w.useCreateElement&&(o=L({},o),n.nodeType===X?o[V]=n:o[V]=n.ownerDocument);var a=N.mountComponent(e,t,r,o);e._renderedComponent._topLevelWrapper=e,Y._mountImageIntoNode(a,n,i,r)}function v(e,t,n,r,i){var o=O.ReactReconcileTransaction.getPooled(r);o.perform(m,null,e,t,n,o,r,i),O.ReactReconcileTransaction.release(o)}function g(e,t){for(N.unmountComponent(e),t.nodeType===X&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)}function y(e){var t=o(e);return t?t!==C.getReactRootIDFromNodeID(t):!1}function b(e){for(;e&&e.parentNode!==e;e=e.parentNode)if(1===e.nodeType){var t=s(e);if(t){var n,r=C.getReactRootIDFromNodeID(t),i=e;do if(n=s(i),i=i.parentNode,null==i)return null;while(n!==r);if(i===Z[r])return e}}return null}var x=n(29),A=n(40),w=(n(17),n(112)),k=n(9),P=n(119),C=n(30),T=n(34),E=n(122),S=n(10),N=n(24),M=n(64),O=n(11),L=n(3),R=n(31),j=n(82),D=n(71),I=n(1),z=n(47),H=n(74),W=(n(76),n(2),x.ID_ATTRIBUTE_NAME),F={},q=1,X=9,U=11,V="__ReactMount_ownerDocument$"+Math.random().toString(36).slice(2),B={},Z={},G=[],J=null,K=function(){};K.prototype.isReactComponent={},K.prototype.render=function(){return this.props};var Y={TopLevelWrapper:K,_instancesByReactRootID:B,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,n,r){return Y.scrollMonitor(n,function(){M.enqueueElementInternal(e,t),r&&M.enqueueCallbackInternal(e,r)}),e},_registerComponent:function(e,t){!t||t.nodeType!==q&&t.nodeType!==X&&t.nodeType!==U?I(!1):void 0,A.ensureScrollValueMonitoring();var n=Y.registerContainer(t);return B[n]=e,n},_renderNewRootComponent:function(e,t,n,r){var i=D(e,null),o=Y._registerComponent(i,t);return O.batchedUpdates(v,i,o,t,n,r),i},renderSubtreeIntoContainer:function(e,t,n,r){return null==e||null==e._reactInternalInstance?I(!1):void 0,Y._renderSubtreeIntoContainer(e,t,n,r)},_renderSubtreeIntoContainer:function(e,t,n,r){k.isValidElement(t)?void 0:I(!1);var a=new k(K,null,null,null,null,null,t),u=B[o(n)];if(u){var l=u._currentElement,c=l.props;if(H(c,t)){var f=u._renderedComponent.getPublicInstance(),d=r&&function(){r.call(f)};return Y._updateRootComponent(u,a,n,d),f}Y.unmountComponentAtNode(n)}var p=i(n),h=p&&!!s(p),m=y(n),v=h&&!u&&!m,g=Y._renderNewRootComponent(a,n,v,null!=e?e._reactInternalInstance._processChildContext(e._reactInternalInstance._context):R)._renderedComponent.getPublicInstance();return r&&r.call(g),g},render:function(e,t,n){return Y._renderSubtreeIntoContainer(null,e,t,n)},registerContainer:function(e){var t=o(e);return t&&(t=C.getReactRootIDFromNodeID(t)),t||(t=C.createReactRootID()),Z[t]=e,t},unmountComponentAtNode:function(e){!e||e.nodeType!==q&&e.nodeType!==X&&e.nodeType!==U?I(!1):void 0;var t=o(e),n=B[t];if(!n){var r=(y(e),s(e));r&&r===C.getReactRootIDFromNodeID(r);return!1}return O.batchedUpdates(g,n,e),delete B[t],delete Z[t],!0},findReactContainerForID:function(e){var t=C.getReactRootIDFromNodeID(e),n=Z[t];return n},findReactNodeByID:function(e){var t=Y.findReactContainerForID(e);return Y.findComponentRoot(t,e)},getFirstReactDOM:function(e){return b(e)},findComponentRoot:function(e,t){var n=G,r=0,i=h(t)||e;for(n[0]=i.firstChild,n.length=1;r1){for(var p=Array(d),h=0;d>h;h++)p[h]=arguments[h+2];o.children=p}if(e&&e.defaultProps){var m=e.defaultProps;for(i in m)"undefined"==typeof o[i]&&(o[i]=m[i])}return s(e,u,l,c,f,r.current,o)},s.createFactory=function(e){var t=s.createElement.bind(null,e);return t.type=e,t},s.cloneAndReplaceKey=function(e,t){var n=s(e.type,t,e.ref,e._self,e._source,e._owner,e.props);return n},s.cloneAndReplaceProps=function(e,t){var n=s(e.type,e.key,e.ref,e._self,e._source,e._owner,t);return n},s.cloneElement=function(e,t,n){var o,u=i({},e.props),l=e.key,c=e.ref,f=e._self,d=e._source,p=e._owner;if(null!=t){void 0!==t.ref&&(c=t.ref,p=r.current),void 0!==t.key&&(l=""+t.key);for(o in t)t.hasOwnProperty(o)&&!a.hasOwnProperty(o)&&(u[o]=t[o])}var h=arguments.length-2;if(1===h)u.children=n;else if(h>1){for(var m=Array(h),v=0;h>v;v++)m[v]=arguments[v+2];u.children=m}return s(e.type,l,c,f,d,p,u)},s.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===o},e.exports=s},function(e,t,n){"use strict";function r(e,t,n){return n}var i={enableMeasure:!1,storedMeasure:r,measureMethods:function(e,t,n){},measure:function(e,t,n){return n},injection:{injectMeasure:function(e){i.storedMeasure=e}}};e.exports=i},function(e,t,n){"use strict";function r(){T.ReactReconcileTransaction&&x?void 0:v(!1)}function i(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=c.getPooled(),this.reconcileTransaction=T.ReactReconcileTransaction.getPooled(!1)}function o(e,t,n,i,o,a){r(),x.batchedUpdates(e,t,n,i,o,a)}function a(e,t){return e._mountOrder-t._mountOrder}function s(e){var t=e.dirtyComponentsLength;t!==g.length?v(!1):void 0,g.sort(a);for(var n=0;t>n;n++){var r=g[n],i=r._pendingCallbacks;if(r._pendingCallbacks=null,p.performUpdateIfNecessary(r,e.reconcileTransaction),i)for(var o=0;o=0&&b.splice(t,1)}function s(e){var t=document.createElement("style");return t.type="text/css",o(e,t),t}function u(e){var t=document.createElement("link");return t.rel="stylesheet",o(e,t),t}function l(e,t){var n,r,i;if(t.singleton){var o=y++;n=g||(g=s(t)),r=c.bind(null,n,o,!1),i=c.bind(null,n,o,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=u(t),r=d.bind(null,n),i=function(){a(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(t),r=f.bind(null,n),i=function(){a(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else i()}}function c(e,t,n,r){var i=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=x(t,i);else{var o=document.createTextNode(i),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(o,a[t]):e.appendChild(o)}}function f(e,t){var n=t.css,r=t.media;t.sourceMap;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function d(e,t){var n=t.css,r=(t.media,t.sourceMap);r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var i=new Blob([n],{type:"text/css"}),o=e.href;e.href=URL.createObjectURL(i),o&&URL.revokeObjectURL(o)}var p={},h=function(e){var t;return function(){return"undefined"==typeof t&&(t=e.apply(this,arguments)),t}},m=h(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),v=h(function(){return document.head||document.getElementsByTagName("head")[0]}),g=null,y=0,b=[];e.exports=function(e,t){t=t||{},"undefined"==typeof t.singleton&&(t.singleton=m()),"undefined"==typeof t.insertAt&&(t.insertAt="bottom");var n=i(e);return r(n,t),function(e){for(var o=[],a=0;axo&&setTimeout(function(){u.display.input.reset(!0)},20),Xt(this),Ki(),xt(this),this.curOp.forceUpdate=!0,Yr(this,i),r.autofocus&&!No||u.hasFocus()?setTimeout(Hi(gn,this),20):yn(this);for(var c in ea)ea.hasOwnProperty(c)&&ea[c](this,r[c],ta);w(this),r.finishInit&&r.finishInit(this);for(var f=0;fxo&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),Ao||vo&&No||(r.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(r.wrapper):e(r.wrapper)),r.viewFrom=r.viewTo=t.first,r.reportedViewFrom=r.reportedViewTo=t.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,n.init(r)}function n(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),r(t)}function r(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,We(e,100),e.state.modeGen++,e.curOp&&Dt(e)}function i(e){e.options.lineWrapping?(Qa(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Ya(e.display.wrapper,"CodeMirror-wrap"),d(e)),a(e),Dt(e),st(e),setTimeout(function(){y(e)},100)}function o(e){var t=yt(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/bt(e.display)-3);return function(i){if(wr(e.doc,i))return 0;var o=0;if(i.widgets)for(var a=0;at.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function p(e){var t=Ri(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function h(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Ve(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+Ze(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function m(e,t,n){this.cm=n;var r=this.vert=Xi("div",[Xi("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),i=this.horiz=Xi("div",[Xi("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(r),e(i),Na(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Na(i,"scroll",function(){i.clientWidth&&t(i.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,bo&&8>xo&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function v(){}function g(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&Ya(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),Na(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?on(t,e):rn(t,e)},t),t.display.scrollbars.addClass&&Qa(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=h(e));var n=e.display.barWidth,r=e.display.barHeight;b(e,t);for(var i=0;4>i&&n!=e.display.barWidth||r!=e.display.barHeight;i++)n!=e.display.barWidth&&e.options.lineWrapping&&O(e),b(e,h(e)),n=e.display.barWidth,r=e.display.barHeight}function b(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",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=""}function x(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Ue(e));var i=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,o=ni(t,r),a=ni(t,i);if(n&&n.ensure){var s=n.ensure.from.line,u=n.ensure.to.line;o>s?(o=s,a=ni(t,ri(Qr(t,s))+e.wrapper.clientHeight)):Math.min(u,t.lastLine())>=a&&(o=ni(t,ri(Qr(t,u))-e.wrapper.clientHeight),a=u)}return{from:o,to:Math.max(a,o+1)}}function A(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=P(t)-t.scroller.scrollLeft+e.doc.scrollLeft,i=t.gutters.offsetWidth,o=r+"px",a=0;a=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==qt(e))return!1;w(e)&&(zt(e),t.dims=R(e));var i=r.first+r.size,o=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(i,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(i,n.viewTo)),Io&&(o=xr(e.doc,o),a=Ar(e.doc,a));var s=o!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Ft(e,o,a),n.viewOffset=ri(Qr(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var u=qt(e);if(!s&&0==u&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var l=Bi();return u>4&&(n.lineDiv.style.display="none"),j(e,n.updateLineNumbers,t.dims),u>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,l&&Bi()!=l&&l.offsetHeight&&l.focus(),Ui(n.cursorDiv),Ui(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,We(e,400)),n.updateLineNumbers=null,!0}function S(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Ge(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Ve(e.display)-Je(e),n.top)}),t.visible=x(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&E(e,t);r=!1){O(e);var i=h(e);je(e),M(e,i),y(e,i)}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 N(e,t){var n=new C(e,t);if(E(e,n)){O(e),S(e,n);var r=h(e);je(e),M(e,r),y(e,r),n.finish()}}function M(e,t){e.display.sizer.style.minHeight=t.docHeight+"px";var n=t.docHeight+e.display.barHeight;e.display.heightForcer.style.top=n+"px",e.display.gutters.style.height=Math.max(n+Ze(e),t.clientHeight)+"px"}function O(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;rxo){var a=o.node.offsetTop+o.node.offsetHeight;i=a-n,n=a}else{var s=o.node.getBoundingClientRect();i=s.bottom-s.top}var u=o.line.height-i;if(2>i&&(i=yt(t)),(u>.001||-.001>u)&&(ei(o.line,i),L(o.line),o.rest))for(var l=0;l=t&&f.lineNumber;f.changes&&(Ri(f.changes,"gutter")>-1&&(d=!1),D(e,f,l,n)),d&&(Ui(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(k(e.options,l)))),s=f.node.nextSibling}else{var p=U(e,f,l,n);a.insertBefore(p,s)}l+=f.size}for(;s;)s=r(s)}function D(e,t,n,r){for(var i=0;ixo&&(e.node.style.zIndex=2)),e.node}function z(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var n=I(e);e.background=n.insertBefore(Xi("div",null,t),n.firstChild)}}function H(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Hr(e,t)}function W(e,t){var n=t.text.className,r=H(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,F(t)):n&&(t.text.className=n)}function F(e){z(e),e.line.wrapClass?I(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function q(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=I(t);t.gutterBackground=Xi("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),i.insertBefore(t.gutterBackground,t.text)}var o=t.line.gutterMarkers;if(e.options.lineNumbers||o){var i=I(t),a=t.gutter=Xi("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px"); -if(e.display.input.setUneditable(a),i.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||o&&o["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(Xi("div",k(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),o)for(var s=0;s1)if(Wo&&Wo.join("\n")==t){if(r.ranges.length%Wo.length==0){u=[];for(var l=0;l=0;l--){var c=r.ranges[l],f=c.from(),d=c.to();c.empty()&&(n&&n>0?f=zo(f.line,f.ch-n):e.state.overwrite&&!a&&(d=zo(d.line,Math.min(Qr(o,d.line).text.length,d.ch+Li(s).length))));var p=e.curOp.updateInput,h={from:f,to:d,text:u?u[l%u.length]:s,origin:i||(a?"paste":e.state.cutIncoming?"cut":"+input")};Tn(e.doc,h),Pi(e,"inputRead",e,h)}t&&!a&&$(e,t),Hn(e),e.curOp.updateInput=p,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function _(e,t){var n=e.clipboardData&&e.clipboardData.getData("text/plain");return n?(e.preventDefault(),t.isReadOnly()||t.options.disableInput||Nt(t,function(){Q(t,n,0,null,"paste")}),!0):void 0}function $(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var i=n.ranges[r];if(!(i.head.ch>100||r&&n.ranges[r-1].head.line==i.head.line)){var o=e.getModeAt(i.head),a=!1;if(o.electricChars){for(var s=0;s-1){a=Fn(e,i.head.line,"smart");break}}else o.electricInput&&o.electricInput.test(Qr(e.doc,i.head.line).text.slice(0,i.head.ch))&&(a=Fn(e,i.head.line,"smart"));a&&Pi(e,"electricInput",e,i.head.line)}}}function ee(e){for(var t=[],n=[],r=0;ri?l.map:c[i],a=0;ai?e.line:e.rest[i]),f=o[a]+r;return(0>r||s!=t)&&(f=o[a+(r?1:0)]),zo(u,f)}}}var i=e.text.firstChild,o=!1;if(!t||!Ga(i,t))return ae(zo(ti(e.line),0),!0);if(t==i&&(o=!0,t=i.childNodes[n],n=0,!t)){var a=e.rest?Li(e.rest):e.line;return ae(zo(ti(a),a.text.length),o)}var s=3==t.nodeType?t:null,u=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,n&&(n=s.nodeValue.length));u.parentNode!=i;)u=u.parentNode;var l=e.measure,c=l.maps,f=r(s,u,n);if(f)return ae(f,o);for(var d=u.nextSibling,p=s?s.nodeValue.length-n:0;d;d=d.nextSibling){if(f=r(d,d.firstChild,0))return ae(zo(f.line,f.ch-p),o);p+=d.textContent.length}for(var h=u.previousSibling,p=n;h;h=h.previousSibling){if(f=r(h,h.firstChild,-1))return ae(zo(f.line,f.ch+p),o);p+=d.textContent.length}}function le(e,t,n,r,i){function o(e){return function(t){return t.id==e}}function a(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(null!=n)return""==n&&(n=t.textContent.replace(/\u200b/g,"")),void(s+=n);var c,f=t.getAttribute("cm-marker");if(f){var d=e.findMarks(zo(r,0),zo(i+1,0),o(+f));return void(d.length&&(c=d[0].find())&&(s+=_r(e.doc,c.from,c.to).join(l)))}if("false"==t.getAttribute("contenteditable"))return;for(var p=0;p=0){var a=K(o.from(),i.from()),s=J(o.to(),i.to()),u=o.empty()?i.from()==i.head:o.from()==o.head;t>=r&&--t,e.splice(--r,2,new fe(u?s:a,u?a:s))}}return new ce(e,t)}function pe(e,t){return new ce([new fe(e,t||e)],0)}function he(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function me(e,t){if(t.linen?zo(n,Qr(e,n).text.length):ve(t,Qr(e,t.line).text.length)}function ve(e,t){var n=e.ch;return null==n||n>t?zo(e.line,t):0>n?zo(e.line,0):e}function ge(e,t){return t>=e.first&&t=t.ch:s.to>t.ch))){if(i&&(La(u,"beforeCursorEnter"),u.explicitlyCleared)){if(o.markedSpans){--a;continue}break}if(!u.atomic)continue;if(n){var l,c=u.find(0>r?1:-1);if((0>r?u.inclusiveRight:u.inclusiveLeft)&&(c=Re(e,c,-r,o)),c&&c.line==t.line&&(l=Ho(c,n))&&(0>r?0>l:l>0))return Oe(e,c,t,r,i)}var f=u.find(0>r?-1:1);return(0>r?u.inclusiveLeft:u.inclusiveRight)&&(f=Re(e,f,r,o)),f?Oe(e,f,t,r,i):null}}return t}function Le(e,t,n,r,i){var o=r||1,a=Oe(e,t,n,o,i)||!i&&Oe(e,t,n,o,!0)||Oe(e,t,n,-o,i)||!i&&Oe(e,t,n,-o,!0);return a?a:(e.cantEdit=!0,zo(e.first,0))}function Re(e,t,n,r){return 0>n&&0==t.ch?t.line>e.first?me(e,zo(t.line-1)):null:n>0&&t.ch==(r||Qr(e,t.line)).text.length?t.linet&&(t=0),t=Math.round(t),r=Math.round(r),s.appendChild(Xi("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==n?c-e:n)+"px; height: "+(r-t)+"px"))}function i(t,n,i){function o(n,r){return dt(e,zo(t,n),"div",f,r)}var s,u,f=Qr(a,t),d=f.text.length;return eo(ii(f),n||0,null==i?d:i,function(e,t,a){var f,p,h,m=o(e,"left");if(e==t)f=m,p=h=m.left;else{if(f=o(t-1,"right"),"rtl"==a){var v=m;m=f,f=v}p=m.left,h=f.right}null==n&&0==e&&(p=l),f.top-m.top>3&&(r(p,m.top,null,m.bottom),p=l,m.bottomu.bottom||f.bottom==u.bottom&&f.right>u.right)&&(u=f),l+1>p&&(p=l),r(p,f.top,h-p,f.bottom)}),{start:s,end:u}}var o=e.display,a=e.doc,s=document.createDocumentFragment(),u=Be(e.display),l=u.left,c=Math.max(o.sizerWidth,Ge(e)-o.sizer.offsetLeft)-u.right,f=t.from(),d=t.to();if(f.line==d.line)i(f.line,f.ch,d.ch);else{var p=Qr(a,f.line),h=Qr(a,d.line),m=yr(p)==yr(h),v=i(f.line,f.ch,m?p.text.length+1:null).end,g=i(d.line,m?0:null,d.ch).start;m&&(v.top0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function We(e,t){e.doc.mode.startState&&e.doc.frontier=e.display.viewTo)){var n=+new Date+e.options.workTime,r=sa(t.mode,Xe(e,t.frontier)),i=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(o){if(t.frontier>=e.display.viewFrom){var a=o.styles,s=o.text.length>e.options.maxHighlightLength,u=jr(e,o,s?sa(t.mode,r):r,!0);o.styles=u.styles;var l=o.styleClasses,c=u.classes;c?o.styleClasses=c:l&&(o.styleClasses=null);for(var f=!a||a.length!=o.styles.length||l!=c&&(!l||!c||l.bgClass!=c.bgClass||l.textClass!=c.textClass),d=0;!f&&dn?(We(e,e.options.workDelay),!0):void 0}),i.length&&Nt(e,function(){for(var t=0;ta;--s){if(s<=o.first)return o.first;var u=Qr(o,s-1);if(u.stateAfter&&(!n||s<=o.frontier))return s;var l=Wa(u.text,null,e.options.tabSize);(null==i||r>l)&&(i=s-1,r=l)}return i}function Xe(e,t,n){var r=e.doc,i=e.display;if(!r.mode.startState)return!0;var o=qe(e,t,n),a=o>r.first&&Qr(r,o-1).stateAfter;return a=a?sa(r.mode,a):ua(r.mode),r.iter(o,t,function(n){Ir(e,n.text,a);var s=o==t-1||o%5==0||o>=i.viewFrom&&o2&&o.push((u.bottom+l.top)/2-n.top)}}o.push(n.bottom-n.top)}}function Ye(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;rn)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Qe(e,t){t=yr(t);var n=ti(t),r=e.display.externalMeasured=new Rt(e.doc,t,n);r.lineN=n;var i=r.built=Hr(e,r);return r.text=i.pre,Vi(e.display.lineMeasure,i.pre),r}function _e(e,t,n,r){return tt(e,et(e,t),n,r)}function $e(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt?(i=0,o=1,a="left"):l>t?(i=t-u,o=i+1):(s==e.length-3||t==l&&e[s+3]>t)&&(o=l-u,i=o-1,t>=l&&(a="right")),null!=i){if(r=e[s+2],u==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==i)for(;s&&e[s-2]==e[s-3]&&e[s-1].insertLeft;)r=e[(s-=3)+2],a="left";if("right"==n&&i==l-u)for(;sc;c++){for(;s&&qi(t.line.text.charAt(o.coverStart+s));)--s;for(;o.coverStart+uxo&&0==s&&u==o.coverEnd-o.coverStart)i=a.parentNode.getBoundingClientRect();else if(bo&&e.options.lineWrapping){var f=Ua(a,s,u).getClientRects();i=f.length?f["right"==r?f.length-1:0]:Uo}else i=Ua(a,s,u).getBoundingClientRect()||Uo;if(i.left||i.right||0==s)break;u=s,s-=1,l="right"}bo&&11>xo&&(i=it(e.display.measure,i))}else{s>0&&(l=r="right");var f;i=e.options.lineWrapping&&(f=a.getClientRects()).length>1?f["right"==r?f.length-1:0]:a.getBoundingClientRect()}if(bo&&9>xo&&!s&&(!i||!i.left&&!i.right)){var d=a.parentNode.getClientRects()[0];i=d?{left:d.left,right:d.left+bt(e.display),top:d.top,bottom:d.bottom}:Uo}for(var p=i.top-t.rect.top,h=i.bottom-t.rect.top,m=(p+h)/2,v=t.view.measure.heights,c=0;cn.from?a(e-1):a(e,r)}r=r||Qr(e.doc,t.line),i||(i=et(e,r));var u=ii(r),l=t.ch;if(!u)return a(l);var c=lo(u,l),f=s(l,c);return null!=os&&(f.other=s(l,os)),f}function ht(e,t){var n=0,t=me(e.doc,t);e.options.lineWrapping||(n=bt(e.display)*t.ch);var r=Qr(e.doc,t.line),i=ri(r)+Ue(e.display);return{left:n,right:n,top:i,bottom:i+r.height}}function mt(e,t,n,r){var i=zo(e,t);return i.xRel=r,n&&(i.outside=!0),i}function vt(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,0>n)return mt(r.first,0,!0,-1);var i=ni(r,n),o=r.first+r.size-1;if(i>o)return mt(r.first+r.size-1,Qr(r,o).text.length,!0,1);0>t&&(t=0);for(var a=Qr(r,i);;){var s=gt(e,a,i,t,n),u=vr(a),l=u&&u.find(0,!0);if(!u||!(s.ch>l.from.ch||s.ch==l.from.ch&&s.xRel>0))return s;i=ti(a=l.to.line)}}function gt(e,t,n,r,i){function o(r){var i=pt(e,zo(n,r),"line",t,l);return s=!0,a>i.bottom?i.left-u:av)return mt(n,p,g,1);for(;;){if(c?p==d||p==fo(t,d,1):1>=p-d){for(var y=h>r||v-r>=r-h?d:p,b=r-(y==d?h:v);qi(t.text.charAt(y));)++y;var x=mt(n,y,y==d?m:g,-1>b?-1:b>1?1:0);return x}var A=Math.ceil(f/2),w=d+A;if(c){w=d;for(var k=0;A>k;++k)w=fo(t,w,1)}var P=o(w);P>r?(p=w,v=P,(g=s)&&(v+=1e3),f=A):(d=w,h=P,m=s,f-=A)}}function yt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==Fo){Fo=Xi("pre");for(var t=0;49>t;++t)Fo.appendChild(document.createTextNode("x")),Fo.appendChild(Xi("br"));Fo.appendChild(document.createTextNode("x"))}Vi(e.measure,Fo);var n=Fo.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),Ui(e.measure),n||1}function bt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=Xi("span","xxxxxxxxxx"),n=Xi("pre",[t]);Vi(e.measure,n);var r=t.getBoundingClientRect(),i=(r.right-r.left)/10;return i>2&&(e.cachedCharWidth=i),i||10}function xt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Bo},Vo?Vo.ops.push(e.curOp):e.curOp.ownsGroup=Vo={ops:[e.curOp],delayedCallbacks:[]}}function At(e){var t=e.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new C(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ct(e){e.updatedDisplay=e.mustUpdate&&E(e.cm,e.update)}function Tt(e){var t=e.cm,n=t.display;e.updatedDisplay&&O(t),e.barMeasure=h(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=_e(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+Ze(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Ge(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Et(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLefto;o=r){var a=new Rt(e.doc,Qr(e.doc,o),o);r=o+a.size,i.push(a)}return i}function Dt(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&&nt)&&(i.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=i.viewTo)Io&&xr(e.doc,t)i.viewFrom?zt(e):(i.viewFrom+=r,i.viewTo+=r);else if(t<=i.viewFrom&&n>=i.viewTo)zt(e);else if(t<=i.viewFrom){var o=Wt(e,n,n+r,1);o?(i.view=i.view.slice(o.index),i.viewFrom=o.lineN,i.viewTo+=r):zt(e)}else if(n>=i.viewTo){var o=Wt(e,t,t,-1);o?(i.view=i.view.slice(0,o.index),i.viewTo=o.lineN):zt(e)}else{var a=Wt(e,t,t,-1),s=Wt(e,n,n+r,1);a&&s?(i.view=i.view.slice(0,a.index).concat(jt(e,a.lineN,s.lineN)).concat(i.view.slice(s.index)),i.viewTo+=r):zt(e)}var u=i.externalMeasured;u&&(n=i.lineN&&t=r.viewTo)){var o=r.view[Ht(e,t)];if(null!=o.node){var a=o.changes||(o.changes=[]);-1==Ri(a,n)&&a.push(n)}}}function zt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ht(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var n=e.display.view,r=0;rt)return r}function Wt(e,t,n,r){var i,o=Ht(e,t),a=e.display.view;if(!Io||n==e.doc.first+e.doc.size)return{index:o,lineN:n};for(var s=0,u=e.display.viewFrom;o>s;s++)u+=a[s].size;if(u!=t){if(r>0){if(o==a.length-1)return null;i=u+a[o].size-t,o++}else i=u-t;t+=i,n+=i}for(;xr(e.doc,n)!=n;){if(o==(0>r?0:a.length-1))return null;n+=r*a[o-(0>r?1:0)].size,o+=r}return{index:o,lineN:n}}function Ft(e,t,n){var r=e.display,i=r.view;0==i.length||t>=r.viewTo||n<=r.viewFrom?(r.view=jt(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=jt(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Ht(e,n)))),r.viewTo=n}function qt(e){for(var t=e.display.view,n=0,r=0;r400}var i=e.display;Na(i.scroller,"mousedown",Mt(e,Gt)),bo&&11>xo?Na(i.scroller,"dblclick",Mt(e,function(t){if(!Ti(e,t)){var n=Zt(e,t);if(n&&!_t(e,t)&&!Bt(e.display,t)){Ta(t);var r=e.findWordAt(n);xe(e.doc,r.anchor,r.head)}}})):Na(i.scroller,"dblclick",function(t){Ti(e,t)||Ta(t)}),jo||Na(i.scroller,"contextmenu",function(t){bn(e,t)});var o,a={end:0};Na(i.scroller,"touchstart",function(t){if(!Ti(e,t)&&!n(t)){clearTimeout(o);var r=+new Date;i.activeTouch={start:r,moved:!1,prev:r-a.end<=300?a:null},1==t.touches.length&&(i.activeTouch.left=t.touches[0].pageX,i.activeTouch.top=t.touches[0].pageY)}}),Na(i.scroller,"touchmove",function(){i.activeTouch&&(i.activeTouch.moved=!0)}),Na(i.scroller,"touchend",function(n){var o=i.activeTouch;if(o&&!Bt(i,n)&&null!=o.left&&!o.moved&&new Date-o.start<300){var a,s=e.coordsChar(i.activeTouch,"page");a=!o.prev||r(o,o.prev)?new fe(s,s):!o.prev.prev||r(o,o.prev.prev)?e.findWordAt(s):new fe(zo(s.line,0),me(e.doc,zo(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),Ta(n)}t()}),Na(i.scroller,"touchcancel",t),Na(i.scroller,"scroll",function(){i.scroller.clientHeight&&(rn(e,i.scroller.scrollTop),on(e,i.scroller.scrollLeft,!0),La(e,"scroll",e))}),Na(i.scroller,"mousewheel",function(t){an(e,t)}),Na(i.scroller,"DOMMouseScroll",function(t){an(e,t)}),Na(i.wrapper,"scroll",function(){i.wrapper.scrollTop=i.wrapper.scrollLeft=0}),i.dragFunctions={enter:function(t){Ti(e,t)||Sa(t)},over:function(t){Ti(e,t)||(tn(e,t),Sa(t))},start:function(t){en(e,t)},drop:Mt(e,$t),leave:function(){nn(e)}};var s=i.input.getField();Na(s,"keyup",function(t){hn.call(e,t)}),Na(s,"keydown",Mt(e,dn)),Na(s,"keypress",Mt(e,mn)),Na(s,"focus",Hi(gn,e)),Na(s,"blur",Hi(yn,e))}function Ut(t,n,r){var i=r&&r!=e.Init;if(!n!=!i){var o=t.display.dragFunctions,a=n?Na:Oa;a(t.display.scroller,"dragstart",o.start),a(t.display.scroller,"dragenter",o.enter),a(t.display.scroller,"dragover",o.over),a(t.display.scroller,"dragleave",o.leave),a(t.display.scroller,"drop",o.drop)}}function Vt(e){var t=e.display;(t.lastWrapHeight!=t.wrapper.clientHeight||t.lastWrapWidth!=t.wrapper.clientWidth)&&(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function Bt(e,t){for(var n=Ai(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 Zt(e,t,n,r){var i=e.display;if(!n&&"true"==Ai(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=vt(e,o,a);if(r&&1==l.xRel&&(u=Qr(e.doc,l.line).text).length==l.ch){var c=Wa(u,u.length,e.options.tabSize)-u.length;l=zo(l.line,Math.max(0,Math.round((o-Be(e.display).left)/bt(e.display))-c))}return l}function Gt(e){var t=this,n=t.display;if(!(Ti(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.shift=e.shiftKey,Bt(n,e))return void(Ao||(n.scroller.draggable=!1,setTimeout(function(){n.scroller.draggable=!0},100)));if(!_t(t,e)){ -var r=Zt(t,e);switch(window.focus(),wi(e)){case 1:t.state.selectingText?t.state.selectingText(e):r?Jt(t,e,r):Ai(e)==n.scroller&&Ta(e);break;case 2:Ao&&(t.state.lastMiddleDown=+new Date),r&&xe(t.doc,r),setTimeout(function(){n.input.focus()},20),Ta(e);break;case 3:jo?bn(t,e):vn(t)}}}}function Jt(e,t,n){bo?setTimeout(Hi(Y,e),0):e.curOp.focus=Bi();var r,i=+new Date;Xo&&Xo.time>i-400&&0==Ho(Xo.pos,n)?r="triple":qo&&qo.time>i-400&&0==Ho(qo.pos,n)?(r="double",Xo={time:i,pos:n}):(r="single",qo={time:i,pos:n});var o,a=e.doc.sel,s=Mo?t.metaKey:t.ctrlKey;e.options.dragDrop&&$a&&!e.isReadOnly()&&"single"==r&&(o=a.contains(n))>-1&&(Ho((o=a.ranges[o]).from(),n)<0||n.xRel>0)&&(Ho(o.to(),n)>0||n.xRel<0)?Kt(e,t,n,s):Yt(e,t,n,r,s)}function Kt(e,t,n,r){var i=e.display,o=+new Date,a=Mt(e,function(s){Ao&&(i.scroller.draggable=!1),e.state.draggingText=!1,Oa(document,"mouseup",a),Oa(i.scroller,"drop",a),Math.abs(t.clientX-s.clientX)+Math.abs(t.clientY-s.clientY)<10&&(Ta(s),!r&&+new Date-200=h;h++){var g=Qr(l,h).text,y=Fa(g,u,o);u==p?i.push(new fe(zo(h,y),zo(h,y))):g.length>y&&i.push(new fe(zo(h,y),zo(h,Fa(g,p,o))))}i.length||i.push(new fe(n,n)),Te(l,de(d.ranges.slice(0,f).concat(i),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b=c,x=b.anchor,A=t;if("single"!=r){if("double"==r)var w=e.findWordAt(t);else var w=new fe(zo(t.line,0),me(l,zo(t.line+1,0)));Ho(w.anchor,x)>0?(A=w.head,x=K(b.from(),w.anchor)):(A=w.anchor,x=J(b.to(),w.head))}var i=d.ranges.slice(0);i[f]=new fe(me(l,x),A),Te(l,de(i,f),za)}}function a(t){var n=++y,i=Zt(e,t,!0,"rect"==r);if(i)if(0!=Ho(i,v)){e.curOp.focus=Bi(),o(i);var s=x(u,l);(i.line>=s.to||i.lineg.bottom?20:0;c&&setTimeout(Mt(e,function(){y==n&&(u.scroller.scrollTop+=c,a(t))}),50)}}function s(t){e.state.selectingText=!1,y=1/0,Ta(t),u.input.focus(),Oa(document,"mousemove",b),Oa(document,"mouseup",A),l.history.lastSelOrigin=null}var u=e.display,l=e.doc;Ta(t);var c,f,d=l.sel,p=d.ranges;if(i&&!t.shiftKey?(f=l.sel.contains(n),c=f>-1?p[f]:new fe(n,n)):(c=l.sel.primary(),f=l.sel.primIndex),t.altKey)r="rect",i||(c=new fe(n,n)),n=Zt(e,t,!0,!0),f=-1;else if("double"==r){var h=e.findWordAt(n);c=e.display.shift||l.extend?be(l,c,h.anchor,h.head):h}else if("triple"==r){var m=new fe(zo(n.line,0),me(l,zo(n.line+1,0)));c=e.display.shift||l.extend?be(l,c,m.anchor,m.head):m}else c=be(l,c,n);i?-1==f?(f=p.length,Te(l,de(p.concat([c]),f),{scroll:!1,origin:"*mouse"})):p.length>1&&p[f].empty()&&"single"==r&&!t.shiftKey?(Te(l,de(p.slice(0,f).concat(p.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),d=l.sel):we(l,f,c,za):(f=0,Te(l,new ce([c],0),za),d=l.sel);var v=n,g=u.wrapper.getBoundingClientRect(),y=0,b=Mt(e,function(e){wi(e)?a(e):s(e)}),A=Mt(e,s);e.state.selectingText=A,Na(document,"mousemove",b),Na(document,"mouseup",A)}function Qt(e,t,n,r){try{var i=t.clientX,o=t.clientY}catch(t){return!1}if(i>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ta(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(o>s.bottom||!Si(e,n))return xi(t);o-=s.top-a.viewOffset;for(var u=0;u=i){var c=ni(e.doc,o),f=e.options.gutters[u];return La(e,n,e,c,f,t),xi(t)}}}function _t(e,t){return Qt(e,t,"gutterClick",!0)}function $t(e){var t=this;if(nn(t),!Ti(t,e)&&!Bt(t.display,e)){Ta(e),bo&&(Zo=+new Date);var n=Zt(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),a=0,s=function(e,r){if(!t.options.allowDropFileTypes||-1!=Ri(t.options.allowDropFileTypes,e.type)){var s=new FileReader;s.onload=Mt(t,function(){var e=s.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),o[r]=e,++a==i){n=me(t.doc,n);var u={from:n,to:n,text:t.doc.splitLines(o.join(t.doc.lineSeparator())),origin:"paste"};Tn(t.doc,u),Ce(t.doc,pe(n,_o(u)))}}),s.readAsText(e)}},u=0;i>u;++u)s(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout(function(){t.display.input.focus()},20);try{var o=e.dataTransfer.getData("Text");if(o){if(t.state.draggingText&&!(Mo?e.altKey:e.ctrlKey))var l=t.listSelections();if(Ee(t.doc,pe(n,n)),l)for(var u=0;ua.clientWidth,u=a.scrollHeight>a.clientHeight;if(r&&s||i&&u){if(i&&Mo&&Ao)e:for(var l=t.target,c=o.view;l!=a;l=l.parentNode)for(var f=0;fd?p=Math.max(0,p+d-50):h=Math.min(e.doc.height,h+d+50),N(e,{top:p,bottom:h})}20>Go&&(null==o.wheelStartX?(o.wheelStartX=a.scrollLeft,o.wheelStartY=a.scrollTop,o.wheelDX=r,o.wheelDY=i,setTimeout(function(){if(null!=o.wheelStartX){var e=a.scrollLeft-o.wheelStartX,t=a.scrollTop-o.wheelStartY,n=t&&o.wheelDY&&t/o.wheelDY||e&&o.wheelDX&&e/o.wheelDX;o.wheelStartX=o.wheelStartY=null,n&&(Jo=(Jo*Go+n)/(Go+1),++Go)}},200)):(o.wheelDX+=r,o.wheelDY+=i))}}function sn(e,t,n){if("string"==typeof t&&(t=la[t],!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)!=Da}finally{e.display.shift=r,e.state.suppressEdits=!1}return i}function un(e,t,n){for(var r=0;rxo&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var r=cn(t,e);Po&&(Qo=r?n:null,!r&&88==n&&!ns&&(Mo?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||pn(t)}}function pn(e){function t(e){18!=e.keyCode&&e.altKey||(Ya(n,"CodeMirror-crosshair"),Oa(document,"keyup",t),Oa(document,"mouseover",t))}var n=e.display.lineDiv;Qa(n,"CodeMirror-crosshair"),Na(document,"keyup",t),Na(document,"mouseover",t)}function hn(e){16==e.keyCode&&(this.doc.sel.shift=!1),Ti(this,e)}function mn(e){var t=this;if(!(Bt(t.display,e)||Ti(t,e)||e.ctrlKey&&!e.altKey||Mo&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(Po&&n==Qo)return Qo=null,void Ta(e);if(!Po||e.which&&!(e.which<10)||!cn(t,e)){var i=String.fromCharCode(null==r?n:r);fn(t,e,i)||t.display.input.onKeyPress(e)}}}function vn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,yn(e))},100)}function gn(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(La(e,"focus",e),e.state.focused=!0,Qa(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),Ao&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),He(e))}function yn(e){e.state.delayingBlurEvent||(e.state.focused&&(La(e,"blur",e),e.state.focused=!1,Ya(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function bn(e,t){Bt(e.display,t)||xn(e,t)||Ti(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function xn(e,t){return Si(e,"gutterContextMenu")?Qt(e,t,"gutterContextMenu",!1):!1}function An(e,t){if(Ho(e,t.from)<0)return e;if(Ho(e,t.to)<=0)return _o(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+=_o(t).ch-t.to.ch),zo(n,r)}function wn(e,t){for(var n=[],r=0;r=0;--i)En(e,{from:r[i].from,to:r[i].to,text:i?[""]:t.text});else En(e,t)}}function En(e,t){if(1!=t.text.length||""!=t.text[0]||0!=Ho(t.from,t.to)){var n=wn(e,t);li(e,t,n,e.cm?e.cm.curOp.id:NaN),Mn(e,t,n,or(e,t));var r=[];Kr(e,function(e,n){n||-1!=Ri(r,e.history)||(bi(e.history,t),r.push(e.history)),Mn(e,t,null,or(e,t))})}}function Sn(e,t,n){if(!e.cm||!e.cm.state.suppressEdits){for(var r,i=e.history,o=e.sel,a="undo"==t?i.done:i.undone,s="undo"==t?i.undone:i.done,u=0;u=0;--u){var f=r.changes[u];if(f.origin=t,c&&!Cn(e,f,!1))return void(a.length=0);l.push(ai(e,f));var d=u?wn(e,f):Li(a);Mn(e,f,d,sr(e,f)),!u&&e.cm&&e.cm.scrollIntoView({from:f.from,to:_o(f)});var p=[];Kr(e,function(e,t){t||-1!=Ri(p,e.history)||(bi(e.history,f),p.push(e.history)),Mn(e,f,null,sr(e,f))})}}}}function Nn(e,t){if(0!=t&&(e.first+=t,e.sel=new ce(ji(e.sel.ranges,function(e){return new fe(zo(e.anchor.line+t,e.anchor.ch),zo(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Dt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.lineo&&(t={from:t.from,to:zo(o,Qr(e,o).text.length),text:[t.text[0]],origin:t.origin}),t.removed=_r(e,t.from,t.to),n||(n=wn(e,t)),e.cm?On(e.cm,t,r):Zr(e,t,r),Ee(e,n,Ia)}}function On(e,t,n){var r=e.doc,i=e.display,a=t.from,s=t.to,u=!1,l=a.line;e.options.lineWrapping||(l=ti(yr(Qr(r,a.line))),r.iter(l,s.line+1,function(e){return e==i.maxLine?(u=!0,!0):void 0})),r.sel.contains(t.from,t.to)>-1&&Ei(e),Zr(r,t,n,o(e)),e.options.lineWrapping||(r.iter(l,a.line+t.text.length,function(e){var t=f(e);t>i.maxLineLength&&(i.maxLine=e,i.maxLineLength=t,i.maxLineChanged=!0,u=!1)}),u&&(e.curOp.updateMaxLine=!0)),r.frontier=Math.min(r.frontier,a.line),We(e,400);var c=t.text.length-(s.line-a.line)-1;t.full?Dt(e):a.line!=s.line||1!=t.text.length||Br(e.doc,t)?Dt(e,a.line,s.line+1,c):It(e,a.line,"text");var d=Si(e,"changes"),p=Si(e,"change");if(p||d){var h={from:a,to:s,text:t.text,removed:t.removed,origin:t.origin};p&&Pi(e,"change",e,h),d&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function Ln(e,t,n,r,i){if(r||(r=n),Ho(r,n)<0){var o=r;r=n,n=o}"string"==typeof t&&(t=e.splitLines(t)),Tn(e,{from:n,to:r,text:t,origin:i})}function Rn(e,t){if(!Ti(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&&!Eo){var o=Xi("div","​",null,"position: absolute; top: "+(t.top-n.viewOffset-Ue(e.display))+"px; height: "+(t.bottom-t.top+Ze(e)+n.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(o),o.scrollIntoView(i),e.display.lineSpace.removeChild(o)}}}function jn(e,t,n,r){null==r&&(r=0);for(var i=0;5>i;i++){var o=!1,a=pt(e,t),s=n&&n!=t?pt(e,n):a,u=In(e,Math.min(a.left,s.left),Math.min(a.top,s.top)-r,Math.max(a.left,s.left),Math.max(a.bottom,s.bottom)+r),l=e.doc.scrollTop,c=e.doc.scrollLeft;if(null!=u.scrollTop&&(rn(e,u.scrollTop),Math.abs(e.doc.scrollTop-l)>1&&(o=!0)),null!=u.scrollLeft&&(on(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(o=!0)),!o)break}return a}function Dn(e,t,n,r,i){var o=In(e,t,n,r,i);null!=o.scrollTop&&rn(e,o.scrollTop),null!=o.scrollLeft&&on(e,o.scrollLeft)}function In(e,t,n,r,i){var o=e.display,a=yt(e.display);0>n&&(n=0);var s=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:o.scroller.scrollTop,u=Je(e),l={};i-n>u&&(i=n+u);var c=e.doc.height+Ve(o),f=a>n,d=i>c-a;if(s>n)l.scrollTop=f?0:n;else if(i>s+u){var p=Math.min(n,(d?c:i)-u);p!=s&&(l.scrollTop=p)}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:o.scroller.scrollLeft,m=Ge(e)-(e.options.fixedGutter?o.gutters.offsetWidth:0),v=r-t>m;return v&&(r=t+m),10>t?l.scrollLeft=0:h>t?l.scrollLeft=Math.max(0,t-(v?0:10)):r>m+h-3&&(l.scrollLeft=r+(v?0:10)-m),l}function zn(e,t,n){(null!=t||null!=n)&&Wn(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function Hn(e){Wn(e);var t=e.getCursor(),n=t,r=t;e.options.lineWrapping||(n=t.ch?zo(t.line,t.ch-1):t,r=zo(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:r,margin:e.options.cursorScrollMargin,isCursor:!0}}function Wn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=ht(e,t.from),r=ht(e,t.to),i=In(e,Math.min(n.left,r.left),Math.min(n.top,r.top)-t.margin,Math.max(n.right,r.right),Math.max(n.bottom,r.bottom)+t.margin);e.scrollTo(i.scrollLeft,i.scrollTop)}}function Fn(e,t,n,r){var i,o=e.doc;null==n&&(n="add"),"smart"==n&&(o.mode.indent?i=Xe(e,t):n="prev");var a=e.options.tabSize,s=Qr(o,t),u=Wa(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),l==Da||l>150)){if(!r)return;n="prev"}}else l=0,n="not";"prev"==n?l=t>o.first?Wa(Qr(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 f="",d=0;if(e.options.indentWithTabs)for(var p=Math.floor(l/a);p;--p)d+=a,f+=" ";if(l>d&&(f+=Oi(l-d)),f!=c)return Ln(o,f,zo(t,0),zo(t,c.length),"+input"),s.stateAfter=null,!0;for(var p=0;p=0;t--)Ln(e.doc,"",r[t].from,r[t].to,"+delete");Hn(e)})}function Un(e,t,n,r,i){function o(){var t=s+n;return t=e.first+e.size?!1:(s=t,c=Qr(e,t))}function a(e){var t=(i?fo:po)(c,u,n,!0);if(null==t){if(e||!o())return!1;u=i?(0>n?io:ro)(c):0>n?c.text.length:0}else u=t;return!0}var s=t.line,u=t.ch,l=n,c=Qr(e,s);if("char"==r)a();else if("column"==r)a(!0);else if("word"==r||"group"==r)for(var f=null,d="group"==r,p=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(0>n)||a(!h);h=!1){var m=c.text.charAt(u)||"\n",v=Wi(m,p)?"w":d&&"\n"==m?"n":!d||/\s/.test(m)?null:"p";if(!d||h||v||(v="s"),f&&f!=v){0>n&&(n=1,a());break}if(v&&(f=v),n>0&&!a(!h))break}var g=Le(e,zo(s,u),t,l,!0);return Ho(t,g)||(g.hitSide=!0),g}function Vn(e,t,n,r){var i,o=e.doc,a=t.left;if("page"==r){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);i=t.top+n*(s-(0>n?1.5:.5)*yt(e.display))}else"line"==r&&(i=n>0?t.bottom+3:t.top-3);for(;;){var u=vt(e,a,i);if(!u.outside)break;if(0>n?0>=i:i>=o.height){u.hitSide=!0;break}i+=5*n}return u}function Bn(t,n,r,i){e.defaults[t]=n,r&&(ea[t]=i?function(e,t,n){n!=ta&&r(e,t,n)}:r)}function Zn(e){for(var t,n,r,i,o=e.split(/-(?!$)/),e=o[o.length-1],a=0;a0||0==a&&o.clearWhenEmpty!==!1)return o;if(o.replacedWith&&(o.collapsed=!0,o.widgetNode=Xi("span",[o.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||o.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(o.widgetNode.insertLeft=!0)),o.collapsed){if(gr(e,t.line,t,n,o)||t.line!=n.line&&gr(e,n.line,t,n,o))throw new Error("Inserting collapsed marker partially overlapping an existing one");Io=!0}o.addToHistory&&li(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&&yr(e)==l.display.maxLine&&(s=!0),o.collapsed&&u!=t.line&&ei(e,0),nr(e,new $n(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){wr(e,t)&&ei(t,0)}),o.clearOnEnter&&Na(o,"beforeCursorEnter",function(){o.clear()}),o.readOnly&&(Do=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),o.collapsed&&(o.id=++ma,o.atomic=!0),l){if(s&&(l.curOp.updateMaxLine=!0),o.collapsed)Dt(l,t.line,n.line+1);else if(o.className||o.title||o.startStyle||o.endStyle||o.css)for(var c=t.line;c<=n.line;c++)It(l,c,"text");o.atomic&&Ne(l.doc),Pi(l,"markerAdded",l,o)}return o}function Kn(e,t,n,r,i){r=zi(r),r.shared=!1;var o=[Jn(e,t,n,r,i)],a=o[0],s=r.widgetNode;return Kr(e,function(e){s&&(r.widgetNode=s.cloneNode(!0)),o.push(Jn(e,me(e,t),me(e,n),r,i));for(var u=0;u=t:o.to>t);(r||(r=[])).push(new $n(a,o.from,u?null:o.to))}}return r}function ir(e,t,n){if(e)for(var r,i=0;i=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.from0&&s)for(var f=0;ff;++f)h.push(m);h.push(u)}return h}function ar(e){for(var t=0;t0)){var c=[u,1],f=Ho(l.from,s.from),d=Ho(l.to,s.to);(0>f||!a.inclusiveLeft&&!f)&&c.push({from:l.from,to:s.from}),(d>0||!a.inclusiveRight&&!d)&&c.push({from:s.to,to:l.to}),i.splice.apply(i,c),u+=c.length-1}}return i}function lr(e){var t=e.markedSpans;if(t){for(var n=0;n=0&&0>=f||0>=c&&f>=0)&&(0>=c&&(Ho(l.to,n)>0||u.marker.inclusiveRight&&i.inclusiveLeft)||c>=0&&(Ho(l.from,r)<0||u.marker.inclusiveLeft&&i.inclusiveRight)))return!0}}}function yr(e){for(var t;t=mr(e);)e=t.find(-1,!0).line;return e}function br(e){for(var t,n;t=vr(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function xr(e,t){var n=Qr(e,t),r=yr(n);return n==r?t:ti(r)}function Ar(e,t){if(t>e.lastLine())return t;var n,r=Qr(e,t);if(!wr(e,r))return t;for(;n=vr(r);)r=n.find(1,!0).line;return ti(r)+1}function wr(e,t){var n=Io&&t.markedSpans;if(n)for(var r,i=0;io;o++){i&&(i[0]=e.innerMode(t,r).mode);var a=t.token(n,r);if(n.pos>n.start)return a}throw new Error("Mode "+t.name+" failed to advance stream.")}function Lr(e,t,n,r){function i(e){return{start:f.start,end:f.pos,string:f.current(),type:o||null,state:e?sa(a.mode,c):c}}var o,a=e.doc,s=a.mode;t=me(a,t);var u,l=Qr(a,t.line),c=Xe(e,t.line,n),f=new ha(l.text,e.options.tabSize);for(r&&(u=[]);(r||f.pose.options.maxHighlightLength?(s=!1,a&&Ir(e,t,r,f.pos),f.pos=t.length,u=null):u=Nr(Or(n,f,r,d),o),d){var p=d[0].name;p&&(u="m-"+(u?p+" "+u:p))}if(!s||c!=u){for(;ll;){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,"cm-overlay "+t),u=n+2;else for(;u>n;n+=2){var o=i[n+1];i[n+1]=(o?o+" ":"")+"cm-overlay "+t}},o)}return{styles:i,classes:o.bgClass||o.textClass?o:null}}function Dr(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Xe(e,ti(t)),i=jr(e,t,t.text.length>e.options.maxHighlightLength?sa(e.doc.mode,r):r);t.stateAfter=r,t.styles=i.styles,i.classes?t.styleClasses=i.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++}return t.styles}function Ir(e,t,n,r){var i=e.doc.mode,o=new ha(t,e.options.tabSize);for(o.start=o.pos=r||0,""==t&&Mr(i,n);!o.eol();)Or(i,o,n),o.start=o.pos}function zr(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?Aa:xa;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Hr(e,t){var n=Xi("span",null,null,Ao?"padding-right: .1px":null),r={pre:Xi("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,splitSpaces:(bo||Ao)&&e.getOption("lineWrapping")};t.measure={};for(var i=0;i<=(t.rest?t.rest.length:0);i++){var o,a=i?t.rest[i-1]:t.line;r.pos=0,r.addToken=Fr,_i(e.display.measure)&&(o=ii(a))&&(r.addToken=Xr(r.addToken,o)),r.map=[];var s=t!=e.display.externalMeasured&&ti(a);Vr(a,r,Dr(e,a,s)),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=Gi(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=Gi(a.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(Qi(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({}))}return Ao&&/\bcm-tab\b/.test(r.content.lastChild.className)&&(r.content.className="cm-tab-wrap-hack"),La(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Gi(r.pre.className,r.textClass||"")),r}function Wr(e){var t=Xi("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16),t.setAttribute("aria-label",t.title),t}function Fr(e,t,n,r,i,o,a){if(t){var s=e.splitSpaces?t.replace(/ {3,}/g,qr):t,u=e.cm.state.specialChars,l=!1;if(u.test(t))for(var c=document.createDocumentFragment(),f=0;;){u.lastIndex=f;var d=u.exec(t),p=d?d.index-f:t.length-f;if(p){var h=document.createTextNode(s.slice(f,f+p));bo&&9>xo?c.appendChild(Xi("span",[h])):c.appendChild(h),e.map.push(e.pos,e.pos+p,h),e.col+=p,e.pos+=p}if(!d)break;if(f+=p+1," "==d[0]){var m=e.cm.options.tabSize,v=m-e.col%m,h=c.appendChild(Xi("span",Oi(v),"cm-tab"));h.setAttribute("role","presentation"),h.setAttribute("cm-text"," "),e.col+=v}else if("\r"==d[0]||"\n"==d[0]){var h=c.appendChild(Xi("span","\r"==d[0]?"␍":"␤","cm-invalidchar")); -h.setAttribute("cm-text",d[0]),e.col+=1}else{var h=e.cm.options.specialCharPlaceholder(d[0]);h.setAttribute("cm-text",d[0]),bo&&9>xo?c.appendChild(Xi("span",[h])):c.appendChild(h),e.col+=1}e.map.push(e.pos,e.pos+1,h),e.pos++}else{e.col+=t.length;var c=document.createTextNode(s);e.map.push(e.pos,e.pos+t.length,c),bo&&9>xo&&(l=!0),e.pos+=t.length}if(n||r||i||l||a){var g=n||"";r&&(g+=r),i&&(g+=i);var y=Xi("span",[c],g,a);return o&&(y.title=o),e.content.appendChild(y)}e.content.appendChild(c)}}function qr(e){for(var t=" ",n=0;nl&&d.from<=l)break}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 Ur(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}function Vr(e,t,n){var r=e.markedSpans,i=e.text,o=0;if(r)for(var a,s,u,l,c,f,d,p=i.length,h=0,m=1,v="",g=0;;){if(g==h){u=l=c=f=s="",d=null,g=1/0;for(var y,b=[],x=0;xh||w.collapsed&&A.to==h&&A.from==h)?(null!=A.to&&A.to!=h&&g>A.to&&(g=A.to,l=""),w.className&&(u+=" "+w.className),w.css&&(s=(s?s+";":"")+w.css),w.startStyle&&A.from==h&&(c+=" "+w.startStyle),w.endStyle&&A.to==g&&(y||(y=[])).push(w.endStyle,A.to),w.title&&!f&&(f=w.title),w.collapsed&&(!d||pr(d.marker,w)<0)&&(d=A)):A.from>h&&g>A.from&&(g=A.from)}if(y)for(var x=0;x=p)break;for(var k=Math.min(p,g);;){if(v){var P=h+v.length;if(!d){var C=P>k?v.slice(0,k-h):v;t.addToken(t,C,a?a+u:u,c,h+C.length==g?l:"",f,s)}if(P>=k){v=v.slice(k-h),h=k;break}h=P,c=""}v=i.slice(o,o=n[m++]),a=zr(n[m++],t.cm.options)}}else for(var m=1;mn;++n)o.push(new ba(l[n],i(n),r));return o}var s=t.from,u=t.to,l=t.text,c=Qr(e,s.line),f=Qr(e,u.line),d=Li(l),p=i(l.length-1),h=u.line-s.line;if(t.full)e.insert(0,a(0,l.length)),e.remove(l.length,e.size-l.length);else if(Br(e,t)){var m=a(0,l.length-1);o(f,f.text,p),h&&e.remove(s.line,h),m.length&&e.insert(s.line,m)}else if(c==f)if(1==l.length)o(c,c.text.slice(0,s.ch)+d+c.text.slice(u.ch),p);else{var m=a(1,l.length-1);m.push(new ba(d+c.text.slice(u.ch),p,r)),o(c,c.text.slice(0,s.ch)+l[0],i(0)),e.insert(s.line+1,m)}else if(1==l.length)o(c,c.text.slice(0,s.ch)+l[0]+f.text.slice(u.ch),i(0)),e.remove(s.line+1,h);else{o(c,c.text.slice(0,s.ch)+l[0],i(0)),o(f,d+f.text.slice(u.ch),p);var m=a(1,l.length-1);h>1&&e.remove(s.line+1,h-1),e.insert(s.line+1,m)}Pi(e,"change",e,t)}function Gr(e){this.lines=e,this.parent=null;for(var t=0,n=0;tt||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(o>t){n=i;break}t-=o}return n.lines[t]}function _r(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 $r(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function ei(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function ti(e){if(null==e.parent)return null;for(var t=e.parent,n=Ri(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 ni(e,t){var n=e.first;e:do{for(var r=0;rt){e=i;continue e}t-=o,n+=i.chunkSize()}return n}while(!e.lines);for(var r=0;rt)break;t-=s}return n+r}function ri(e){e=yr(e);for(var t=0,n=e.parent,r=0;r1&&!e.done[e.done.length-2].ranges?(e.done.pop(),Li(e.done)):void 0}function li(e,t,n,r){var i=e.history;i.undone.length=0;var o,a=+new Date;if((i.lastOp==r||i.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&i.lastModTime>a-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(o=ui(i,i.lastOp==r))){var s=Li(o.changes);0==Ho(t.from,t.to)&&0==Ho(t.from,s.to)?s.to=_o(t):o.changes.push(ai(e,t))}else{var u=Li(i.done);for(u&&u.ranges||di(e.sel,i.done),o={changes:[ai(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=a,i.lastOp=i.lastSelOp=r,i.lastOrigin=i.lastSelOrigin=t.origin,s||La(e,"historyAdded")}function ci(e,t,n,r){var i=t.charAt(0);return"*"==i||"+"==i&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function 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||ci(e,o,Li(i.done),t))?i.done[i.done.length-1]=t:di(t,i.done),i.lastSelTime=+new Date,i.lastSelOrigin=o,i.lastSelOp=n,r&&r.clearRedo!==!1&&si(i.undone)}function di(e,t){var n=Li(t);n&&n.ranges&&n.equals(e)||t.push(e)}function pi(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 hi(e){if(!e)return null;for(var t,n=0;n-1&&(Li(s)[f]=c[f],delete c[f])}}}return i}function gi(e,t,n,r){n0?r.slice():Ma:r||Ma}function Pi(e,t){function n(e){return function(){e.apply(null,o)}}var r=ki(e,t,!1);if(r.length){var i,o=Array.prototype.slice.call(arguments,2);Vo?i=Vo.delayedCallbacks:Ra?i=Ra:(i=Ra=[],setTimeout(Ci,0));for(var a=0;a0}function Ni(e){e.prototype.on=function(e,t){Na(this,e,t)},e.prototype.off=function(e,t){Oa(this,e,t)}}function Mi(){this.id=null}function Oi(e){for(;qa.length<=e;)qa.push(Li(qa)+" ");return qa[e]}function Li(e){return e[e.length-1]}function Ri(e,t){for(var n=0;n-1&&Ba(e)?!0:t.test(e):Ba(e)}function Fi(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function qi(e){return e.charCodeAt(0)>=768&&Za.test(e)}function Xi(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;o0;--t)e.removeChild(e.firstChild);return e}function Vi(e,t){return Ui(e).appendChild(t)}function Bi(){for(var e=document.activeElement;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function Zi(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function Gi(e,t){for(var n=e.split(" "),r=0;r2&&!(bo&&8>xo))}var n=Ja?Xi("span","​"):Xi("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function _i(e){if(null!=Ka)return Ka;var t=Vi(e,document.createTextNode("AخA")),n=Ua(t,0,1).getBoundingClientRect();if(!n||n.left==n.right)return!1;var r=Ua(t,1,2).getBoundingClientRect();return Ka=r.right-n.right<3}function $i(e){if(null!=rs)return rs;var t=Vi(e,Xi("span","x")),n=t.getBoundingClientRect(),r=Ua(t,0,1).getBoundingClientRect();return rs=Math.abs(n.left-r.left)>1}function eo(e,t,n,r){if(!e)return r(t,n,"ltr");for(var i=!1,o=0;ot||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr"),i=!0)}i||r(t,n,"ltr")}function to(e){return e.level%2?e.to:e.from}function no(e){return e.level%2?e.from:e.to}function ro(e){var t=ii(e);return t?to(t[0]):0}function io(e){var t=ii(e);return t?no(Li(t)):e.text.length}function oo(e,t){var n=Qr(e.doc,t),r=yr(n);r!=n&&(t=ti(r));var i=ii(r),o=i?i[0].level%2?io(r):ro(r):0;return zo(t,o)}function ao(e,t){for(var n,r=Qr(e.doc,t);n=vr(r);)r=n.find(1,!0).line,t=null;var i=ii(r),o=i?i[0].level%2?ro(r):io(r):r.text.length;return zo(null==t?ti(r):t,o)}function so(e,t){var n=oo(e,t.line),r=Qr(e.doc,n.line),i=ii(r);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 zo(n.line,a?0:o)}return n}function uo(e,t,n){var r=e[0].level;return t==r?!0:n==r?!1:n>t}function lo(e,t){os=null;for(var n,r=0;rt)return r;if(i.from==t||i.to==t){if(null!=n)return uo(e,i.level,e[n].level)?(i.from!=i.to&&(os=n),r):(i.from!=i.to&&(os=r),n);n=r}}return n}function co(e,t,n,r){if(!r)return t+n;do t+=n;while(t>0&&qi(e.text.charAt(t)));return t}function fo(e,t,n,r){var i=ii(e);if(!i)return po(e,t,n,r);for(var o=lo(i,t),a=i[o],s=co(e,t,a.level%2?-n:n,r);;){if(s>a.from&&s0==a.level%2?a.to:a.from);if(a=i[o+=n],!a)return null;s=n>0==a.level%2?co(e,a.to,-1,r):co(e,a.from,1,r)}}function po(e,t,n,r){var i=t+n;if(r)for(;i>0&&qi(e.text.charAt(i));)i+=n;return 0>i||i>e.text.length?null:i}var ho=navigator.userAgent,mo=navigator.platform,vo=/gecko\/\d/i.test(ho),go=/MSIE \d/.test(ho),yo=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(ho),bo=go||yo,xo=bo&&(go?document.documentMode||6:yo[1]),Ao=/WebKit\//.test(ho),wo=Ao&&/Qt\/\d+\.\d+/.test(ho),ko=/Chrome\//.test(ho),Po=/Opera\//.test(ho),Co=/Apple Computer/.test(navigator.vendor),To=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(ho),Eo=/PhantomJS/.test(ho),So=/AppleWebKit/.test(ho)&&/Mobile\/\w+/.test(ho),No=So||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(ho),Mo=So||/Mac/.test(mo),Oo=/win/i.test(mo),Lo=Po&&ho.match(/Version\/(\d*\.\d*)/);Lo&&(Lo=Number(Lo[1])),Lo&&Lo>=15&&(Po=!1,Ao=!0);var Ro=Mo&&(wo||Po&&(null==Lo||12.11>Lo)),jo=vo||bo&&xo>=9,Do=!1,Io=!1;m.prototype=zi({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=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}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var e=Mo&&!To?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Mi,this.disableVert=new Mi},enableZeroWidthBar:function(e,t){function n(){var r=e.getBoundingClientRect(),i=document.elementFromPoint(r.left+1,r.bottom-1);i!=e?e.style.pointerEvents="none":t.set(1e3,n)}e.style.pointerEvents="auto",t.set(1e3,n)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},m.prototype),v.prototype=zi({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},v.prototype),e.scrollbarModel={"native":m,"null":v},C.prototype.signal=function(e,t){Si(e,t)&&this.events.push(arguments)},C.prototype.finish=function(){for(var e=0;e=9&&n.hasSelection&&(n.hasSelection=null),n.poll()}),Na(o,"paste",function(e){Ti(r,e)||_(e,r)||(r.state.pasteIncoming=!0,n.fastPoll())}),Na(o,"cut",t),Na(o,"copy",t),Na(e.scroller,"paste",function(t){Bt(e,t)||Ti(r,t)||(r.state.pasteIncoming=!0,n.focus())}),Na(e.lineSpace,"selectstart",function(t){Bt(e,t)||Ta(t)}),Na(o,"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"})}}),Na(o,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,n=e.doc,r=De(e);if(e.options.moveInputWithCursor){var i=pt(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},showSelection:function(e){var t=this.cm,n=t.display;Vi(n.cursorDiv,e.cursors),Vi(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,n,r=this.cm,i=r.doc;if(r.somethingSelected()){this.prevInput="";var o=i.sel.primary();t=ns&&(o.to().line-o.from().line>100||(n=r.getSelection()).length>1e3);var a=t?"-":n||r.getSelection();this.textarea.value=a,r.state.focused&&Xa(this.textarea),bo&&xo>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",bo&&xo>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!No||Bi()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var r=n.poll();r||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))}var t=!1,n=this;n.pollingFast=!0,n.polling.set(20,e)},poll:function(){var e=this.cm,t=this.textarea,n=this.prevInput;if(this.contextMenuPending||!e.state.focused||ts(t)&&!n&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=t.value;if(r==n&&!e.somethingSelected())return!1;if(bo&&xo>=9&&this.hasSelection===r||Mo&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var i=r.charCodeAt(0);if(8203!=i||n||(n="​"),8666==i)return this.reset(),this.cm.execCommand("undo")}for(var o=0,a=Math.min(n.length,r.length);a>o&&n.charCodeAt(o)==r.charCodeAt(o);)++o;var s=this;return Nt(e,function(){Q(e,r.slice(o),n.length-o,null,s.composing?"*compose":null),r.length>1e3||r.indexOf("\n")>-1?t.value=s.prevInput="":s.prevInput=r,s.composing&&(s.composing.range.clear(),s.composing.range=e.markText(s.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){bo&&xo>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function t(){if(null!=a.selectionStart){var e=i.somethingSelected(),t="​"+(e?a.value:"");a.value="⇚",a.value=t,r.prevInput=e?"":"​",a.selectionStart=1,a.selectionEnd=t.length,o.selForContextMenu=i.doc.sel}}function n(){if(r.contextMenuPending=!1,r.wrapper.style.position="relative",a.style.cssText=c,bo&&9>xo&&o.scrollbars.setScrollTop(o.scroller.scrollTop=u),null!=a.selectionStart){(!bo||bo&&9>xo)&&t();var e=0,n=function(){o.selForContextMenu==i.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&"​"==r.prevInput?Mt(i,la.selectAll)(i):e++<10?o.detectingSelectAll=setTimeout(n,500):o.input.reset()};o.detectingSelectAll=setTimeout(n,200)}}var r=this,i=r.cm,o=i.display,a=r.textarea,s=Zt(i,e),u=o.scroller.scrollTop;if(s&&!Po){var l=i.options.resetSelectionOnContextMenu;l&&-1==i.doc.sel.contains(s)&&Mt(i,Te)(i.doc,pe(s),Ia);var c=a.style.cssText;if(r.wrapper.style.position="absolute",a.style.cssText="position: fixed; width: 30px; height: 30px; top: "+(e.clientY-5)+"px; left: "+(e.clientX-5)+"px; z-index: 1000; background: "+(bo?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",Ao)var f=window.scrollY;if(o.input.focus(),Ao&&window.scrollTo(null,f),o.input.reset(),i.somethingSelected()||(a.value=r.prevInput=" "),r.contextMenuPending=!0,o.selForContextMenu=i.doc.sel,clearTimeout(o.detectingSelectAll),bo&&xo>=9&&t(),jo){Sa(e);var d=function(){Oa(window,"mouseup",d),setTimeout(n,20)};Na(window,"mouseup",d)}else setTimeout(n,50)}},readOnlyChanged:function(e){e||this.reset()},setUneditable:Di,needsContentAttribute:!1},ne.prototype),ie.prototype=zi({init:function(e){function t(e){if(!Ti(r,e)){if(r.somethingSelected())Wo=r.getSelections(),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=ee(r);Wo=t.text,"cut"==e.type&&r.operation(function(){r.setSelections(t.ranges,0,Ia),r.replaceSelection("",null,"cut")})}if(e.clipboardData&&!So)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",Wo.join("\n"));else{var n=re(),i=n.firstChild;r.display.lineSpace.insertBefore(n,r.display.lineSpace.firstChild),i.value=Wo.join("\n");var o=document.activeElement;Xa(i),setTimeout(function(){r.display.lineSpace.removeChild(n),o.focus()},50)}}}var n=this,r=n.cm,i=n.div=e.lineDiv;te(i),Na(i,"paste",function(e){Ti(r,e)||_(e,r)}),Na(i,"compositionstart",function(e){var t=e.data;if(n.composing={sel:r.doc.sel,data:t,startData:t},t){var i=r.doc.sel.primary(),o=r.getLine(i.head.line),a=o.indexOf(t,Math.max(0,i.head.ch-t.length));a>-1&&a<=i.head.ch&&(n.composing.sel=pe(zo(i.head.line,a),zo(i.head.line,a+t.length)))}}),Na(i,"compositionupdate",function(e){n.composing.data=e.data}),Na(i,"compositionend",function(e){var t=n.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||n.applyComposition(t),n.composing==t&&(n.composing=null)},50))}),Na(i,"touchstart",function(){n.forceCompositionEnd()}),Na(i,"input",function(){n.composing||(r.isReadOnly()||!n.pollContent())&&Nt(n.cm,function(){Dt(r)})}),Na(i,"copy",t),Na(i,"cut",t)},prepareSelection:function(){var e=De(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e){e&&this.cm.display.view.length&&(e.focus&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),n=se(this.cm,e.anchorNode,e.anchorOffset),r=se(this.cm,e.focusNode,e.focusOffset);if(!n||n.bad||!r||r.bad||0!=Ho(K(n,r),t.from())||0!=Ho(J(n,r),t.to())){var i=oe(this.cm,t.from()),o=oe(this.cm,t.to());if(i||o){var a=this.cm.display.view,s=e.rangeCount&&e.getRangeAt(0);if(i){if(!o){var u=a[a.length-1].measure,l=u.maps?u.maps[u.maps.length-1]:u.map;o={node:l[l.length-1],offset:l[l.length-2]-l[l.length-3]}}}else i={node:a[0].measure.map[2],offset:0};try{var c=Ua(i.node,i.offset,o.offset,o.node)}catch(f){}c&&(!vo&&this.cm.state.focused?(e.collapse(i.node,i.offset),c.collapsed||e.addRange(c)):(e.removeAllRanges(),e.addRange(c)),s&&null==e.anchorNode?e.addRange(s):vo&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){Vi(this.cm.display.cursorDiv,e.cursors),Vi(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Ga(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():Nt(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var n=se(t,e.anchorNode,e.anchorOffset),r=se(t,e.focusNode,e.focusOffset);n&&r&&Nt(t,function(){Te(t.doc,pe(n,r),Ia),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}},pollContent:function(){var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),i=n.to();if(r.linet.viewTo-1)return!1;var o;if(r.line==t.viewFrom||0==(o=Ht(e,r.line)))var a=ti(t.view[0].line),s=t.view[0].node;else var a=ti(t.view[o].line),s=t.view[o-1].node.nextSibling;var u=Ht(e,i.line);if(u==t.view.length-1)var l=t.viewTo-1,c=t.lineDiv.lastChild;else var l=ti(t.view[u+1].line)-1,c=t.view[u+1].node.previousSibling;for(var f=e.doc.splitLines(le(e,s,c,a,l)),d=_r(e.doc,zo(a,0),zo(l,Qr(e.doc,l).text.length));f.length>1&&d.length>1;)if(Li(f)==Li(d))f.pop(),d.pop(),l--;else{if(f[0]!=d[0])break;f.shift(),d.shift(),a++}for(var p=0,h=0,m=f[0],v=d[0],g=Math.min(m.length,v.length);g>p&&m.charCodeAt(p)==v.charCodeAt(p);)++p;for(var y=Li(f),b=Li(d),x=Math.min(y.length-(1==f.length?p:0),b.length-(1==d.length?p:0));x>h&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)++h;f[f.length-1]=y.slice(0,y.length-h),f[0]=f[0].slice(p);var A=zo(a,p),w=zo(l,d.length?Li(d).length-h:0);return f.length>1||f[0]||Ho(A,w)?(Ln(e.doc,f,A,w,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){this.cm.isReadOnly()?Mt(this.cm,Dt)(this.cm):e.data&&e.data!=e.startData&&Mt(this.cm,Q)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault(),this.cm.isReadOnly()||Mt(this.cm,Q)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String("nocursor"!=e)},onContextMenu:Di,resetPosition:Di,needsContentAttribute:!0},ie.prototype),e.inputStyles={textarea:ne,contenteditable:ie},ce.prototype={primary:function(){return this.ranges[this.primIndex]},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=0&&Ho(e,r.to())<=0)return n}return-1}},fe.prototype={from:function(){return K(this.anchor,this.head)},to:function(){return J(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var Fo,qo,Xo,Uo={left:0,right:0,top:0,bottom:0},Vo=null,Bo=0,Zo=0,Go=0,Jo=null;bo?Jo=-.53:vo?Jo=15:ko?Jo=-.7:Co&&(Jo=-1/3);var Ko=function(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}};e.wheelEventPixels=function(e){var t=Ko(e);return t.x*=Jo,t.y*=Jo,t};var Yo=new Mi,Qo=null,_o=e.changeEnd=function(e){return e.text?zo(e.from.line+e.text.length-1,Li(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var n=this.options,r=n[e];(n[e]!=t||"mode"==e)&&(n[e]=t,ea.hasOwnProperty(e)&&Mt(this,ea[e])(this,t,r))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Gn(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;nn&&(Fn(this,i.head.line,e,!0),n=i.head.line,r==this.doc.sel.primIndex&&Hn(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;n>u;++u)Fn(this,u,e);var l=this.doc.sel.ranges;0==o.ch&&t.length==l.length&&l[r].from().ch>0&&we(this.doc,r,new fe(o,l[r].to()),Ia)}}}),getTokenAt:function(e,t){return Lr(this,e,t)},getLineTokens:function(e,t){return Lr(this,zo(e),t,!0)},getTokenTypeAt:function(e){e=me(this.doc,e);var t,n=Dr(this,Qr(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]s?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 n=[];if(!aa.hasOwnProperty(t))return n;var r=aa[t],i=this.getModeAt(e);if("string"==typeof i[t])r[i[t]]&&n.push(r[i[t]]);else if(i[t])for(var o=0;oi&&(e=i,r=!0),n=Qr(this.doc,e)}else n=e;return ct(this,n,{top:0,left:0},t||"page").top+(r?this.doc.height-ri(n):0)},defaultTextHeight:function(){return yt(this.display)},defaultCharWidth:function(){return bt(this.display)},setGutterMarker:Ot(function(e,t,n){return qn(this.doc,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&Fi(r)&&(e.gutterMarkers=null),!0})}),clearGutter:Ot(function(e){var t=this,n=t.doc,r=n.first;n.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&(n.gutterMarkers[e]=null,It(t,r,"gutter"),Fi(n.gutterMarkers)&&(n.gutterMarkers=null)),++r})}),lineInfo:function(e){if("number"==typeof e){if(!ge(this.doc,e))return null;var t=e;if(e=Qr(this.doc,e),!e)return null}else{var t=ti(e);if(null==t)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}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,i){var o=this.display;e=pt(this,me(this.doc,e));var a=e.bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),o.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var u=Math.max(o.wrapper.clientHeight,this.doc.height),l=Math.max(o.sizer.clientWidth,o.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>u)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=u&&(a=e.bottom),s+t.offsetWidth>l&&(s=l-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==i?(s=o.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==i?s=0:"middle"==i&&(s=(o.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&Dn(this,s,a,s+t.offsetWidth,a+t.offsetHeight)},triggerOnKeyDown:Ot(dn),triggerOnKeyPress:Ot(mn),triggerOnKeyUp:hn,execCommand:function(e){return la.hasOwnProperty(e)?la[e].call(null,this):void 0},triggerElectric:Ot(function(e){$(this,e)}),findPosH:function(e,t,n,r){var i=1;0>t&&(i=-1,t=-t);for(var o=0,a=me(this.doc,e);t>o&&(a=Un(this.doc,a,i,n,r),!a.hitSide);++o);return a},moveH:Ot(function(e,t){var n=this;n.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?Un(n.doc,r.head,e,t,n.options.rtlMoveVisually):0>e?r.from():r.to()},Ha)}),deleteH:Ot(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Xn(this,function(n){var i=Un(r,n.head,e,t,!1);return 0>e?{from:i,to:n.head}:{from:n.head,to:i}})}),findPosV:function(e,t,n,r){var i=1,o=r;0>t&&(i=-1,t=-t);for(var a=0,s=me(this.doc,e);t>a;++a){var u=pt(this,s,"div");if(null==o?o=u.left:u.left=o,s=Vn(this,u,i,n),s.hitSide)break}return s},moveV:Ot(function(e,t){var n=this,r=this.doc,i=[],o=!n.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(a){if(o)return 0>e?a.from():a.to();var s=pt(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),i.push(s.left);var u=Vn(n,s,e,t);return"page"==t&&a==r.sel.primary()&&zn(n,null,dt(n,u,"div").top-s.top),u},Ha),i.length)for(var a=0;a0&&s(n.charAt(r-1));)--r;for(;i.5)&&a(this),La(this,"refresh",this)}),swapDoc:Ot(function(e){var t=this.doc;return t.cm=null,Yr(this,e),st(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Pi(this,"swapDoc",this,t),t}),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}},Ni(e);var $o=e.defaults={},ea=e.optionHandlers={},ta=e.Init={toString:function(){return"CodeMirror.Init"}};Bn("value","",function(e,t){e.setValue(t)},!0),Bn("mode",null,function(e,t){e.doc.modeOption=t,n(e)},!0),Bn("indentUnit",2,n,!0),Bn("indentWithTabs",!1),Bn("smartIndent",!0),Bn("tabSize",4,function(e){r(e),st(e),Dt(e)},!0),Bn("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(zo(r,o))}r++});for(var i=n.length-1;i>=0;i--)Ln(e.doc,t,n[i],zo(n[i].line,n[i].ch+t.length))}}),Bn("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,n,r){t.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),r!=e.Init&&t.refresh()}),Bn("specialCharPlaceholder",Wr,function(e){e.refresh()},!0),Bn("electricChars",!0),Bn("inputStyle",No?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Bn("rtlMoveVisually",!Oo),Bn("wholeLineUpdateBefore",!0),Bn("theme","default",function(e){s(e),u(e)},!0),Bn("keyMap","default",function(t,n,r){var i=Gn(n),o=r!=e.Init&&Gn(r);o&&o.detach&&o.detach(t,i),i.attach&&i.attach(t,o||null)}),Bn("extraKeys",null),Bn("lineWrapping",!1,i,!0),Bn("gutters",[],function(e){p(e.options),u(e)},!0),Bn("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?P(e.display)+"px":"0",e.refresh()},!0),Bn("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),Bn("scrollbarStyle","native",function(e){g(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Bn("lineNumbers",!1,function(e){p(e.options),u(e)},!0),Bn("firstLineNumber",1,u,!0),Bn("lineNumberFormatter",function(e){return e},u,!0),Bn("showCursorWhenSelecting",!1,je,!0),Bn("resetSelectionOnContextMenu",!0),Bn("lineWiseCopyCut",!0),Bn("readOnly",!1,function(e,t){"nocursor"==t?(yn(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),Bn("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Bn("dragDrop",!0,Ut),Bn("allowDropFileTypes",null),Bn("cursorBlinkRate",530),Bn("cursorScrollMargin",0),Bn("cursorHeight",1,je,!0),Bn("singleCursorHeightPerLine",!0,je,!0),Bn("workTime",100),Bn("workDelay",100),Bn("flattenSpans",!0,r,!0),Bn("addModeClass",!1,r,!0),Bn("pollInterval",100),Bn("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Bn("historyEventDelay",1250),Bn("viewportMargin",10,function(e){e.refresh()},!0),Bn("maxHighlightLength",1e4,r,!0),Bn("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Bn("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),Bn("autofocus",null);var na=e.modes={},ra=e.mimeModes={};e.defineMode=function(t,n){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),na[t]=n},e.defineMIME=function(e,t){ra[e]=t},e.resolveMode=function(t){if("string"==typeof t&&ra.hasOwnProperty(t))t=ra[t];else if(t&&"string"==typeof t.name&&ra.hasOwnProperty(t.name)){var n=ra[t.name];"string"==typeof n&&(n={name:n}),t=Ii(n,t),t.name=n.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,n){var n=e.resolveMode(n),r=na[n.name];if(!r)return e.getMode(t,"text/plain");var i=r(t,n);if(ia.hasOwnProperty(n.name)){var o=ia[n.name];for(var a in o)o.hasOwnProperty(a)&&(i.hasOwnProperty(a)&&(i["_"+a]=i[a]),i[a]=o[a])}if(i.name=n.name,n.helperType&&(i.helperType=n.helperType),n.modeProps)for(var a in n.modeProps)i[a]=n.modeProps[a];return i},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var ia=e.modeExtensions={};e.extendMode=function(e,t){var n=ia.hasOwnProperty(e)?ia[e]:ia[e]={};zi(t,n)},e.defineExtension=function(t,n){e.prototype[t]=n},e.defineDocExtension=function(e,t){ka.prototype[e]=t},e.defineOption=Bn;var oa=[];e.defineInitHook=function(e){oa.push(e)};var aa=e.helpers={};e.registerHelper=function(t,n,r){aa.hasOwnProperty(t)||(aa[t]=e[t]={_global:[]}),aa[t][n]=r},e.registerGlobalHelper=function(t,n,r,i){e.registerHelper(t,n,i),aa[t]._global.push({pred:r,val:i})};var sa=e.copyState=function(e,t){if(t===!0)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},ua=e.startState=function(e,t,n){return e.startState?e.startState(t,n):!0};e.innerMode=function(e,t){for(;e.innerMode;){var n=e.innerMode(t);if(!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}};var la=e.commands={selectAll:function(e){e.setSelection(zo(e.firstLine(),0),zo(e.lastLine()),Ia)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ia)},killLine:function(e){Xn(e,function(t){if(t.empty()){var n=Qr(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)i=new zo(i.line,i.ch+1),e.replaceRange(o.charAt(i.ch-1)+o.charAt(i.ch-2),zo(i.line,i.ch-2),i,"+transpose");else if(i.line>e.doc.first){var a=Qr(e.doc,i.line-1).text;a&&e.replaceRange(o.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),zo(i.line-1,a.length-1),zo(i.line,1),"+transpose")}n.push(new fe(i,i))}e.setSelections(n)})},newlineAndIndent:function(e){Nt(e,function(){for(var t=e.listSelections().length,n=0;t>n;n++){var r=e.listSelections()[n];e.replaceRange(e.doc.lineSeparator(),r.anchor,r.head,"+input"),e.indentLine(r.from().line+1,null,!0)}Hn(e)})},toggleOverwrite:function(e){e.toggleOverwrite()}},ca=e.keyMap={};ca.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"},ca.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"},ca.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"},ca.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"]},ca["default"]=Mo?ca.macDefault:ca.pcDefault,e.normalizeKeyMap=function(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=ji(n.split(" "),Zn),o=0;o=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.post},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return t>-1?(this.pos=t,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}var i=function(e){return n?e.toLowerCase():e},o=this.string.substr(this.pos,e.length);return i(o)==i(e)?(t!==!1&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var ma=0,va=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++ma};Ni(va),va.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&xt(e),Si(this,"clear")){var n=this.find();n&&Pi(this,"clear",n.from,n.to)}for(var r=null,i=null,o=0;oe.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=l,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Dt(e,r,i+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Ne(e.doc)),e&&Pi(e,"markerCleared",e,this),t&&wt(e),this.parent&&this.parent.clear()}},va.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n,r,i=0;in;++n){var i=this.lines[n];this.height-=i.height,Sr(i),Pi(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;re;++e)if(n(this.lines[e]))return!0}},Jr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;ne){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 Gr))){var s=[];this.collapse(s),this.children=[new Gr(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t=e){if(i.insertInner(e,t,n),i.lines&&i.lines.length>50){for(;i.lines.length>50;){var a=i.lines.splice(i.lines.length-25,25),s=new Gr(a);i.height-=s.height,this.children.splice(r+1,0,s),s.parent=this}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 Jr(t);if(e.parent){e.size-=n.size,e.height-=n.height;var r=Ri(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var i=new Jr(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;re){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 wa=0,ka=e.Doc=function(e,t,n,r){if(!(this instanceof ka))return new ka(e,t,n,r);null==n&&(n=0),Jr.call(this,[new Gr([new ba("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=n;var i=zo(n,0);this.sel=pe(i),this.history=new oi(null),this.id=++wa,this.modeOption=t,this.lineSep=r,this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Zr(this,{from:i,to:i,text:e}),Te(this,pe(i),Ia)};ka.prototype=Ii(Jr.prototype,{constructor:ka,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=0;o--)Tn(this,r[o]);s?Ce(this,s):this.cm&&Hn(this.cm)}),undo:Lt(function(){Sn(this,"undo")}),redo:Lt(function(){Sn(this,"redo")}),undoSelection:Lt(function(){Sn(this,"undo",!0)}),redoSelection:Lt(function(){Sn(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(i.marker.parent||i.marker)}return t},findMarks:function(e,t,n){e=me(this,e),t=me(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;su.to||null==u.from&&i!=e.line||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;re?(t=e,!0):(e-=i,void++n)}),me(this,zo(n,t))},indexFromPos:function(e){e=me(this,e);var t=e.ch;return e.linet&&(t=e.from),null!=e.to&&e.tos||s>=t)return a+(t-o);a+=s-o,a+=n-a%n,o=s+1}},Fa=e.findColumn=function(e,t,n){for(var r=0,i=0;;){var o=e.indexOf(" ",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,i+=n-i%n,r=o+1,i>=t)return r}},qa=[""],Xa=function(e){e.select()};So?Xa=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:bo&&(Xa=function(e){try{e.select()}catch(t){}});var Ua,Va=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Ba=e.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Va.test(e))},Za=/[\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]/;Ua=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(i){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var Ga=e.contains=function(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)};bo&&11>xo&&(Bi=function(){try{return document.activeElement}catch(e){return document.body}});var Ja,Ka,Ya=e.rmClass=function(e,t){var n=e.className,r=Zi(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:"")}},Qa=e.addClass=function(e,t){var n=e.className;Zi(t).test(n)||(e.className+=(n?" ":"")+t)},_a=!1,$a=function(){if(bo&&9>xo)return!1;var e=Xi("div");return"draggable"in e||"dragDrop"in e}(),es=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;r>=t;){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/)},ts=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},ns=function(){var e=Xi("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),rs=null,is=e.keyNames={3:"Enter",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:"/",127:"Delete",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"};!function(){for(var e=0;10>e;e++)is[e+48]=is[e+96]=String(e);for(var e=65;90>=e;e++)is[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)is[e+111]=is[e+63235]="F"+e}();var os,as=function(){function e(e){return 247>=e?n.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?r.charAt(e-1536):e>=1774&&2220>=e?"r":e>=8192&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",i=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,o=/[stwN]/,a=/[LRr]/,s=/[Lb1n]/,u=/[1n]/,l="L";return function(n){if(!i.test(n))return!1;for(var r,c=n.length,f=[],d=0;c>d;++d)f.push(r=e(n.charCodeAt(d)));for(var d=0,p=l;c>d;++d){var r=f[d];"m"==r?f[d]=p:p=r}for(var d=0,h=l;c>d;++d){var r=f[d];"1"==r&&"r"==h?f[d]="n":a.test(r)&&(h=r,"r"==r&&(f[d]="R"))}for(var d=1,p=f[0];c-1>d;++d){var r=f[d];"+"==r&&"1"==p&&"1"==f[d+1]?f[d]="1":","!=r||p!=f[d+1]||"1"!=p&&"n"!=p||(f[d]=p),p=r}for(var d=0;c>d;++d){var r=f[d];if(","==r)f[d]="N";else if("%"==r){for(var m=d+1;c>m&&"%"==f[m];++m);for(var v=d&&"!"==f[d-1]||c>m&&"1"==f[m]?"1":"N",g=d;m>g;++g)f[g]=v;d=m-1}}for(var d=0,h=l;c>d;++d){var r=f[d];"L"==h&&"1"==r?f[d]="L":a.test(r)&&(h=r)}for(var d=0;c>d;++d)if(o.test(f[d])){for(var m=d+1;c>m&&o.test(f[m]);++m);for(var y="L"==(d?f[d-1]:l),b="L"==(c>m?f[m]:l),v=y||b?"L":"R",g=d;m>g;++g)f[g]=v;d=m-1}for(var x,A=[],d=0;c>d;)if(s.test(f[d])){var w=d;for(++d;c>d&&s.test(f[d]);++d);A.push(new t(0,w,d))}else{var k=d,P=A.length;for(++d;c>d&&"L"!=f[d];++d);for(var g=k;d>g;)if(u.test(f[g])){g>k&&A.splice(P,0,new t(1,k,g));var C=g;for(++g;d>g&&u.test(f[g]);++g);A.splice(P,0,new t(2,C,g)),k=g}else++g;d>k&&A.splice(P,0,new t(1,k,d))}return 1==A[0].level&&(x=n.match(/^\s+/))&&(A[0].from=x[0].length,A.unshift(new t(0,0,x[0].length))),1==Li(A).level&&(x=n.match(/\s+$/))&&(Li(A).to-=x[0].length,A.push(new t(0,c-x[0].length,c))),2==A[0].level&&A.unshift(new t(1,A[0].to,A[0].to)),A[0].level!=Li(A).level&&A.push(new t(A[0].level,c,c)),A}}();return e.version="5.11.0",e})},function(e,t){"use strict";var n=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){return null==e||p["default"].isValidElement(e)}function o(e){return i(e)||Array.isArray(e)&&e.every(i)}function a(e,t,n){e=e||"UnknownComponent";for(var r in t)if(t.hasOwnProperty(r)){var i=t[r](n,r,e);i instanceof Error}}function s(e,t){return f({},e,t)}function u(e){var t=e.type,n=s(t.defaultProps,e.props);if(t.propTypes&&a(t.displayName||t.name,t.propTypes,n),n.children){var r=l(n.children,n);r.length&&(n.childRoutes=r),delete n.children}return n}function l(e,t){var n=[];return p["default"].Children.forEach(e,function(e){if(p["default"].isValidElement(e))if(e.type.createRouteFromReactElement){var r=e.type.createRouteFromReactElement(e,t);r&&n.push(r)}else n.push(u(e))}),n}function c(e){return o(e)?e=l(e):e&&!Array.isArray(e)&&(e=[e]),e}t.__esModule=!0;var f=Object.assign||function(e){for(var t=1;t should not have a "'+t+'" prop'):void 0}t.__esModule=!0,t.falsy=r;var i=n(4),o=i.PropTypes.func,a=i.PropTypes.object,s=i.PropTypes.arrayOf,u=i.PropTypes.oneOfType,l=i.PropTypes.element,c=i.PropTypes.shape,f=i.PropTypes.string,d=c({listen:o.isRequired,pushState:o.isRequired,replaceState:o.isRequired,go:o.isRequired});t.history=d;var p=c({pathname:f.isRequired,search:f.isRequired,state:a,action:f.isRequired,key:f});t.location=p;var h=u([o,f]);t.component=h;var m=u([h,a]);t.components=m;var v=u([a,l]);t.route=v;var g=u([v,s(v)]);t.routes=g,t["default"]={falsy:r,history:d,location:p,component:h,components:m,route:v}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){var t=e.match(/^https?:\/\/[^\/]*/);return null==t?e:e.substring(t[0].length)}function o(e){var t=i(e),n="",r="",o=t.indexOf("#");-1!==o&&(r=t.substring(o),t=t.substring(0,o));var a=t.indexOf("?");return-1!==a&&(n=t.substring(a),t=t.substring(0,a)),""===t&&(t="/"),{pathname:t,search:n,hash:r}}t.__esModule=!0,t.extractPath=i,t.parsePath=o;var a=n(15);r(a)},function(e,t,n){"use strict";function r(){i.attachRefs(this,this._currentElement)}var i=n(271),o={mountComponent:function(e,t,n,i){var o=e.mountComponent(t,n,i);return e._currentElement&&null!=e._currentElement.ref&&n.getReactMountReady().enqueue(r,e),o},unmountComponent:function(e){i.detachRefs(e,e._currentElement),e.unmountComponent()},receiveComponent:function(e,t,n,o){var a=e._currentElement;if(t!==a||o!==e._context){var s=i.shouldUpdateRefs(a,t);s&&i.detachRefs(e,a),e.receiveComponent(t,n,o),s&&e._currentElement&&null!=e._currentElement.ref&&n.getReactMountReady().enqueue(r,e)}},performUpdateIfNecessary:function(e,t){e.performUpdateIfNecessary(t)}};e.exports=o},function(e,t,n){"use strict";function r(e,t,n,r){this.dispatchConfig=e,this.dispatchMarker=t,this.nativeEvent=n;var i=this.constructor.Interface;for(var o in i)if(i.hasOwnProperty(o)){var s=i[o];s?this[o]=s(n):"target"===o?this.target=r:this[o]=n[o]}var u=null!=n.defaultPrevented?n.defaultPrevented:n.returnValue===!1;u?this.isDefaultPrevented=a.thatReturnsTrue:this.isDefaultPrevented=a.thatReturnsFalse,this.isPropagationStopped=a.thatReturnsFalse}var i=n(21),o=n(3),a=n(13),s=(n(2),{type:null,target:null,currentTarget:a.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null});o(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():e.returnValue=!1,this.isDefaultPrevented=a.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,this.isPropagationStopped=a.thatReturnsTrue)},persist:function(){this.isPersistent=a.thatReturnsTrue},isPersistent:a.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;this.dispatchConfig=null,this.dispatchMarker=null,this.nativeEvent=null}}),r.Interface=s,r.augmentClass=function(e,t){var n=this,r=Object.create(n.prototype);o(r,e.prototype),e.prototype=r,e.prototype.constructor=e,e.Interface=o({},n.Interface,t),e.augmentClass=n.augmentClass,i.addPoolingTo(e,i.fourArgumentPooler)},i.addPoolingTo(r,i.fourArgumentPooler),e.exports=r},function(e,t,n){"use strict";var r=n(1),i=function(e){var t,n={};e instanceof Object&&!Array.isArray(e)?void 0:r(!1);for(t in e)e.hasOwnProperty(t)&&(n[t]=t);return n};e.exports=i},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function o(e){return i(e).replace(/\/+/g,"/+")}function a(e){for(var t="",n=[],r=[],i=void 0,a=0,s=/:([a-zA-Z_$][a-zA-Z0-9_$]*)|\*\*|\*|\(|\)/g;i=s.exec(e);)i.index!==a&&(r.push(e.slice(a,i.index)),t+=o(e.slice(a,i.index))),i[1]?(t+="([^/?#]+)",n.push(i[1])):"**"===i[0]?(t+="([\\s\\S]*)",n.push("splat")):"*"===i[0]?(t+="([\\s\\S]*?)",n.push("splat")):"("===i[0]?t+="(?:":")"===i[0]&&(t+=")?"),r.push(i[0]),a=s.lastIndex;return a!==e.length&&(r.push(e.slice(a,e.length)),t+=o(e.slice(a,e.length))),{pattern:e,regexpSource:t,paramNames:n,tokens:r}}function s(e){return e in h||(h[e]=a(e)),h[e]}function u(e,t){"/"!==e.charAt(0)&&(e="/"+e),"/"!==t.charAt(0)&&(t="/"+t);var n=s(e),r=n.regexpSource,i=n.paramNames,o=n.tokens;r+="/*";var a="*"!==o[o.length-1];a&&(r+="([\\s\\S]*?)");var u=t.match(new RegExp("^"+r+"$","i")),l=void 0,c=void 0;if(null!=u){if(a){l=u.pop();var f=u[0].substr(0,u[0].length-l.length);if(l&&"/"!==f.charAt(f.length-1))return{remainingPathname:null,paramNames:i,paramValues:null}}else l="";c=u.slice(1).map(function(e){return null!=e?decodeURIComponent(e):e})}else l=c=null;return{remainingPathname:l,paramNames:i,paramValues:c}}function l(e){return s(e).paramNames}function c(e,t){var n=u(e,t),r=n.paramNames,i=n.paramValues;return null!=i?r.reduce(function(e,t,n){return e[t]=i[n],e},{}):null}function f(e,t){t=t||{};for(var n=s(e),r=n.tokens,i=0,o="",a=0,u=void 0,l=void 0,c=void 0,f=0,d=r.length;d>f;++f)u=r[f],"*"===u||"**"===u?(c=Array.isArray(t.splat)?t.splat[a++]:t.splat,null!=c||i>0?void 0:p["default"](!1),null!=c&&(o+=encodeURI(c))):"("===u?i+=1:")"===u?i-=1:":"===u.charAt(0)?(l=u.substring(1),c=t[l],null!=c||i>0?void 0:p["default"](!1),null!=c&&(o+=encodeURIComponent(c))):o+=u;return o.replace(/\/+/g,"/")}t.__esModule=!0,t.compilePattern=s,t.matchPattern=u,t.getParamNames=l,t.getParams=c,t.formatPattern=f;var d=n(8),p=r(d),h={}},function(e,t){"use strict";t.__esModule=!0;var n="PUSH";t.PUSH=n;var r="REPLACE";t.REPLACE=r;var i="POP";t.POP=i,t["default"]={PUSH:n,REPLACE:r,POP:i}},function(e,t,n){"use strict";function r(e,t){return(e&t)===t}var i=n(1),o={MUST_USE_ATTRIBUTE:1,MUST_USE_PROPERTY:2,HAS_SIDE_EFFECTS:4,HAS_BOOLEAN_VALUE:8,HAS_NUMERIC_VALUE:16,HAS_POSITIVE_NUMERIC_VALUE:48,HAS_OVERLOADED_BOOLEAN_VALUE:64,injectDOMPropertyConfig:function(e){var t=o,n=e.Properties||{},a=e.DOMAttributeNamespaces||{},u=e.DOMAttributeNames||{},l=e.DOMPropertyNames||{},c=e.DOMMutationMethods||{};e.isCustomAttribute&&s._isCustomAttributeFunctions.push(e.isCustomAttribute);for(var f in n){s.properties.hasOwnProperty(f)?i(!1):void 0;var d=f.toLowerCase(),p=n[f],h={attributeName:d,attributeNamespace:null,propertyName:f,mutationMethod:null,mustUseAttribute:r(p,t.MUST_USE_ATTRIBUTE),mustUseProperty:r(p,t.MUST_USE_PROPERTY),hasSideEffects:r(p,t.HAS_SIDE_EFFECTS),hasBooleanValue:r(p,t.HAS_BOOLEAN_VALUE),hasNumericValue:r(p,t.HAS_NUMERIC_VALUE),hasPositiveNumericValue:r(p,t.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:r(p,t.HAS_OVERLOADED_BOOLEAN_VALUE)};if(h.mustUseAttribute&&h.mustUseProperty?i(!1):void 0,!h.mustUseProperty&&h.hasSideEffects?i(!1):void 0,h.hasBooleanValue+h.hasNumericValue+h.hasOverloadedBooleanValue<=1?void 0:i(!1),u.hasOwnProperty(f)){var m=u[f];h.attributeName=m}a.hasOwnProperty(f)&&(h.attributeNamespace=a[f]),l.hasOwnProperty(f)&&(h.propertyName=l[f]),c.hasOwnProperty(f)&&(h.mutationMethod=c[f]),s.properties[f]=h}}},a={},s={ID_ATTRIBUTE_NAME:"data-reactid",properties:{},getPossibleStandardName:null,_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t=a;a++)if(i(e,a)&&i(t,a))r=a;else if(e.charAt(a)!==t.charAt(a))break;var s=e.substr(0,r);return o(s)?void 0:d(!1),s}function c(e,t,n,r,i,o){e=e||"",t=t||"",e===t?d(!1):void 0;var l=a(t,e);l||a(e,t)?void 0:d(!1);for(var c=0,f=l?s:u,p=e;;p=f(p,t)){var h;if(i&&p===e||o&&p===t||(h=n(p,l,r)),h===!1||p===t)break;c++1){var t=e.indexOf(p,1);return t>-1?e.substr(0,t):e}return null},traverseEnterLeave:function(e,t,n,r,i){var o=l(e,t);o!==e&&c(e,o,n,r,!1,!0),o!==t&&c(o,t,n,i,!0,!1)},traverseTwoPhase:function(e,t,n){e&&(c("",e,t,n,!0,!1),c(e,"",t,n,!1,!0))},traverseTwoPhaseSkipTarget:function(e,t,n){e&&(c("",e,t,n,!0,!0),c(e,"",t,n,!0,!0))},traverseAncestors:function(e,t,n){c("",e,t,n,!0,!1)},getFirstCommonAncestorID:l,_getNextDescendantID:u,isAncestorIDOf:a,SEPARATOR:p};e.exports=v},function(e,t,n){"use strict";var r={};e.exports=r},function(e,t,n){"use strict";var r=n(107),i=n(249),o=n(120),a=n(129),s=n(130),u=n(1),l=(n(2),{}),c=null,f=function(e,t){e&&(i.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e))},d=function(e){return f(e,!0)},p=function(e){return f(e,!1)},h=null,m={injection:{injectMount:i.injection.injectMount,injectInstanceHandle:function(e){h=e},getInstanceHandle:function(){return h},injectEventPluginOrder:r.injectEventPluginOrder,injectEventPluginsByName:r.injectEventPluginsByName},eventNameDispatchConfigs:r.eventNameDispatchConfigs,registrationNameModules:r.registrationNameModules,putListener:function(e,t,n){"function"!=typeof n?u(!1):void 0;var i=l[t]||(l[t]={});i[e]=n;var o=r.registrationNameModules[t];o&&o.didPutListener&&o.didPutListener(e,t,n)},getListener:function(e,t){var n=l[t];return n&&n[e]},deleteListener:function(e,t){var n=r.registrationNameModules[t];n&&n.willDeleteListener&&n.willDeleteListener(e,t);var i=l[t];i&&delete i[e]},deleteAllListeners:function(e){for(var t in l)if(l[t][e]){var n=r.registrationNameModules[t];n&&n.willDeleteListener&&n.willDeleteListener(e,t),delete l[t][e]}},extractEvents:function(e,t,n,i,o){for(var s,u=r.plugins,l=0;l=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e){return l.stringify(e).replace(/%20/g,"+")}function a(e){return function(){function t(e){if(null==e.query){var t=e.search;e.query=w(t.substring(1)),e[m]={search:t,searchBase:""}}return e}function n(e,t){var n,r=e[m],i=t?A(t):"";if(!r&&!i)return e;"string"==typeof e&&(e=d.parsePath(e));var o=void 0;o=r&&e.search===r.search?r.searchBase:e.search||"";var a=o;return i&&(a+=(a?"&":"?")+i),s({},e,(n={search:a},n[m]={search:a,searchBase:o},n))}function r(e){return P.listenBefore(function(n,r){f["default"](e,t(n),r)})}function a(e){return P.listen(function(n){e(t(n))})}function u(e){P.push(n(e,e.query))}function l(e){P.replace(n(e,e.query))}function c(e,t){return P.createPath(n(e,t||e.query))}function p(e,t){return P.createHref(n(e,t||e.query))}function g(e){for(var r=arguments.length,i=Array(r>1?r-1:0),o=1;r>o;o++)i[o-1]=arguments[o];var a=P.createLocation.apply(P,[n(e,e.query)].concat(i));return e.query&&(a.query=e.query),t(a)}function y(e,t,n){"string"==typeof t&&(t=d.parsePath(t)),u(s({state:e},t,{query:n}))}function b(e,t,n){"string"==typeof t&&(t=d.parsePath(t)),l(s({state:e},t,{query:n}))}var x=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],A=x.stringifyQuery,w=x.parseQueryString,k=i(x,["stringifyQuery","parseQueryString"]),P=e(k);return"function"!=typeof A&&(A=o),"function"!=typeof w&&(w=v),s({},P,{listenBefore:r,listen:a,push:u,replace:l,createPath:c,createHref:p,createLocation:g,pushState:h["default"](y,"pushState is deprecated; use push instead"),replaceState:h["default"](b,"replaceState is deprecated; use replace instead")})}}t.__esModule=!0;var s=Object.assign||function(e){for(var t=1;t":">","<":"<",'"':""","'":"'"},o=/[&><"']/g;e.exports=r},function(e,t,n){"use strict";var r=n(5),i=/^[ \r\n\t\f]/,o=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,a=function(e,t){e.innerHTML=t};if("undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(a=function(e,t){MSApp.execUnsafeLocalFunction(function(){e.innerHTML=t})}),r.canUseDOM){var s=document.createElement("div");s.innerHTML=" ",""===s.innerHTML&&(a=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),i.test(t)||"<"===t[0]&&o.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t})}e.exports=a},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){return{type:l,text:e,editor:t}}function o(e){return{type:c,toggledEditor:e}}function a(e){return{type:f,createdAt:e}}Object.defineProperty(t,"__esModule",{value:!0}),t.ActiveEditors=t.ADD_REVISION=t.TOGGLE_EDITORS=t.UPDATE_TEXT=void 0,t.updateText=i,t.toggleEditors=o,t.addRevision=a;var s=n(26),u=r(s),l=t.UPDATE_TEXT="UPDATE_TEXT",c=t.TOGGLE_EDITORS="TOGGLE_EDITORS",f=t.ADD_REVISION="ADD_REVISION";t.ActiveEditors=(0,u["default"])({MARKDOWN:null,TEXT:null})},function(e,t,n){function r(e){if(!o(e)||c.call(e)!=a||i(e))return!1;var t=s;if("function"==typeof e.constructor&&(t=f(e)),null===t)return!0;var n=t.constructor;return"function"==typeof n&&n instanceof n&&u.call(n)==l}var i=n(205),o=n(206),a="[object Object]",s=Object.prototype,u=Function.prototype.toString,l=u.call(Object),c=s.toString,f=Object.getPrototypeOf;e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0,t.connect=t.Provider=void 0;var i=n(214),o=r(i),a=n(215),s=r(a);t.Provider=o["default"],t.connect=s["default"]},function(e,t){"use strict";function n(e,t,n){function r(){return s=!0,u?void(c=[].concat(i.call(arguments))):void n.apply(this,arguments)}function o(){if(!s&&(l=!0,!u)){for(u=!0;!s&&e>a&&l;)l=!1,t.call(this,a++,o,r);return u=!1,s?void n.apply(this,c):void(a>=e&&l&&(s=!0,n()))}}var a=0,s=!1,u=!1,l=!1,c=void 0;o()}function r(e,t,n){function r(e,t,r){a||(t?(a=!0,n(t)):(o[e]=r,a=++s===i,a&&n(null,o)))}var i=e.length,o=[];if(0===i)return n(null,o);var a=!1,s=0;e.forEach(function(e,n){t(e,n,function(e,t){r(n,e,t)})})}t.__esModule=!0;var i=Array.prototype.slice;t.loopAsync=n,t.mapAsync=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;ts;++s)o=i[s](e);n(o)})}function v(){if(A.routes){for(var e=d(A.routes),t=void 0,n=0,r=e.length;"string"!=typeof t&&r>n;++n)t=e[n]();return t}}function y(e){var t=l(e,!1);t&&(delete P[t],i(P)||(C&&(C(),C=null),T&&(T(),T=null)))}function b(t,n){var r=l(t),o=P[r];if(o)-1===o.indexOf(n)&&o.push(n);else{var a=!i(P);P[r]=[n],a&&(C=e.listenBefore(h),e.listenBeforeUnload&&(T=e.listenBeforeUnload(v)))}return function(){var e=P[r];if(e){var i=e.filter(function(e){return e!==n});0===i.length?y(t):P[r]=i}}}function x(t){return e.listen(function(n){A.location===n?t(null,A):o(n,function(n,r,i){n?t(n):r?e.transitionTo(r):i&&t(null,i)})})}var A={},w=void 0,k=1,P={},C=void 0,T=void 0;return{isActive:n,match:o,listenBeforeLeavingRoute:b,listen:x}}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;tt||e.hasOverloadedBooleanValue&&t===!1}var o=n(29),a=n(10),s=n(294),u=(n(2),/^[a-zA-Z_][\w\.\-]*$/),l={},c={},f={createMarkupForID:function(e){return o.ID_ATTRIBUTE_NAME+"="+s(e)},setAttributeForID:function(e,t){e.setAttribute(o.ID_ATTRIBUTE_NAME,t)},createMarkupForProperty:function(e,t){var n=o.properties.hasOwnProperty(e)?o.properties[e]:null;if(n){if(i(n,t))return"";var r=n.attributeName;return n.hasBooleanValue||n.hasOverloadedBooleanValue&&t===!0?r+'=""':r+"="+s(t)}return o.isCustomAttribute(e)?null==t?"":e+"="+s(t):null},createMarkupForCustomAttribute:function(e,t){return r(e)&&null!=t?e+"="+s(t):""},setValueForProperty:function(e,t,n){var r=o.properties.hasOwnProperty(t)?o.properties[t]:null;if(r){var a=r.mutationMethod;if(a)a(e,n);else if(i(r,n))this.deleteValueForProperty(e,t);else if(r.mustUseAttribute){var s=r.attributeName,u=r.attributeNamespace;u?e.setAttributeNS(u,s,""+n):r.hasBooleanValue||r.hasOverloadedBooleanValue&&n===!0?e.setAttribute(s,""):e.setAttribute(s,""+n)}else{var l=r.propertyName;r.hasSideEffects&&""+e[l]==""+n||(e[l]=n)}}else o.isCustomAttribute(t)&&f.setValueForAttribute(e,t,n)},setValueForAttribute:function(e,t,n){r(t)&&(null==n?e.removeAttribute(t):e.setAttribute(t,""+n))},deleteValueForProperty:function(e,t){var n=o.properties.hasOwnProperty(t)?o.properties[t]:null;if(n){var r=n.mutationMethod;if(r)r(e,void 0);else if(n.mustUseAttribute)e.removeAttribute(n.attributeName);else{var i=n.propertyName,a=o.getDefaultValueForProperty(e.nodeName,i);n.hasSideEffects&&""+e[i]===a||(e[i]=a)}}else o.isCustomAttribute(t)&&e.removeAttribute(t)}};a.measureMethods(f,"DOMPropertyOperations",{setValueForProperty:"setValueForProperty",setValueForAttribute:"setValueForAttribute",deleteValueForProperty:"deleteValueForProperty"}),e.exports=f},function(e,t,n){"use strict";function r(e){null!=e.checkedLink&&null!=e.valueLink?l(!1):void 0}function i(e){r(e),null!=e.value||null!=e.onChange?l(!1):void 0}function o(e){r(e),null!=e.checked||null!=e.onChange?l(!1):void 0}function a(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}var s=n(126),u=n(42),l=n(1),c=(n(2),{button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0}),f={value:function(e,t,n){return!e[t]||c[e.type]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(e,t,n){return!e[t]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:s.func},d={},p={checkPropTypes:function(e,t,n){for(var r in f){if(f.hasOwnProperty(r))var i=f[r](t,r,e,u.prop);if(i instanceof Error&&!(i.message in d)){d[i.message]=!0;a(n)}}},getValue:function(e){return e.valueLink?(i(e),e.valueLink.value):e.value},getChecked:function(e){return e.checkedLink?(o(e),e.checkedLink.value):e.checked},executeOnChange:function(e,t){return e.valueLink?(i(e),e.valueLink.requestChange(t.target.value)):e.checkedLink?(o(e),e.checkedLink.requestChange(t.target.checked)):e.onChange?e.onChange.call(void 0,t):void 0}};e.exports=p},function(e,t,n){"use strict";var r=n(63),i=n(7),o={processChildrenUpdates:r.dangerouslyProcessChildrenUpdates,replaceNodeWithMarkupByID:r.dangerouslyReplaceNodeWithMarkupByID,unmountIDFromEnvironment:function(e){i.purgeID(e)}};e.exports=o},function(e,t,n){"use strict";var r=n(1),i=!1,o={unmountIDFromEnvironment:null,replaceNodeWithMarkupByID:null,processChildrenUpdates:null,injection:{injectEnvironment:function(e){i?r(!1):void 0,o.unmountIDFromEnvironment=e.unmountIDFromEnvironment,o.replaceNodeWithMarkupByID=e.replaceNodeWithMarkupByID,o.processChildrenUpdates=e.processChildrenUpdates,i=!0}}};e.exports=o},function(e,t,n){"use strict";var r=n(106),i=n(59),o=n(7),a=n(10),s=n(1),u={dangerouslySetInnerHTML:"`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.",style:"`style` must be set using `updateStylesByID()`."},l={updatePropertyByID:function(e,t,n){var r=o.getNode(e);u.hasOwnProperty(t)?s(!1):void 0,null!=n?i.setValueForProperty(r,t,n):i.deleteValueForProperty(r,t)},dangerouslyReplaceNodeWithMarkupByID:function(e,t){var n=o.getNode(e);r.dangerouslyReplaceNodeWithMarkup(n,t)},dangerouslyProcessChildrenUpdates:function(e,t){for(var n=0;n=32||13===t?t:0}e.exports=n},function(e,t){"use strict";function n(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=i[e];return r?!!n[r]:!1}function r(e){return n}var i={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};e.exports=r},function(e,t){"use strict";function n(e){var t=e.target||e.srcElement||window;return 3===t.nodeType?t.parentNode:t}e.exports=n},function(e,t){"use strict";function n(e){var t=e&&(r&&e[r]||e[i]);return"function"==typeof t?t:void 0}var r="function"==typeof Symbol&&Symbol.iterator,i="@@iterator";e.exports=n},function(e,t,n){"use strict";function r(e){return"function"==typeof e&&"undefined"!=typeof e.prototype&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}function i(e){var t;if(null===e||e===!1)t=new a(i);else if("object"==typeof e){var n=e;!n||"function"!=typeof n.type&&"string"!=typeof n.type?l(!1):void 0,t="string"==typeof n.type?s.createInternalComponent(n):r(n.type)?new n.type(n):new c}else"string"==typeof e||"number"==typeof e?t=s.createInstanceForText(e):l(!1);return t.construct(e),t._mountIndex=0,t._mountImage=null,t}var o=n(255),a=n(118),s=n(124),u=n(3),l=n(1),c=(n(2),function(){});u(c.prototype,o.Mixin,{_instantiateReactComponent:i}),e.exports=i},function(e,t,n){"use strict";/** +!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="/static/",t(0)}([function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}function o(e){return e&&e.__esModule?e:{"default":e}}var i=n(2),a=o(i),s=n(93),u=n(39),l=n(103),c=n(80),f=n(331),d=o(f),p=n(330),h=r(p),m=n(323),v=o(m),g=n(81),y=o(g),b=n(54),x=(o(b),n(159)),A=o(x),w=n(152),k=o(w),P=n(167),C=o(P),T=n(163),E=o(T),N=n(82),M=(o(N),n(169)),S=o(M),O=h.reducer(A["default"]),L=(0,v["default"])("atlas-store"),j=h.createMiddleware(L),R=(0,c.applyMiddleware)(j,d["default"])(c.createStore),D=R(O),I=h.createLoader(L);I(D),(0,s.render)(a["default"].createElement(u.Provider,{store:D},a["default"].createElement(l.Router,{history:y["default"]},a["default"].createElement(l.Route,{path:"/",component:k["default"]},a["default"].createElement(l.IndexRoute,{component:C["default"]}),a["default"].createElement(l.Route,{path:"/editor",component:E["default"]}),a["default"].createElement(l.Route,{path:"/auth/slack",component:S["default"]})))),document.getElementById("root"))},function(e,t,n){"use strict";function r(e,t,n,r,o,i,a,s){if(!e){var u;if(void 0===t)u=new Error("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var l=[n,r,o,i,a,s],c=0;u=new Error(t.replace(/%s/g,function(){return l[c++]})),u.name="Invariant Violation"}throw u.framesToPop=1,u}}e.exports=r},function(e,t,n){"use strict";e.exports=n(274)},function(e,t,n){"use strict";var r=n(15),o=r;e.exports=o},function(e,t){"use strict";function n(e,t){if(null==e)throw new TypeError("Object.assign target cannot be null or undefined");for(var n=Object(e),r=Object.prototype.hasOwnProperty,o=1;o2?n-2:0),o=2;n>o;o++)r[o-2]=arguments[o]}function i(){s={}}t.__esModule=!0,t["default"]=o,t._resetWarned=i;var a=n(14),s=(r(a),{})},function(e,t){"use strict";var n=!("undefined"==typeof window||!window.document||!window.document.createElement),r={canUseDOM:n,canUseWorkers:"undefined"!=typeof Worker,canUseEventListeners:n&&!(!window.addEventListener&&!window.attachEvent),canUseViewport:n&&!!window.screen,isInWorker:!n};e.exports=r},function(e,t){e.exports=function(){var e=[];return e.toString=function(){for(var e=[],t=0;tr;r++)if(e.charAt(r)!==t.charAt(r))return r;return e.length===t.length?-1:n}function o(e){return e?e.nodeType===U?e.documentElement:e.firstChild:null}function i(e){var t=o(e);return t&&Y.getID(t)}function a(e){var t=s(e);if(t)if(F.hasOwnProperty(t)){var n=F[t];n!==e&&(f(n,t)?I(!1):void 0,F[t]=e)}else F[t]=e;return t}function s(e){return e&&e.getAttribute&&e.getAttribute(W)||""}function u(e,t){var n=s(e);n!==t&&delete F[n],e.setAttribute(W,t),F[t]=e}function l(e){return F.hasOwnProperty(e)&&f(F[e],e)||(F[e]=Y.findReactNodeByID(e)),F[e]}function c(e){var t=T.get(e)._rootNodeID;return P.isNullComponentID(t)?null:(F.hasOwnProperty(t)&&f(F[t],t)||(F[t]=Y.findReactNodeByID(t)),F[t])}function f(e,t){if(e){s(e)!==t?I(!1):void 0;var n=Y.findReactContainerForID(t);if(n&&R(n,e))return!0}return!1}function d(e){delete F[e]}function p(e){var t=F[e];return t&&f(t,e)?void(J=t):!1}function h(e){J=null,C.traverseAncestors(e,p);var t=J;return J=null,t}function m(e,t,n,r,o,i){w.useCreateElement&&(i=L({},i),n.nodeType===U?i[V]=n:i[V]=n.ownerDocument);var a=M.mountComponent(e,t,r,i);e._renderedComponent._topLevelWrapper=e,Y._mountImageIntoNode(a,n,o,r)}function v(e,t,n,r,o){var i=O.ReactReconcileTransaction.getPooled(r);i.perform(m,null,e,t,n,i,r,o),O.ReactReconcileTransaction.release(i)}function g(e,t){for(M.unmountComponent(e),t.nodeType===U&&(t=t.documentElement);t.lastChild;)t.removeChild(t.lastChild)}function y(e){var t=i(e);return t?t!==C.getReactRootIDFromNodeID(t):!1}function b(e){for(;e&&e.parentNode!==e;e=e.parentNode)if(1===e.nodeType){var t=s(e);if(t){var n,r=C.getReactRootIDFromNodeID(t),o=e;do if(n=s(o),o=o.parentNode,null==o)return null;while(n!==r);if(o===Z[r])return e}}return null}var x=n(29),A=n(44),w=(n(17),n(117)),k=n(11),P=n(124),C=n(30),T=n(34),E=n(127),N=n(12),M=n(24),S=n(67),O=n(13),L=n(4),j=n(31),R=n(84),D=n(74),I=n(1),z=n(51),H=n(77),W=(n(79),n(3),x.ID_ATTRIBUTE_NAME),F={},q=1,U=9,X=11,V="__ReactMount_ownerDocument$"+Math.random().toString(36).slice(2),B={},Z={},G=[],J=null,K=function(){};K.prototype.isReactComponent={},K.prototype.render=function(){return this.props};var Y={TopLevelWrapper:K,_instancesByReactRootID:B,scrollMonitor:function(e,t){t()},_updateRootComponent:function(e,t,n,r){return Y.scrollMonitor(n,function(){S.enqueueElementInternal(e,t),r&&S.enqueueCallbackInternal(e,r)}),e},_registerComponent:function(e,t){!t||t.nodeType!==q&&t.nodeType!==U&&t.nodeType!==X?I(!1):void 0,A.ensureScrollValueMonitoring();var n=Y.registerContainer(t);return B[n]=e,n},_renderNewRootComponent:function(e,t,n,r){var o=D(e,null),i=Y._registerComponent(o,t);return O.batchedUpdates(v,o,i,t,n,r),o},renderSubtreeIntoContainer:function(e,t,n,r){return null==e||null==e._reactInternalInstance?I(!1):void 0,Y._renderSubtreeIntoContainer(e,t,n,r)},_renderSubtreeIntoContainer:function(e,t,n,r){k.isValidElement(t)?void 0:I(!1);var a=new k(K,null,null,null,null,null,t),u=B[i(n)];if(u){var l=u._currentElement,c=l.props;if(H(c,t)){var f=u._renderedComponent.getPublicInstance(),d=r&&function(){r.call(f)};return Y._updateRootComponent(u,a,n,d),f}Y.unmountComponentAtNode(n)}var p=o(n),h=p&&!!s(p),m=y(n),v=h&&!u&&!m,g=Y._renderNewRootComponent(a,n,v,null!=e?e._reactInternalInstance._processChildContext(e._reactInternalInstance._context):j)._renderedComponent.getPublicInstance();return r&&r.call(g),g},render:function(e,t,n){return Y._renderSubtreeIntoContainer(null,e,t,n)},registerContainer:function(e){var t=i(e);return t&&(t=C.getReactRootIDFromNodeID(t)),t||(t=C.createReactRootID()),Z[t]=e,t},unmountComponentAtNode:function(e){!e||e.nodeType!==q&&e.nodeType!==U&&e.nodeType!==X?I(!1):void 0;var t=i(e),n=B[t];if(!n){var r=(y(e),s(e));r&&r===C.getReactRootIDFromNodeID(r);return!1}return O.batchedUpdates(g,n,e),delete B[t],delete Z[t],!0},findReactContainerForID:function(e){var t=C.getReactRootIDFromNodeID(e),n=Z[t];return n},findReactNodeByID:function(e){var t=Y.findReactContainerForID(e);return Y.findComponentRoot(t,e)},getFirstReactDOM:function(e){return b(e)},findComponentRoot:function(e,t){var n=G,r=0,o=h(t)||e;for(n[0]=o.firstChild,n.length=1;r=0&&b.splice(t,1)}function s(e){var t=document.createElement("style");return t.type="text/css",i(e,t),t}function u(e){var t=document.createElement("link");return t.rel="stylesheet",i(e,t),t}function l(e,t){var n,r,o;if(t.singleton){var i=y++;n=g||(g=s(t)),r=c.bind(null,n,i,!1),o=c.bind(null,n,i,!0)}else e.sourceMap&&"function"==typeof URL&&"function"==typeof URL.createObjectURL&&"function"==typeof URL.revokeObjectURL&&"function"==typeof Blob&&"function"==typeof btoa?(n=u(t),r=d.bind(null,n),o=function(){a(n),n.href&&URL.revokeObjectURL(n.href)}):(n=s(t),r=f.bind(null,n),o=function(){a(n)});return r(e),function(t){if(t){if(t.css===e.css&&t.media===e.media&&t.sourceMap===e.sourceMap)return;r(e=t)}else o()}}function c(e,t,n,r){var o=n?"":r.css;if(e.styleSheet)e.styleSheet.cssText=x(t,o);else{var i=document.createTextNode(o),a=e.childNodes;a[t]&&e.removeChild(a[t]),a.length?e.insertBefore(i,a[t]):e.appendChild(i)}}function f(e,t){var n=t.css,r=t.media;if(r&&e.setAttribute("media",r),e.styleSheet)e.styleSheet.cssText=n;else{for(;e.firstChild;)e.removeChild(e.firstChild);e.appendChild(document.createTextNode(n))}}function d(e,t){var n=t.css,r=t.sourceMap;r&&(n+="\n/*# sourceMappingURL=data:application/json;base64,"+btoa(unescape(encodeURIComponent(JSON.stringify(r))))+" */");var o=new Blob([n],{type:"text/css"}),i=e.href;e.href=URL.createObjectURL(o),i&&URL.revokeObjectURL(i)}var p={},h=function(e){var t;return function(){return"undefined"==typeof t&&(t=e.apply(this,arguments)),t}},m=h(function(){return/msie [6-9]\b/.test(window.navigator.userAgent.toLowerCase())}),v=h(function(){return document.head||document.getElementsByTagName("head")[0]}),g=null,y=0,b=[];e.exports=function(e,t){t=t||{},"undefined"==typeof t.singleton&&(t.singleton=m()),"undefined"==typeof t.insertAt&&(t.insertAt="bottom");var n=o(e);return r(n,t),function(e){for(var i=[],a=0;a1){for(var p=Array(d),h=0;d>h;h++)p[h]=arguments[h+2];i.children=p}if(e&&e.defaultProps){var m=e.defaultProps;for(o in m)"undefined"==typeof i[o]&&(i[o]=m[o])}return s(e,u,l,c,f,r.current,i)},s.createFactory=function(e){var t=s.createElement.bind(null,e);return t.type=e,t},s.cloneAndReplaceKey=function(e,t){var n=s(e.type,t,e.ref,e._self,e._source,e._owner,e.props);return n},s.cloneAndReplaceProps=function(e,t){var n=s(e.type,e.key,e.ref,e._self,e._source,e._owner,t);return n},s.cloneElement=function(e,t,n){var i,u=o({},e.props),l=e.key,c=e.ref,f=e._self,d=e._source,p=e._owner;if(null!=t){void 0!==t.ref&&(c=t.ref,p=r.current),void 0!==t.key&&(l=""+t.key);for(i in t)t.hasOwnProperty(i)&&!a.hasOwnProperty(i)&&(u[i]=t[i])}var h=arguments.length-2;if(1===h)u.children=n;else if(h>1){for(var m=Array(h),v=0;h>v;v++)m[v]=arguments[v+2];u.children=m}return s(e.type,l,c,f,d,p,u)},s.isValidElement=function(e){return"object"==typeof e&&null!==e&&e.$$typeof===i},e.exports=s},function(e,t,n){"use strict";function r(e,t,n){return n}var o={enableMeasure:!1,storedMeasure:r,measureMethods:function(e,t,n){},measure:function(e,t,n){return n},injection:{injectMeasure:function(e){o.storedMeasure=e}}};e.exports=o},function(e,t,n){"use strict";function r(){T.ReactReconcileTransaction&&x?void 0:v(!1)}function o(){this.reinitializeTransaction(),this.dirtyComponentsLength=null,this.callbackQueue=c.getPooled(),this.reconcileTransaction=T.ReactReconcileTransaction.getPooled(!1)}function i(e,t,n,o,i,a){r(),x.batchedUpdates(e,t,n,o,i,a)}function a(e,t){return e._mountOrder-t._mountOrder}function s(e){var t=e.dirtyComponentsLength;t!==g.length?v(!1):void 0,g.sort(a);for(var n=0;t>n;n++){var r=g[n],o=r._pendingCallbacks;if(r._pendingCallbacks=null,p.performUpdateIfNecessary(r,e.reconcileTransaction),o)for(var i=0;ixi&&setTimeout(function(){u.display.input.reset(!0)},20),Ut(this),Yo(),xt(this),this.curOp.forceUpdate=!0,Yr(this,o),r.autofocus&&!Mi||u.hasFocus()?setTimeout(Wo(gn,this),20):yn(this);for(var c in ta)ta.hasOwnProperty(c)&&ta[c](this,r[c],na);w(this),r.finishInit&&r.finishInit(this);for(var f=0;fxi&&(r.gutters.style.zIndex=-1,r.scroller.style.paddingRight=0),Ai||vi&&Mi||(r.scroller.draggable=!0),e&&(e.appendChild?e.appendChild(r.wrapper):e(r.wrapper)),r.viewFrom=r.viewTo=t.first,r.reportedViewFrom=r.reportedViewTo=t.first,r.view=[],r.renderedView=null,r.externalMeasured=null,r.viewOffset=0,r.lastWrapHeight=r.lastWrapWidth=0,r.updateLineNumbers=null,r.nativeBarWidth=r.barHeight=r.barWidth=0,r.scrollbarsClipped=!1,r.lineNumWidth=r.lineNumInnerWidth=r.lineNumChars=null,r.alignWidgets=!1,r.cachedCharWidth=r.cachedTextHeight=r.cachedPaddingH=null,r.maxLine=null,r.maxLineLength=0,r.maxLineChanged=!1,r.wheelDX=r.wheelDY=r.wheelStartX=r.wheelStartY=null,r.shift=!1,r.selForContextMenu=null,r.activeTouch=null,n.init(r)}function n(t){t.doc.mode=e.getMode(t.options,t.doc.modeOption),r(t)}function r(e){e.doc.iter(function(e){e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null)}),e.doc.frontier=e.doc.first,We(e,100),e.state.modeGen++,e.curOp&&Dt(e)}function o(e){e.options.lineWrapping?(_a(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(Qa(e.display.wrapper,"CodeMirror-wrap"),d(e)),a(e),Dt(e),st(e),setTimeout(function(){y(e)},100)}function i(e){var t=yt(e.display),n=e.options.lineWrapping,r=n&&Math.max(5,e.display.scroller.clientWidth/bt(e.display)-3);return function(o){if(wr(e.doc,o))return 0;var i=0;if(o.widgets)for(var a=0;at.maxLineLength&&(t.maxLineLength=n,t.maxLine=e)})}function p(e){var t=Ro(e.gutters,"CodeMirror-linenumbers");-1==t&&e.lineNumbers?e.gutters=e.gutters.concat(["CodeMirror-linenumbers"]):t>-1&&!e.lineNumbers&&(e.gutters=e.gutters.slice(0),e.gutters.splice(t,1))}function h(e){var t=e.display,n=t.gutters.offsetWidth,r=Math.round(e.doc.height+Ve(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+Ze(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:n}}function m(e,t,n){this.cm=n;var r=this.vert=Xo("div",[Xo("div",null,null,"min-width: 1px")],"CodeMirror-vscrollbar"),o=this.horiz=Xo("div",[Xo("div",null,null,"height: 100%; min-height: 1px")],"CodeMirror-hscrollbar");e(r),e(o),Sa(r,"scroll",function(){r.clientHeight&&t(r.scrollTop,"vertical")}),Sa(o,"scroll",function(){o.clientWidth&&t(o.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,bi&&8>xi&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")}function v(){}function g(t){t.display.scrollbars&&(t.display.scrollbars.clear(),t.display.scrollbars.addClass&&Qa(t.display.wrapper,t.display.scrollbars.addClass)),t.display.scrollbars=new e.scrollbarModel[t.options.scrollbarStyle](function(e){t.display.wrapper.insertBefore(e,t.display.scrollbarFiller),Sa(e,"mousedown",function(){t.state.focused&&setTimeout(function(){t.display.input.focus()},0)}),e.setAttribute("cm-not-content","true")},function(e,n){"horizontal"==n?on(t,e):rn(t,e)},t),t.display.scrollbars.addClass&&_a(t.display.wrapper,t.display.scrollbars.addClass)}function y(e,t){t||(t=h(e));var n=e.display.barWidth,r=e.display.barHeight;b(e,t);for(var o=0;4>o&&n!=e.display.barWidth||r!=e.display.barHeight;o++)n!=e.display.barWidth&&e.options.lineWrapping&&O(e),b(e,h(e)),n=e.display.barWidth,r=e.display.barHeight}function b(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=""}function x(e,t,n){var r=n&&null!=n.top?Math.max(0,n.top):e.scroller.scrollTop;r=Math.floor(r-Xe(e));var o=n&&null!=n.bottom?n.bottom:r+e.wrapper.clientHeight,i=no(t,r),a=no(t,o);if(n&&n.ensure){var s=n.ensure.from.line,u=n.ensure.to.line;i>s?(i=s,a=no(t,ro(Qr(t,s))+e.wrapper.clientHeight)):Math.min(u,t.lastLine())>=a&&(i=no(t,ro(Qr(t,u))-e.wrapper.clientHeight),a=u)}return{from:i,to:Math.max(a,i+1)}}function A(e){var t=e.display,n=t.view;if(t.alignWidgets||t.gutters.firstChild&&e.options.fixedGutter){for(var r=P(t)-t.scroller.scrollLeft+e.doc.scrollLeft,o=t.gutters.offsetWidth,i=r+"px",a=0;a=n.viewFrom&&t.visible.to<=n.viewTo&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo)&&n.renderedView==n.view&&0==qt(e))return!1;w(e)&&(zt(e),t.dims=j(e));var o=r.first+r.size,i=Math.max(t.visible.from-e.options.viewportMargin,r.first),a=Math.min(o,t.visible.to+e.options.viewportMargin);n.viewFroma&&n.viewTo-a<20&&(a=Math.min(o,n.viewTo)),zi&&(i=xr(e.doc,i),a=Ar(e.doc,a));var s=i!=n.viewFrom||a!=n.viewTo||n.lastWrapHeight!=t.wrapperHeight||n.lastWrapWidth!=t.wrapperWidth;Ft(e,i,a),n.viewOffset=ro(Qr(e.doc,n.viewFrom)),e.display.mover.style.top=n.viewOffset+"px";var u=qt(e);if(!s&&0==u&&!t.force&&n.renderedView==n.view&&(null==n.updateLineNumbers||n.updateLineNumbers>=n.viewTo))return!1;var l=Zo();return u>4&&(n.lineDiv.style.display="none"),R(e,n.updateLineNumbers,t.dims),u>4&&(n.lineDiv.style.display=""),n.renderedView=n.view,l&&Zo()!=l&&l.offsetHeight&&l.focus(),Vo(n.cursorDiv),Vo(n.selectionDiv),n.gutters.style.height=n.sizer.style.minHeight=0,s&&(n.lastWrapHeight=t.wrapperHeight,n.lastWrapWidth=t.wrapperWidth,We(e,400)),n.updateLineNumbers=null,!0}function N(e,t){for(var n=t.viewport,r=!0;(r&&e.options.lineWrapping&&t.oldDisplayWidth!=Ge(e)||(n&&null!=n.top&&(n={top:Math.min(e.doc.height+Ve(e.display)-Je(e),n.top)}),t.visible=x(e.display,e.doc,n),!(t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)))&&E(e,t);r=!1){O(e);var o=h(e);Re(e),y(e,o),S(e,o)}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 M(e,t){var n=new C(e,t);if(E(e,n)){O(e),N(e,n);var r=h(e);Re(e),y(e,r),S(e,r),n.finish()}}function S(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+Ze(e)+"px"}function O(e){for(var t=e.display,n=t.lineDiv.offsetTop,r=0;rxi){var a=i.node.offsetTop+i.node.offsetHeight;o=a-n,n=a}else{var s=i.node.getBoundingClientRect();o=s.bottom-s.top}var u=i.line.height-o;if(2>o&&(o=yt(t)),(u>.001||-.001>u)&&(eo(i.line,o),L(i.line),i.rest))for(var l=0;l=t&&f.lineNumber;f.changes&&(Ro(f.changes,"gutter")>-1&&(d=!1),D(e,f,l,n)),d&&(Vo(f.lineNumber),f.lineNumber.appendChild(document.createTextNode(k(e.options,l)))),s=f.node.nextSibling}else{var p=X(e,f,l,n);a.insertBefore(p,s)}l+=f.size}for(;s;)s=r(s)}function D(e,t,n,r){for(var o=0;oxi&&(e.node.style.zIndex=2)),e.node}function z(e){var t=e.bgClass?e.bgClass+" "+(e.line.bgClass||""):e.line.bgClass;if(t&&(t+=" CodeMirror-linebackground"),e.background)t?e.background.className=t:(e.background.parentNode.removeChild(e.background),e.background=null);else if(t){var n=I(e);e.background=n.insertBefore(Xo("div",null,t),n.firstChild)}}function H(e,t){var n=e.display.externalMeasured;return n&&n.line==t.line?(e.display.externalMeasured=null,t.measure=n.measure,n.built):Hr(e,t)}function W(e,t){var n=t.text.className,r=H(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,F(t)):n&&(t.text.className=n)}function F(e){z(e),e.line.wrapClass?I(e).className=e.line.wrapClass:e.node!=e.text&&(e.node.className="");var t=e.textClass?e.textClass+" "+(e.line.textClass||""):e.line.textClass;e.text.className=t||""}function q(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 o=I(t);t.gutterBackground=Xo("div",null,"CodeMirror-gutter-background "+t.line.gutterClass,"left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px; width: "+r.gutterTotalWidth+"px"),o.insertBefore(t.gutterBackground,t.text)}var i=t.line.gutterMarkers;if(e.options.lineNumbers||i){var o=I(t),a=t.gutter=Xo("div",null,"CodeMirror-gutter-wrapper","left: "+(e.options.fixedGutter?r.fixedPos:-r.gutterTotalWidth)+"px");if(e.display.input.setUneditable(a),o.insertBefore(a,t.text),t.line.gutterClass&&(a.className+=" "+t.line.gutterClass),!e.options.lineNumbers||i&&i["CodeMirror-linenumbers"]||(t.lineNumber=a.appendChild(Xo("div",k(e.options,n),"CodeMirror-linenumber CodeMirror-gutter-elt","left: "+r.gutterLeft["CodeMirror-linenumbers"]+"px; width: "+e.display.lineNumInnerWidth+"px"))),i)for(var s=0;s1)if(Fi&&Fi.join("\n")==t){if(r.ranges.length%Fi.length==0){u=[];for(var l=0;l=0;l--){var c=r.ranges[l],f=c.from(),d=c.to();c.empty()&&(n&&n>0?f=Hi(f.line,f.ch-n):e.state.overwrite&&!a&&(d=Hi(d.line,Math.min(Qr(i,d.line).text.length,d.ch+jo(s).length))));var p=e.curOp.updateInput,h={from:f,to:d,text:u?u[l%u.length]:s,origin:o||(a?"paste":e.state.cutIncoming?"cut":"+input")};Tn(e.doc,h),Co(e,"inputRead",e,h)}t&&!a&&$(e,t),Hn(e),e.curOp.updateInput=p,e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=!1}function _(e,t){var n=e.clipboardData&&e.clipboardData.getData("text/plain");return n?(e.preventDefault(),t.isReadOnly()||t.options.disableInput||Mt(t,function(){Q(t,n,0,null,"paste")}),!0):void 0}function $(e,t){if(e.options.electricChars&&e.options.smartIndent)for(var n=e.doc.sel,r=n.ranges.length-1;r>=0;r--){var o=n.ranges[r];if(!(o.head.ch>100||r&&n.ranges[r-1].head.line==o.head.line)){var i=e.getModeAt(o.head),a=!1;if(i.electricChars){for(var s=0;s-1){a=Fn(e,o.head.line,"smart");break}}else i.electricInput&&i.electricInput.test(Qr(e.doc,o.head.line).text.slice(0,o.head.ch))&&(a=Fn(e,o.head.line,"smart"));a&&Co(e,"electricInput",e,o.head.line)}}}function ee(e){for(var t=[],n=[],r=0;ro?l.map:c[o],a=0;ao?e.line:e.rest[o]),f=i[a]+r;return(0>r||s!=t)&&(f=i[a+(r?1:0)]),Hi(u,f)}}}var o=e.text.firstChild,i=!1;if(!t||!Ja(o,t))return ae(Hi(to(e.line),0),!0);if(t==o&&(i=!0,t=o.childNodes[n],n=0,!t)){var a=e.rest?jo(e.rest):e.line;return ae(Hi(to(a),a.text.length),i)}var s=3==t.nodeType?t:null,u=t;for(s||1!=t.childNodes.length||3!=t.firstChild.nodeType||(s=t.firstChild,n&&(n=s.nodeValue.length));u.parentNode!=o;)u=u.parentNode;var l=e.measure,c=l.maps,f=r(s,u,n);if(f)return ae(f,i);for(var d=u.nextSibling,p=s?s.nodeValue.length-n:0;d;d=d.nextSibling){if(f=r(d,d.firstChild,0))return ae(Hi(f.line,f.ch-p),i);p+=d.textContent.length}for(var h=u.previousSibling,p=n;h;h=h.previousSibling){if(f=r(h,h.firstChild,-1))return ae(Hi(f.line,f.ch+p),i);p+=d.textContent.length}}function le(e,t,n,r,o){function i(e){return function(t){return t.id==e}}function a(t){if(1==t.nodeType){var n=t.getAttribute("cm-text");if(null!=n)return""==n&&(n=t.textContent.replace(/\u200b/g,"")),void(s+=n);var c,f=t.getAttribute("cm-marker");if(f){var d=e.findMarks(Hi(r,0),Hi(o+1,0),i(+f));return void(d.length&&(c=d[0].find())&&(s+=_r(e.doc,c.from,c.to).join(l)))}if("false"==t.getAttribute("contenteditable"))return;for(var p=0;p=0){var a=K(i.from(),o.from()),s=J(i.to(),o.to()),u=i.empty()?o.from()==o.head:i.from()==i.head;t>=r&&--t,e.splice(--r,2,new fe(u?s:a,u?a:s))}}return new ce(e,t)}function pe(e,t){return new ce([new fe(e,t||e)],0)}function he(e,t){return Math.max(e.first,Math.min(t,e.first+e.size-1))}function me(e,t){if(t.linen?Hi(n,Qr(e,n).text.length):ve(t,Qr(e,t.line).text.length)}function ve(e,t){var n=e.ch;return null==n||n>t?Hi(e.line,t):0>n?Hi(e.line,0):e}function ge(e,t){return t>=e.first&&t=t.ch:s.to>t.ch))){if(o&&(ja(u,"beforeCursorEnter"),u.explicitlyCleared)){if(i.markedSpans){--a;continue}break}if(!u.atomic)continue;if(n){var l,c=u.find(0>r?1:-1);if((0>r?u.inclusiveRight:u.inclusiveLeft)&&(c=je(e,c,-r,c&&c.line==t.line?i:null)),c&&c.line==t.line&&(l=Wi(c,n))&&(0>r?0>l:l>0))return Oe(e,c,t,r,o)}var f=u.find(0>r?-1:1);return(0>r?u.inclusiveLeft:u.inclusiveRight)&&(f=je(e,f,r,f.line==t.line?i:null)),f?Oe(e,f,t,r,o):null}}return t}function Le(e,t,n,r,o){var i=r||1,a=Oe(e,t,n,i,o)||!o&&Oe(e,t,n,i,!0)||Oe(e,t,n,-i,o)||!o&&Oe(e,t,n,-i,!0);return a?a:(e.cantEdit=!0,Hi(e.first,0))}function je(e,t,n,r){return 0>n&&0==t.ch?t.line>e.first?me(e,Hi(t.line-1)):null:n>0&&t.ch==(r||Qr(e,t.line)).text.length?t.line=e.display.viewTo||s.to().linet&&(t=0),t=Math.round(t),r=Math.round(r),s.appendChild(Xo("div",null,"CodeMirror-selected","position: absolute; left: "+e+"px; top: "+t+"px; width: "+(null==n?c-e:n)+"px; height: "+(r-t)+"px"))}function o(t,n,o){function i(n,r){return dt(e,Hi(t,n),"div",f,r)}var s,u,f=Qr(a,t),d=f.text.length;return ti(oo(f),n||0,null==o?d:o,function(e,t,a){var f,p,h,m=i(e,"left");if(e==t)f=m,p=h=m.left;else{if(f=i(t-1,"right"),"rtl"==a){var v=m;m=f,f=v}p=m.left,h=f.right}null==n&&0==e&&(p=l),f.top-m.top>3&&(r(p,m.top,null,m.bottom),p=l,m.bottomu.bottom||f.bottom==u.bottom&&f.right>u.right)&&(u=f),l+1>p&&(p=l),r(p,f.top,h-p,f.bottom)}),{start:s,end:u}}var i=e.display,a=e.doc,s=document.createDocumentFragment(),u=Be(e.display),l=u.left,c=Math.max(i.sizerWidth,Ge(e)-i.sizer.offsetLeft)-u.right,f=t.from(),d=t.to();if(f.line==d.line)o(f.line,f.ch,d.ch);else{var p=Qr(a,f.line),h=Qr(a,d.line),m=yr(p)==yr(h),v=o(f.line,f.ch,m?p.text.length+1:null).end,g=o(d.line,m?0:null,d.ch).start;m&&(v.top0?t.blinker=setInterval(function(){t.cursorDiv.style.visibility=(n=!n)?"":"hidden"},e.options.cursorBlinkRate):e.options.cursorBlinkRate<0&&(t.cursorDiv.style.visibility="hidden")}}function We(e,t){e.doc.mode.startState&&e.doc.frontier=e.display.viewTo)){var n=+new Date+e.options.workTime,r=ua(t.mode,Ue(e,t.frontier)),o=[];t.iter(t.frontier,Math.min(t.first+t.size,e.display.viewTo+500),function(i){if(t.frontier>=e.display.viewFrom){var a=i.styles,s=i.text.length>e.options.maxHighlightLength,u=Rr(e,i,s?ua(t.mode,r):r,!0);i.styles=u.styles;var l=i.styleClasses,c=u.classes;c?i.styleClasses=c:l&&(i.styleClasses=null);for(var f=!a||a.length!=i.styles.length||l!=c&&(!l||!c||l.bgClass!=c.bgClass||l.textClass!=c.textClass),d=0;!f&&dn?(We(e,e.options.workDelay),!0):void 0}),o.length&&Mt(e,function(){for(var t=0;ta;--s){if(s<=i.first)return i.first;var u=Qr(i,s-1);if(u.stateAfter&&(!n||s<=i.frontier))return s;var l=Fa(u.text,null,e.options.tabSize);(null==o||r>l)&&(o=s-1,r=l)}return o}function Ue(e,t,n){var r=e.doc,o=e.display;if(!r.mode.startState)return!0;var i=qe(e,t,n),a=i>r.first&&Qr(r,i-1).stateAfter;return a=a?ua(r.mode,a):la(r.mode),r.iter(i,t,function(n){Ir(e,n.text,a);var s=i==t-1||i%5==0||i>=o.viewFrom&&i2&&i.push((u.bottom+l.top)/2-n.top)}}i.push(n.bottom-n.top)}}function Ye(e,t,n){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var r=0;rn)return{map:e.measure.maps[r],cache:e.measure.caches[r],before:!0}}function Qe(e,t){t=yr(t);var n=to(t),r=e.display.externalMeasured=new jt(e.doc,t,n);r.lineN=n;var o=r.built=Hr(e,r);return r.text=o.pre,Bo(e.display.lineMeasure,o.pre),r}function _e(e,t,n,r){return tt(e,et(e,t),n,r)}function $e(e,t){if(t>=e.display.viewFrom&&t=n.lineN&&tt?(o=0,i=1,a="left"):l>t?(o=t-u,i=o+1):(s==e.length-3||t==l&&e[s+3]>t)&&(i=l-u,o=i-1,t>=l&&(a="right")),null!=o){if(r=e[s+2],u==l&&n==(r.insertLeft?"left":"right")&&(a=n),"left"==n&&0==o)for(;s&&e[s-2]==e[s-3]&&e[s-1].insertLeft;)r=e[(s-=3)+2],a="left";if("right"==n&&o==l-u)for(;sc;c++){for(;s&&Uo(t.line.text.charAt(i.coverStart+s));)--s;for(;i.coverStart+uxi&&0==s&&u==i.coverEnd-i.coverStart)o=a.parentNode.getBoundingClientRect();else if(bi&&e.options.lineWrapping){var f=Va(a,s,u).getClientRects();o=f.length?f["right"==r?f.length-1:0]:Vi}else o=Va(a,s,u).getBoundingClientRect()||Vi;if(o.left||o.right||0==s)break;u=s,s-=1,l="right"}bi&&11>xi&&(o=ot(e.display.measure,o))}else{s>0&&(l=r="right");var f;o=e.options.lineWrapping&&(f=a.getClientRects()).length>1?f["right"==r?f.length-1:0]:a.getBoundingClientRect()}if(bi&&9>xi&&!s&&(!o||!o.left&&!o.right)){var d=a.parentNode.getClientRects()[0];o=d?{left:d.left,right:d.left+bt(e.display),top:d.top,bottom:d.bottom}:Vi}for(var p=o.top-t.rect.top,h=o.bottom-t.rect.top,m=(p+h)/2,v=t.view.measure.heights,c=0;cn.from?a(e-1):a(e,r)}r=r||Qr(e.doc,t.line),o||(o=et(e,r));var u=oo(r),l=t.ch;if(!u)return a(l);var c=ci(u,l),f=s(l,c);return null!=as&&(f.other=s(l,as)),f}function ht(e,t){var n=0,t=me(e.doc,t);e.options.lineWrapping||(n=bt(e.display)*t.ch);var r=Qr(e.doc,t.line),o=ro(r)+Xe(e.display);return{left:n,right:n,top:o,bottom:o+r.height}}function mt(e,t,n,r){var o=Hi(e,t);return o.xRel=r,n&&(o.outside=!0),o}function vt(e,t,n){var r=e.doc;if(n+=e.display.viewOffset,0>n)return mt(r.first,0,!0,-1);var o=no(r,n),i=r.first+r.size-1;if(o>i)return mt(r.first+r.size-1,Qr(r,i).text.length,!0,1);0>t&&(t=0);for(var a=Qr(r,o);;){var s=gt(e,a,o,t,n),u=vr(a),l=u&&u.find(0,!0);if(!u||!(s.ch>l.from.ch||s.ch==l.from.ch&&s.xRel>0))return s;o=to(a=l.to.line)}}function gt(e,t,n,r,o){function i(r){var o=pt(e,Hi(n,r),"line",t,l);return s=!0,a>o.bottom?o.left-u:av)return mt(n,p,g,1);for(;;){if(c?p==d||p==di(t,d,1):1>=p-d){for(var y=h>r||v-r>=r-h?d:p,b=r-(y==d?h:v);Uo(t.text.charAt(y));)++y;var x=mt(n,y,y==d?m:g,-1>b?-1:b>1?1:0);return x}var A=Math.ceil(f/2),w=d+A;if(c){w=d;for(var k=0;A>k;++k)w=di(t,w,1)}var P=i(w);P>r?(p=w,v=P,(g=s)&&(v+=1e3),f=A):(d=w,h=P,m=s,f-=A)}}function yt(e){if(null!=e.cachedTextHeight)return e.cachedTextHeight;if(null==qi){qi=Xo("pre");for(var t=0;49>t;++t)qi.appendChild(document.createTextNode("x")),qi.appendChild(Xo("br"));qi.appendChild(document.createTextNode("x"))}Bo(e.measure,qi);var n=qi.offsetHeight/50;return n>3&&(e.cachedTextHeight=n),Vo(e.measure),n||1}function bt(e){if(null!=e.cachedCharWidth)return e.cachedCharWidth;var t=Xo("span","xxxxxxxxxx"),n=Xo("pre",[t]);Bo(e.measure,n);var r=t.getBoundingClientRect(),o=(r.right-r.left)/10;return o>2&&(e.cachedCharWidth=o),o||10}function xt(e){e.curOp={cm:e,viewChanged:!1,startHeight:e.doc.height,forceUpdate:!1,updateInput:null,typing:!1,changeObjs:null,cursorActivityHandlers:null,cursorActivityCalled:0,selectionChanged:!1,updateMaxLine:!1,scrollLeft:null,scrollTop:null,scrollToPos:null,focus:!1,id:++Zi},Bi?Bi.ops.push(e.curOp):e.curOp.ownsGroup=Bi={ops:[e.curOp],delayedCallbacks:[]}}function At(e){var t=e.delayedCallbacks,n=0;do{for(;n=n.viewTo)||n.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new C(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function Ct(e){e.updatedDisplay=e.mustUpdate&&E(e.cm,e.update)}function Tt(e){var t=e.cm,n=t.display;e.updatedDisplay&&O(t),e.barMeasure=h(t),n.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=_e(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+Ze(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,n.sizer.offsetLeft+e.adjustWidthTo-Ge(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=n.input.prepareSelection())}function Et(e){var t=e.cm;null!=e.adjustWidthTo&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLefti;i=r){var a=new jt(e.doc,Qr(e.doc,i),i);r=i+a.size,o.push(a)}return o}function Dt(e,t,n,r){null==t&&(t=e.doc.first),null==n&&(n=e.doc.first+e.doc.size),r||(r=0);var o=e.display;if(r&&nt)&&(o.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=o.viewTo)zi&&xr(e.doc,t)o.viewFrom?zt(e):(o.viewFrom+=r,o.viewTo+=r);else if(t<=o.viewFrom&&n>=o.viewTo)zt(e);else if(t<=o.viewFrom){var i=Wt(e,n,n+r,1);i?(o.view=o.view.slice(i.index),o.viewFrom=i.lineN,o.viewTo+=r):zt(e)}else if(n>=o.viewTo){var i=Wt(e,t,t,-1);i?(o.view=o.view.slice(0,i.index),o.viewTo=i.lineN):zt(e)}else{var a=Wt(e,t,t,-1),s=Wt(e,n,n+r,1);a&&s?(o.view=o.view.slice(0,a.index).concat(Rt(e,a.lineN,s.lineN)).concat(o.view.slice(s.index)),o.viewTo+=r):zt(e)}var u=o.externalMeasured;u&&(n=o.lineN&&t=r.viewTo)){var i=r.view[Ht(e,t)];if(null!=i.node){var a=i.changes||(i.changes=[]);-1==Ro(a,n)&&a.push(n)}}}function zt(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Ht(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,0>t)return null;for(var n=e.display.view,r=0;rt)return r}function Wt(e,t,n,r){var o,i=Ht(e,t),a=e.display.view;if(!zi||n==e.doc.first+e.doc.size)return{index:i,lineN:n};for(var s=0,u=e.display.viewFrom;i>s;s++)u+=a[s].size;if(u!=t){if(r>0){if(i==a.length-1)return null;o=u+a[i].size-t,i++}else o=u-t;t+=o,n+=o}for(;xr(e.doc,n)!=n;){if(i==(0>r?0:a.length-1))return null;n+=r*a[i-(0>r?1:0)].size,i+=r}return{index:i,lineN:n}}function Ft(e,t,n){var r=e.display,o=r.view;0==o.length||t>=r.viewTo||n<=r.viewFrom?(r.view=Rt(e,t,n),r.viewFrom=t):(r.viewFrom>t?r.view=Rt(e,t,r.viewFrom).concat(r.view):r.viewFromn&&(r.view=r.view.slice(0,Ht(e,n)))),r.viewTo=n}function qt(e){for(var t=e.display.view,n=0,r=0;r400}var o=e.display;Sa(o.scroller,"mousedown",St(e,Gt)),bi&&11>xi?Sa(o.scroller,"dblclick",St(e,function(t){if(!Eo(e,t)){var n=Zt(e,t);if(n&&!_t(e,t)&&!Bt(e.display,t)){Ea(t);var r=e.findWordAt(n);xe(e.doc,r.anchor,r.head)}}})):Sa(o.scroller,"dblclick",function(t){Eo(e,t)||Ea(t)}),Di||Sa(o.scroller,"contextmenu",function(t){bn(e,t)});var i,a={end:0};Sa(o.scroller,"touchstart",function(t){if(!Eo(e,t)&&!n(t)){clearTimeout(i);var r=+new Date;o.activeTouch={start:r,moved:!1,prev:r-a.end<=300?a:null},1==t.touches.length&&(o.activeTouch.left=t.touches[0].pageX,o.activeTouch.top=t.touches[0].pageY)}}),Sa(o.scroller,"touchmove",function(){o.activeTouch&&(o.activeTouch.moved=!0)}),Sa(o.scroller,"touchend",function(n){var i=o.activeTouch;if(i&&!Bt(o,n)&&null!=i.left&&!i.moved&&new Date-i.start<300){var a,s=e.coordsChar(o.activeTouch,"page");a=!i.prev||r(i,i.prev)?new fe(s,s):!i.prev.prev||r(i,i.prev.prev)?e.findWordAt(s):new fe(Hi(s.line,0),me(e.doc,Hi(s.line+1,0))),e.setSelection(a.anchor,a.head),e.focus(),Ea(n)}t()}),Sa(o.scroller,"touchcancel",t),Sa(o.scroller,"scroll",function(){o.scroller.clientHeight&&(rn(e,o.scroller.scrollTop),on(e,o.scroller.scrollLeft,!0),ja(e,"scroll",e))}),Sa(o.scroller,"mousewheel",function(t){an(e,t)}),Sa(o.scroller,"DOMMouseScroll",function(t){an(e,t)}),Sa(o.wrapper,"scroll",function(){o.wrapper.scrollTop=o.wrapper.scrollLeft=0}),o.dragFunctions={enter:function(t){Eo(e,t)||Ma(t)},over:function(t){Eo(e,t)||(tn(e,t),Ma(t))},start:function(t){en(e,t)},drop:St(e,$t),leave:function(t){Eo(e,t)||nn(e)}};var s=o.input.getField();Sa(s,"keyup",function(t){hn.call(e,t)}),Sa(s,"keydown",St(e,dn)),Sa(s,"keypress",St(e,mn)),Sa(s,"focus",Wo(gn,e)),Sa(s,"blur",Wo(yn,e))}function Xt(t,n,r){var o=r&&r!=e.Init;if(!n!=!o){var i=t.display.dragFunctions,a=n?Sa:La;a(t.display.scroller,"dragstart",i.start),a(t.display.scroller,"dragenter",i.enter),a(t.display.scroller,"dragover",i.over),a(t.display.scroller,"dragleave",i.leave),a(t.display.scroller,"drop",i.drop)}}function Vt(e){var t=e.display;t.lastWrapHeight==t.wrapper.clientHeight&&t.lastWrapWidth==t.wrapper.clientWidth||(t.cachedCharWidth=t.cachedTextHeight=t.cachedPaddingH=null,t.scrollbarsClipped=!1,e.setSize())}function Bt(e,t){for(var n=wo(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 Zt(e,t,n,r){var o=e.display; +if(!n&&"true"==wo(t).getAttribute("cm-not-content"))return null;var i,a,s=o.lineSpace.getBoundingClientRect();try{i=t.clientX-s.left,a=t.clientY-s.top}catch(t){return null}var u,l=vt(e,i,a);if(r&&1==l.xRel&&(u=Qr(e.doc,l.line).text).length==l.ch){var c=Fa(u,u.length,e.options.tabSize)-u.length;l=Hi(l.line,Math.max(0,Math.round((i-Be(e.display).left)/bt(e.display))-c))}return l}function Gt(e){var t=this,n=t.display;if(!(Eo(t,e)||n.activeTouch&&n.input.supportsTouch())){if(n.shift=e.shiftKey,Bt(n,e))return void(Ai||(n.scroller.draggable=!1,setTimeout(function(){n.scroller.draggable=!0},100)));if(!_t(t,e)){var r=Zt(t,e);switch(window.focus(),ko(e)){case 1:t.state.selectingText?t.state.selectingText(e):r?Jt(t,e,r):wo(e)==n.scroller&&Ea(e);break;case 2:Ai&&(t.state.lastMiddleDown=+new Date),r&&xe(t.doc,r),setTimeout(function(){n.input.focus()},20),Ea(e);break;case 3:Di?bn(t,e):vn(t)}}}}function Jt(e,t,n){bi?setTimeout(Wo(Y,e),0):e.curOp.focus=Zo();var r,o=+new Date;Xi&&Xi.time>o-400&&0==Wi(Xi.pos,n)?r="triple":Ui&&Ui.time>o-400&&0==Wi(Ui.pos,n)?(r="double",Xi={time:o,pos:n}):(r="single",Ui={time:o,pos:n});var i,a=e.doc.sel,s=Si?t.metaKey:t.ctrlKey;e.options.dragDrop&&es&&!e.isReadOnly()&&"single"==r&&(i=a.contains(n))>-1&&(Wi((i=a.ranges[i]).from(),n)<0||n.xRel>0)&&(Wi(i.to(),n)>0||n.xRel<0)?Kt(e,t,n,s):Yt(e,t,n,r,s)}function Kt(e,t,n,r){var o=e.display,i=+new Date,a=St(e,function(s){Ai&&(o.scroller.draggable=!1),e.state.draggingText=!1,La(document,"mouseup",a),La(o.scroller,"drop",a),Math.abs(t.clientX-s.clientX)+Math.abs(t.clientY-s.clientY)<10&&(Ea(s),!r&&+new Date-200=h;h++){var g=Qr(l,h).text,y=qa(g,u,i);u==p?o.push(new fe(Hi(h,y),Hi(h,y))):g.length>y&&o.push(new fe(Hi(h,y),Hi(h,qa(g,p,i))))}o.length||o.push(new fe(n,n)),Te(l,de(d.ranges.slice(0,f).concat(o),f),{origin:"*mouse",scroll:!1}),e.scrollIntoView(t)}else{var b=c,x=b.anchor,A=t;if("single"!=r){if("double"==r)var w=e.findWordAt(t);else var w=new fe(Hi(t.line,0),me(l,Hi(t.line+1,0)));Wi(w.anchor,x)>0?(A=w.head,x=K(b.from(),w.anchor)):(A=w.anchor,x=J(b.to(),w.head))}var o=d.ranges.slice(0);o[f]=new fe(me(l,x),A),Te(l,de(o,f),Ha)}}function a(t){var n=++y,o=Zt(e,t,!0,"rect"==r);if(o)if(0!=Wi(o,v)){e.curOp.focus=Zo(),i(o);var s=x(u,l);(o.line>=s.to||o.lineg.bottom?20:0;c&&setTimeout(St(e,function(){y==n&&(u.scroller.scrollTop+=c,a(t))}),50)}}function s(t){e.state.selectingText=!1,y=1/0,Ea(t),u.input.focus(),La(document,"mousemove",b),La(document,"mouseup",A),l.history.lastSelOrigin=null}var u=e.display,l=e.doc;Ea(t);var c,f,d=l.sel,p=d.ranges;if(o&&!t.shiftKey?(f=l.sel.contains(n),c=f>-1?p[f]:new fe(n,n)):(c=l.sel.primary(),f=l.sel.primIndex),Oi?t.shiftKey&&t.metaKey:t.altKey)r="rect",o||(c=new fe(n,n)),n=Zt(e,t,!0,!0),f=-1;else if("double"==r){var h=e.findWordAt(n);c=e.display.shift||l.extend?be(l,c,h.anchor,h.head):h}else if("triple"==r){var m=new fe(Hi(n.line,0),me(l,Hi(n.line+1,0)));c=e.display.shift||l.extend?be(l,c,m.anchor,m.head):m}else c=be(l,c,n);o?-1==f?(f=p.length,Te(l,de(p.concat([c]),f),{scroll:!1,origin:"*mouse"})):p.length>1&&p[f].empty()&&"single"==r&&!t.shiftKey?(Te(l,de(p.slice(0,f).concat(p.slice(f+1)),0),{scroll:!1,origin:"*mouse"}),d=l.sel):we(l,f,c,Ha):(f=0,Te(l,new ce([c],0),Ha),d=l.sel);var v=n,g=u.wrapper.getBoundingClientRect(),y=0,b=St(e,function(e){ko(e)?a(e):s(e)}),A=St(e,s);e.state.selectingText=A,Sa(document,"mousemove",b),Sa(document,"mouseup",A)}function Qt(e,t,n,r){try{var o=t.clientX,i=t.clientY}catch(t){return!1}if(o>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;r&&Ea(t);var a=e.display,s=a.lineDiv.getBoundingClientRect();if(i>s.bottom||!Mo(e,n))return Ao(t);i-=s.top-a.viewOffset;for(var u=0;u=o){var c=no(e.doc,i),f=e.options.gutters[u];return ja(e,n,e,c,f,t),Ao(t)}}}function _t(e,t){return Qt(e,t,"gutterClick",!0)}function $t(e){var t=this;if(nn(t),!Eo(t,e)&&!Bt(t.display,e)){Ea(e),bi&&(Gi=+new Date);var n=Zt(t,e,!0),r=e.dataTransfer.files;if(n&&!t.isReadOnly())if(r&&r.length&&window.FileReader&&window.File)for(var o=r.length,i=Array(o),a=0,s=function(e,r){if(!t.options.allowDropFileTypes||-1!=Ro(t.options.allowDropFileTypes,e.type)){var s=new FileReader;s.onload=St(t,function(){var e=s.result;if(/[\x00-\x08\x0e-\x1f]{2}/.test(e)&&(e=""),i[r]=e,++a==o){n=me(t.doc,n);var u={from:n,to:n,text:t.doc.splitLines(i.join(t.doc.lineSeparator())),origin:"paste"};Tn(t.doc,u),Ce(t.doc,pe(n,$i(u)))}}),s.readAsText(e)}},u=0;o>u;++u)s(r[u],u);else{if(t.state.draggingText&&t.doc.sel.contains(n)>-1)return t.state.draggingText(e),void setTimeout(function(){t.display.input.focus()},20);try{var i=e.dataTransfer.getData("Text");if(i){if(t.state.draggingText&&!(Si?e.altKey:e.ctrlKey))var l=t.listSelections();if(Ee(t.doc,pe(n,n)),l)for(var u=0;ua.clientWidth,u=a.scrollHeight>a.clientHeight;if(r&&s||o&&u){if(o&&Si&&Ai)e:for(var l=t.target,c=i.view;l!=a;l=l.parentNode)for(var f=0;fd?p=Math.max(0,p+d-50):h=Math.min(e.doc.height,h+d+50),M(e,{top:p,bottom:h})}20>Ji&&(null==i.wheelStartX?(i.wheelStartX=a.scrollLeft,i.wheelStartY=a.scrollTop,i.wheelDX=r,i.wheelDY=o,setTimeout(function(){if(null!=i.wheelStartX){var e=a.scrollLeft-i.wheelStartX,t=a.scrollTop-i.wheelStartY,n=t&&i.wheelDY&&t/i.wheelDY||e&&i.wheelDX&&e/i.wheelDX;i.wheelStartX=i.wheelStartY=null,n&&(Ki=(Ki*Ji+n)/(Ji+1),++Ji)}},200)):(i.wheelDX+=r,i.wheelDY+=o))}}function sn(e,t,n){if("string"==typeof t&&(t=ca[t],!t))return!1;e.display.input.ensurePolled();var r=e.display.shift,o=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),n&&(e.display.shift=!1),o=t(e)!=Ia}finally{e.display.shift=r,e.state.suppressEdits=!1}return o}function un(e,t,n){for(var r=0;rxi&&27==e.keyCode&&(e.returnValue=!1);var n=e.keyCode;t.display.shift=16==n||e.shiftKey;var r=cn(t,e);Pi&&(_i=r?n:null,!r&&88==n&&!rs&&(Si?e.metaKey:e.ctrlKey)&&t.replaceSelection("",null,"cut")),18!=n||/\bCodeMirror-crosshair\b/.test(t.display.lineDiv.className)||pn(t)}}function pn(e){function t(e){18!=e.keyCode&&e.altKey||(Qa(n,"CodeMirror-crosshair"),La(document,"keyup",t),La(document,"mouseover",t))}var n=e.display.lineDiv;_a(n,"CodeMirror-crosshair"),Sa(document,"keyup",t),Sa(document,"mouseover",t)}function hn(e){16==e.keyCode&&(this.doc.sel.shift=!1),Eo(this,e)}function mn(e){var t=this;if(!(Bt(t.display,e)||Eo(t,e)||e.ctrlKey&&!e.altKey||Si&&e.metaKey)){var n=e.keyCode,r=e.charCode;if(Pi&&n==_i)return _i=null,void Ea(e);if(!Pi||e.which&&!(e.which<10)||!cn(t,e)){var o=String.fromCharCode(null==r?n:r);fn(t,e,o)||t.display.input.onKeyPress(e)}}}function vn(e){e.state.delayingBlurEvent=!0,setTimeout(function(){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1,yn(e))},100)}function gn(e){e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),"nocursor"!=e.options.readOnly&&(e.state.focused||(ja(e,"focus",e),e.state.focused=!0,_a(e.display.wrapper,"CodeMirror-focused"),e.curOp||e.display.selForContextMenu==e.doc.sel||(e.display.input.reset(),Ai&&setTimeout(function(){e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),He(e))}function yn(e){e.state.delayingBlurEvent||(e.state.focused&&(ja(e,"blur",e),e.state.focused=!1,Qa(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150))}function bn(e,t){Bt(e.display,t)||xn(e,t)||Eo(e,t,"contextmenu")||e.display.input.onContextMenu(t)}function xn(e,t){return Mo(e,"gutterContextMenu")?Qt(e,t,"gutterContextMenu",!1):!1}function An(e,t){if(Wi(e,t.from)<0)return e;if(Wi(e,t.to)<=0)return $i(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+=$i(t).ch-t.to.ch),Hi(n,r)}function wn(e,t){for(var n=[],r=0;r=0;--o)En(e,{from:r[o].from,to:r[o].to,text:o?[""]:t.text});else En(e,t)}}function En(e,t){if(1!=t.text.length||""!=t.text[0]||0!=Wi(t.from,t.to)){var n=wn(e,t);lo(e,t,n,e.cm?e.cm.curOp.id:NaN),Sn(e,t,n,ir(e,t));var r=[];Kr(e,function(e,n){n||-1!=Ro(r,e.history)||(xo(e.history,t),r.push(e.history)),Sn(e,t,null,ir(e,t))})}}function Nn(e,t,n){if(!e.cm||!e.cm.state.suppressEdits){for(var r,o=e.history,i=e.sel,a="undo"==t?o.done:o.undone,s="undo"==t?o.undone:o.done,u=0;u=0;--u){var f=r.changes[u];if(f.origin=t,c&&!Cn(e,f,!1))return void(a.length=0);l.push(ao(e,f));var d=u?wn(e,f):jo(a);Sn(e,f,d,sr(e,f)),!u&&e.cm&&e.cm.scrollIntoView({from:f.from,to:$i(f)});var p=[];Kr(e,function(e,t){t||-1!=Ro(p,e.history)||(xo(e.history,f),p.push(e.history)),Sn(e,f,null,sr(e,f))})}}}}function Mn(e,t){if(0!=t&&(e.first+=t,e.sel=new ce(Do(e.sel.ranges,function(e){return new fe(Hi(e.anchor.line+t,e.anchor.ch),Hi(e.head.line+t,e.head.ch))}),e.sel.primIndex),e.cm)){Dt(e.cm,e.first,e.first-t,t);for(var n=e.cm.display,r=n.viewFrom;re.lastLine())){if(t.from.linei&&(t={from:t.from,to:Hi(i,Qr(e,i).text.length),text:[t.text[0]],origin:t.origin}),t.removed=_r(e,t.from,t.to),n||(n=wn(e,t)),e.cm?On(e.cm,t,r):Zr(e,t,r),Ee(e,n,za)}}function On(e,t,n){var r=e.doc,o=e.display,a=t.from,s=t.to,u=!1,l=a.line;e.options.lineWrapping||(l=to(yr(Qr(r,a.line))),r.iter(l,s.line+1,function(e){return e==o.maxLine?(u=!0,!0):void 0})),r.sel.contains(t.from,t.to)>-1&&No(e),Zr(r,t,n,i(e)),e.options.lineWrapping||(r.iter(l,a.line+t.text.length,function(e){var t=f(e);t>o.maxLineLength&&(o.maxLine=e,o.maxLineLength=t,o.maxLineChanged=!0,u=!1)}),u&&(e.curOp.updateMaxLine=!0)),r.frontier=Math.min(r.frontier,a.line),We(e,400);var c=t.text.length-(s.line-a.line)-1;t.full?Dt(e):a.line!=s.line||1!=t.text.length||Br(e.doc,t)?Dt(e,a.line,s.line+1,c):It(e,a.line,"text");var d=Mo(e,"changes"),p=Mo(e,"change");if(p||d){var h={from:a,to:s,text:t.text,removed:t.removed,origin:t.origin};p&&Co(e,"change",e,h),d&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(h)}e.display.selForContextMenu=null}function Ln(e,t,n,r,o){if(r||(r=n),Wi(r,n)<0){var i=r;r=n,n=i}"string"==typeof t&&(t=e.splitLines(t)),Tn(e,{from:n,to:r,text:t,origin:o})}function jn(e,t){if(!Eo(e,"scrollCursorIntoView")){var n=e.display,r=n.sizer.getBoundingClientRect(),o=null;if(t.top+r.top<0?o=!0:t.bottom+r.top>(window.innerHeight||document.documentElement.clientHeight)&&(o=!1),null!=o&&!Ei){var i=Xo("div","​",null,"position: absolute; top: "+(t.top-n.viewOffset-Xe(e.display))+"px; height: "+(t.bottom-t.top+Ze(e)+n.barHeight)+"px; left: "+t.left+"px; width: 2px;");e.display.lineSpace.appendChild(i),i.scrollIntoView(o),e.display.lineSpace.removeChild(i)}}}function Rn(e,t,n,r){null==r&&(r=0);for(var o=0;5>o;o++){var i=!1,a=pt(e,t),s=n&&n!=t?pt(e,n):a,u=In(e,Math.min(a.left,s.left),Math.min(a.top,s.top)-r,Math.max(a.left,s.left),Math.max(a.bottom,s.bottom)+r),l=e.doc.scrollTop,c=e.doc.scrollLeft;if(null!=u.scrollTop&&(rn(e,u.scrollTop),Math.abs(e.doc.scrollTop-l)>1&&(i=!0)),null!=u.scrollLeft&&(on(e,u.scrollLeft),Math.abs(e.doc.scrollLeft-c)>1&&(i=!0)),!i)break}return a}function Dn(e,t,n,r,o){var i=In(e,t,n,r,o);null!=i.scrollTop&&rn(e,i.scrollTop),null!=i.scrollLeft&&on(e,i.scrollLeft)}function In(e,t,n,r,o){var i=e.display,a=yt(e.display);0>n&&(n=0);var s=e.curOp&&null!=e.curOp.scrollTop?e.curOp.scrollTop:i.scroller.scrollTop,u=Je(e),l={};o-n>u&&(o=n+u);var c=e.doc.height+Ve(i),f=a>n,d=o>c-a;if(s>n)l.scrollTop=f?0:n;else if(o>s+u){var p=Math.min(n,(d?c:o)-u);p!=s&&(l.scrollTop=p)}var h=e.curOp&&null!=e.curOp.scrollLeft?e.curOp.scrollLeft:i.scroller.scrollLeft,m=Ge(e)-(e.options.fixedGutter?i.gutters.offsetWidth:0),v=r-t>m;return v&&(r=t+m),10>t?l.scrollLeft=0:h>t?l.scrollLeft=Math.max(0,t-(v?0:10)):r>m+h-3&&(l.scrollLeft=r+(v?0:10)-m),l}function zn(e,t,n){null==t&&null==n||Wn(e),null!=t&&(e.curOp.scrollLeft=(null==e.curOp.scrollLeft?e.doc.scrollLeft:e.curOp.scrollLeft)+t),null!=n&&(e.curOp.scrollTop=(null==e.curOp.scrollTop?e.doc.scrollTop:e.curOp.scrollTop)+n)}function Hn(e){Wn(e);var t=e.getCursor(),n=t,r=t;e.options.lineWrapping||(n=t.ch?Hi(t.line,t.ch-1):t,r=Hi(t.line,t.ch+1)),e.curOp.scrollToPos={from:n,to:r,margin:e.options.cursorScrollMargin,isCursor:!0}}function Wn(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var n=ht(e,t.from),r=ht(e,t.to),o=In(e,Math.min(n.left,r.left),Math.min(n.top,r.top)-t.margin,Math.max(n.right,r.right),Math.max(n.bottom,r.bottom)+t.margin);e.scrollTo(o.scrollLeft,o.scrollTop)}}function Fn(e,t,n,r){var o,i=e.doc;null==n&&(n="add"),"smart"==n&&(i.mode.indent?o=Ue(e,t):n="prev");var a=e.options.tabSize,s=Qr(i,t),u=Fa(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=i.mode.indent(o,s.text.slice(c.length),s.text),l==Ia||l>150)){if(!r)return;n="prev"}}else l=0,n="not";"prev"==n?l=t>i.first?Fa(Qr(i,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 f="",d=0;if(e.options.indentWithTabs)for(var p=Math.floor(l/a);p;--p)d+=a,f+=" ";if(l>d&&(f+=Lo(l-d)),f!=c)return Ln(i,f,Hi(t,0),Hi(t,c.length),"+input"),s.stateAfter=null,!0;for(var p=0;p=0;t--)Ln(e.doc,"",r[t].from,r[t].to,"+delete");Hn(e)})}function Xn(e,t,n,r,o){function i(){var t=s+n;return t=e.first+e.size?!1:(s=t,c=Qr(e,t))}function a(e){var t=(o?di:pi)(c,u,n,!0);if(null==t){if(e||!i())return!1;u=o?(0>n?ii:oi)(c):0>n?c.text.length:0}else u=t;return!0}var s=t.line,u=t.ch,l=n,c=Qr(e,s);if("char"==r)a();else if("column"==r)a(!0);else if("word"==r||"group"==r)for(var f=null,d="group"==r,p=e.cm&&e.cm.getHelper(t,"wordChars"),h=!0;!(0>n)||a(!h);h=!1){var m=c.text.charAt(u)||"\n",v=Fo(m,p)?"w":d&&"\n"==m?"n":!d||/\s/.test(m)?null:"p";if(!d||h||v||(v="s"),f&&f!=v){0>n&&(n=1,a());break}if(v&&(f=v),n>0&&!a(!h))break}var g=Le(e,Hi(s,u),t,l,!0);return Wi(t,g)||(g.hitSide=!0),g}function Vn(e,t,n,r){var o,i=e.doc,a=t.left;if("page"==r){var s=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight);o=t.top+n*(s-(0>n?1.5:.5)*yt(e.display))}else"line"==r&&(o=n>0?t.bottom+3:t.top-3);for(;;){var u=vt(e,a,o);if(!u.outside)break;if(0>n?0>=o:o>=i.height){u.hitSide=!0;break}o+=5*n}return u}function Bn(t,n,r,o){e.defaults[t]=n,r&&(ta[t]=o?function(e,t,n){n!=na&&r(e,t,n)}:r)}function Zn(e){for(var t,n,r,o,i=e.split(/-(?!$)/),e=i[i.length-1],a=0;a0||0==a&&i.clearWhenEmpty!==!1)return i;if(i.replacedWith&&(i.collapsed=!0,i.widgetNode=Xo("span",[i.replacedWith],"CodeMirror-widget"),r.handleMouseEvents||i.widgetNode.setAttribute("cm-ignore-events","true"),r.insertLeft&&(i.widgetNode.insertLeft=!0)),i.collapsed){if(gr(e,t.line,t,n,i)||t.line!=n.line&&gr(e,n.line,t,n,i))throw new Error("Inserting collapsed marker partially overlapping an existing one");zi=!0}i.addToHistory&&lo(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&&i.collapsed&&!l.options.lineWrapping&&yr(e)==l.display.maxLine&&(s=!0),i.collapsed&&u!=t.line&&eo(e,0),nr(e,new $n(i,u==t.line?t.ch:null,u==n.line?n.ch:null)),++u}),i.collapsed&&e.iter(t.line,n.line+1,function(t){wr(e,t)&&eo(t,0)}),i.clearOnEnter&&Sa(i,"beforeCursorEnter",function(){i.clear()}),i.readOnly&&(Ii=!0,(e.history.done.length||e.history.undone.length)&&e.clearHistory()),i.collapsed&&(i.id=++va,i.atomic=!0),l){if(s&&(l.curOp.updateMaxLine=!0),i.collapsed)Dt(l,t.line,n.line+1);else if(i.className||i.title||i.startStyle||i.endStyle||i.css)for(var c=t.line;c<=n.line;c++)It(l,c,"text");i.atomic&&Me(l.doc),Co(l,"markerAdded",l,i)}return i}function Kn(e,t,n,r,o){r=Ho(r),r.shared=!1;var i=[Jn(e,t,n,r,o)],a=i[0],s=r.widgetNode;return Kr(e,function(e){s&&(r.widgetNode=s.cloneNode(!0)),i.push(Jn(e,me(e,t),me(e,n),r,o));for(var u=0;u=t:i.to>t);(r||(r=[])).push(new $n(a,i.from,u?null:i.to))}}return r}function or(e,t,n){if(e)for(var r,o=0;o=t:i.to>t);if(s||i.from==t&&"bookmark"==a.type&&(!n||i.marker.insertLeft)){var u=null==i.from||(a.inclusiveLeft?i.from<=t:i.from0&&s)for(var f=0;ff;++f)h.push(m);h.push(u)}return h}function ar(e){for(var t=0;t0)){var c=[u,1],f=Wi(l.from,s.from),d=Wi(l.to,s.to);(0>f||!a.inclusiveLeft&&!f)&&c.push({from:l.from,to:s.from}),(d>0||!a.inclusiveRight&&!d)&&c.push({from:s.to,to:l.to}),o.splice.apply(o,c),u+=c.length-1}}return o}function lr(e){var t=e.markedSpans;if(t){for(var n=0;n=0&&0>=f||0>=c&&f>=0)&&(0>=c&&(Wi(l.to,n)>0||u.marker.inclusiveRight&&o.inclusiveLeft)||c>=0&&(Wi(l.from,r)<0||u.marker.inclusiveLeft&&o.inclusiveRight)))return!0}}}function yr(e){for(var t;t=mr(e);)e=t.find(-1,!0).line;return e}function br(e){for(var t,n;t=vr(e);)e=t.find(1,!0).line,(n||(n=[])).push(e);return n}function xr(e,t){var n=Qr(e,t),r=yr(n);return n==r?t:to(r)}function Ar(e,t){if(t>e.lastLine())return t;var n,r=Qr(e,t);if(!wr(e,r))return t;for(;n=vr(r);)r=n.find(1,!0).line;return to(r)+1}function wr(e,t){var n=zi&&t.markedSpans;if(n)for(var r,o=0;oi;i++){o&&(o[0]=e.innerMode(t,r).mode);var a=t.token(n,r);if(n.pos>n.start)return a}throw new Error("Mode "+t.name+" failed to advance stream.")}function Lr(e,t,n,r){function o(e){return{start:f.start,end:f.pos,string:f.current(),type:i||null,state:e?ua(a.mode,c):c}}var i,a=e.doc,s=a.mode;t=me(a,t);var u,l=Qr(a,t.line),c=Ue(e,t.line,n),f=new ma(l.text,e.options.tabSize);for(r&&(u=[]);(r||f.pose.options.maxHighlightLength?(s=!1,a&&Ir(e,t,r,f.pos),f.pos=t.length,u=null):u=Mr(Or(n,f,r,d),i),d){var p=d[0].name;p&&(u="m-"+(u?p+" "+u:p))}if(!s||c!=u){for(;ll;){var r=o[u];r>e&&o.splice(u,1,e,o[u+1],r),u+=2,l=Math.min(e,r)}if(t)if(s.opaque)o.splice(n,u-n,e,"cm-overlay "+t),u=n+2;else for(;u>n;n+=2){var i=o[n+1];o[n+1]=(i?i+" ":"")+"cm-overlay "+t}},i)}return{styles:o,classes:i.bgClass||i.textClass?i:null}}function Dr(e,t,n){if(!t.styles||t.styles[0]!=e.state.modeGen){var r=Ue(e,to(t)),o=Rr(e,t,t.text.length>e.options.maxHighlightLength?ua(e.doc.mode,r):r);t.stateAfter=r,t.styles=o.styles,o.classes?t.styleClasses=o.classes:t.styleClasses&&(t.styleClasses=null),n===e.doc.frontier&&e.doc.frontier++}return t.styles}function Ir(e,t,n,r){var o=e.doc.mode,i=new ma(t,e.options.tabSize);for(i.start=i.pos=r||0,""==t&&Sr(o,n);!i.eol();)Or(o,i,n),i.start=i.pos}function zr(e,t){if(!e||/^\s*$/.test(e))return null;var n=t.addModeClass?wa:Aa;return n[e]||(n[e]=e.replace(/\S+/g,"cm-$&"))}function Hr(e,t){var n=Xo("span",null,null,Ai?"padding-right: .1px":null),r={pre:Xo("pre",[n],"CodeMirror-line"),content:n,col:0,pos:0,cm:e,splitSpaces:(bi||Ai)&&e.getOption("lineWrapping")};t.measure={};for(var o=0;o<=(t.rest?t.rest.length:0);o++){var i,a=o?t.rest[o-1]:t.line;r.pos=0,r.addToken=Fr,$o(e.display.measure)&&(i=oo(a))&&(r.addToken=Ur(r.addToken,i)),r.map=[];var s=t!=e.display.externalMeasured&&to(a);Vr(a,r,Dr(e,a,s)),a.styleClasses&&(a.styleClasses.bgClass&&(r.bgClass=Jo(a.styleClasses.bgClass,r.bgClass||"")),a.styleClasses.textClass&&(r.textClass=Jo(a.styleClasses.textClass,r.textClass||""))),0==r.map.length&&r.map.push(0,0,r.content.appendChild(_o(e.display.measure))),0==o?(t.measure.map=r.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(r.map),(t.measure.caches||(t.measure.caches=[])).push({}))}return Ai&&/\bcm-tab\b/.test(r.content.lastChild.className)&&(r.content.className="cm-tab-wrap-hack"),ja(e,"renderLine",e,t.line,r.pre),r.pre.className&&(r.textClass=Jo(r.pre.className,r.textClass||"")),r}function Wr(e){var t=Xo("span","•","cm-invalidchar");return t.title="\\u"+e.charCodeAt(0).toString(16), +t.setAttribute("aria-label",t.title),t}function Fr(e,t,n,r,o,i,a){if(t){var s=e.splitSpaces?t.replace(/ {3,}/g,qr):t,u=e.cm.state.specialChars,l=!1;if(u.test(t))for(var c=document.createDocumentFragment(),f=0;;){u.lastIndex=f;var d=u.exec(t),p=d?d.index-f:t.length-f;if(p){var h=document.createTextNode(s.slice(f,f+p));bi&&9>xi?c.appendChild(Xo("span",[h])):c.appendChild(h),e.map.push(e.pos,e.pos+p,h),e.col+=p,e.pos+=p}if(!d)break;if(f+=p+1," "==d[0]){var m=e.cm.options.tabSize,v=m-e.col%m,h=c.appendChild(Xo("span",Lo(v),"cm-tab"));h.setAttribute("role","presentation"),h.setAttribute("cm-text"," "),e.col+=v}else if("\r"==d[0]||"\n"==d[0]){var h=c.appendChild(Xo("span","\r"==d[0]?"␍":"␤","cm-invalidchar"));h.setAttribute("cm-text",d[0]),e.col+=1}else{var h=e.cm.options.specialCharPlaceholder(d[0]);h.setAttribute("cm-text",d[0]),bi&&9>xi?c.appendChild(Xo("span",[h])):c.appendChild(h),e.col+=1}e.map.push(e.pos,e.pos+1,h),e.pos++}else{e.col+=t.length;var c=document.createTextNode(s);e.map.push(e.pos,e.pos+t.length,c),bi&&9>xi&&(l=!0),e.pos+=t.length}if(n||r||o||l||a){var g=n||"";r&&(g+=r),o&&(g+=o);var y=Xo("span",[c],g,a);return i&&(y.title=i),e.content.appendChild(y)}e.content.appendChild(c)}}function qr(e){for(var t=" ",n=0;nl&&d.from<=l)break}if(d.to>=c)return e(n,r,o,i,a,s,u);e(n,r.slice(0,d.to-l),o,i,null,s,u),i=null,r=r.slice(d.to-l),l=d.to}}}function Xr(e,t,n,r){var o=!r&&n.widgetNode;o&&e.map.push(e.pos,e.pos+t,o),!r&&e.cm.display.input.needsContentAttribute&&(o||(o=e.content.appendChild(document.createElement("span"))),o.setAttribute("cm-marker",n.id)),o&&(e.cm.display.input.setUneditable(o),e.content.appendChild(o)),e.pos+=t}function Vr(e,t,n){var r=e.markedSpans,o=e.text,i=0;if(r)for(var a,s,u,l,c,f,d,p=o.length,h=0,m=1,v="",g=0;;){if(g==h){u=l=c=f=s="",d=null,g=1/0;for(var y,b=[],x=0;xh||w.collapsed&&A.to==h&&A.from==h)?(null!=A.to&&A.to!=h&&g>A.to&&(g=A.to,l=""),w.className&&(u+=" "+w.className),w.css&&(s=(s?s+";":"")+w.css),w.startStyle&&A.from==h&&(c+=" "+w.startStyle),w.endStyle&&A.to==g&&(y||(y=[])).push(w.endStyle,A.to),w.title&&!f&&(f=w.title),w.collapsed&&(!d||pr(d.marker,w)<0)&&(d=A)):A.from>h&&g>A.from&&(g=A.from)}if(y)for(var x=0;x=p)break;for(var k=Math.min(p,g);;){if(v){var P=h+v.length;if(!d){var C=P>k?v.slice(0,k-h):v;t.addToken(t,C,a?a+u:u,c,h+C.length==g?l:"",f,s)}if(P>=k){v=v.slice(k-h),h=k;break}h=P,c=""}v=o.slice(i,i=n[m++]),a=zr(n[m++],t.cm.options)}}else for(var m=1;mn;++n)i.push(new xa(l[n],o(n),r));return i}var s=t.from,u=t.to,l=t.text,c=Qr(e,s.line),f=Qr(e,u.line),d=jo(l),p=o(l.length-1),h=u.line-s.line;if(t.full)e.insert(0,a(0,l.length)),e.remove(l.length,e.size-l.length);else if(Br(e,t)){var m=a(0,l.length-1);i(f,f.text,p),h&&e.remove(s.line,h),m.length&&e.insert(s.line,m)}else if(c==f)if(1==l.length)i(c,c.text.slice(0,s.ch)+d+c.text.slice(u.ch),p);else{var m=a(1,l.length-1);m.push(new xa(d+c.text.slice(u.ch),p,r)),i(c,c.text.slice(0,s.ch)+l[0],o(0)),e.insert(s.line+1,m)}else if(1==l.length)i(c,c.text.slice(0,s.ch)+l[0]+f.text.slice(u.ch),o(0)),e.remove(s.line+1,h);else{i(c,c.text.slice(0,s.ch)+l[0],o(0)),i(f,d+f.text.slice(u.ch),p);var m=a(1,l.length-1);h>1&&e.remove(s.line+1,h-1),e.insert(s.line+1,m)}Co(e,"change",e,t)}function Gr(e){this.lines=e,this.parent=null;for(var t=0,n=0;tt||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 o=n.children[r],i=o.chunkSize();if(i>t){n=o;break}t-=i}return n.lines[t]}function _r(e,t,n){var r=[],o=t.line;return e.iter(t.line,n.line+1,function(e){var i=e.text;o==n.line&&(i=i.slice(0,n.ch)),o==t.line&&(i=i.slice(t.ch)),r.push(i),++o}),r}function $r(e,t,n){var r=[];return e.iter(t,n,function(e){r.push(e.text)}),r}function eo(e,t){var n=t-e.height;if(n)for(var r=e;r;r=r.parent)r.height+=n}function to(e){if(null==e.parent)return null;for(var t=e.parent,n=Ro(t.lines,e),r=t.parent;r;t=r,r=r.parent)for(var o=0;r.children[o]!=t;++o)n+=r.children[o].chunkSize();return n+t.first}function no(e,t){var n=e.first;e:do{for(var r=0;rt){e=o;continue e}t-=i,n+=o.chunkSize()}return n}while(!e.lines);for(var r=0;rt)break;t-=s}return n+r}function ro(e){e=yr(e);for(var t=0,n=e.parent,r=0;r1&&!e.done[e.done.length-2].ranges?(e.done.pop(),jo(e.done)):void 0}function lo(e,t,n,r){var o=e.history;o.undone.length=0;var i,a=+new Date;if((o.lastOp==r||o.lastOrigin==t.origin&&t.origin&&("+"==t.origin.charAt(0)&&e.cm&&o.lastModTime>a-e.cm.options.historyEventDelay||"*"==t.origin.charAt(0)))&&(i=uo(o,o.lastOp==r))){var s=jo(i.changes);0==Wi(t.from,t.to)&&0==Wi(t.from,s.to)?s.to=$i(t):i.changes.push(ao(e,t))}else{var u=jo(o.done);for(u&&u.ranges||po(e.sel,o.done),i={changes:[ao(e,t)],generation:o.generation},o.done.push(i);o.done.length>o.undoDepth;)o.done.shift(),o.done[0].ranges||o.done.shift()}o.done.push(n),o.generation=++o.maxGeneration,o.lastModTime=o.lastSelTime=a,o.lastOp=o.lastSelOp=r,o.lastOrigin=o.lastSelOrigin=t.origin,s||ja(e,"historyAdded")}function co(e,t,n,r){var o=t.charAt(0);return"*"==o||"+"==o&&n.ranges.length==r.ranges.length&&n.somethingSelected()==r.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function fo(e,t,n,r){var o=e.history,i=r&&r.origin;n==o.lastSelOp||i&&o.lastSelOrigin==i&&(o.lastModTime==o.lastSelTime&&o.lastOrigin==i||co(e,i,jo(o.done),t))?o.done[o.done.length-1]=t:po(t,o.done),o.lastSelTime=+new Date,o.lastSelOrigin=i,o.lastSelOp=n,r&&r.clearRedo!==!1&&so(o.undone)}function po(e,t){var n=jo(t);n&&n.ranges&&n.equals(e)||t.push(e)}function ho(e,t,n,r){var o=t["spans_"+e.id],i=0;e.iter(Math.max(e.first,n),Math.min(e.first+e.size,r),function(n){n.markedSpans&&((o||(o=t["spans_"+e.id]={}))[i]=n.markedSpans),++i})}function mo(e){if(!e)return null;for(var t,n=0;n-1&&(jo(s)[f]=c[f],delete c[f])}}}return o}function yo(e,t,n,r){n0?r.slice():Oa:r||Oa}function Co(e,t){function n(e){return function(){e.apply(null,i)}}var r=Po(e,t,!1);if(r.length){var o,i=Array.prototype.slice.call(arguments,2);Bi?o=Bi.delayedCallbacks:Ra?o=Ra:(o=Ra=[],setTimeout(To,0));for(var a=0;a0}function So(e){e.prototype.on=function(e,t){Sa(this,e,t)},e.prototype.off=function(e,t){La(this,e,t)}}function Oo(){this.id=null}function Lo(e){for(;Ua.length<=e;)Ua.push(jo(Ua)+" ");return Ua[e]}function jo(e){return e[e.length-1]}function Ro(e,t){for(var n=0;n-1&&Za(e)?!0:t.test(e):Za(e)}function qo(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}function Uo(e){return e.charCodeAt(0)>=768&&Ga.test(e)}function Xo(e,t,n,r){var o=document.createElement(e);if(n&&(o.className=n),r&&(o.style.cssText=r),"string"==typeof t)o.appendChild(document.createTextNode(t));else if(t)for(var i=0;i0;--t)e.removeChild(e.firstChild);return e}function Bo(e,t){return Vo(e).appendChild(t)}function Zo(){for(var e=document.activeElement;e&&e.root&&e.root.activeElement;)e=e.root.activeElement;return e}function Go(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}function Jo(e,t){for(var n=e.split(" "),r=0;r2&&!(bi&&8>xi))}var n=Ka?Xo("span","​"):Xo("span"," ",null,"display: inline-block; width: 1px; margin-right: -1px");return n.setAttribute("cm-text",""),n}function $o(e){if(null!=Ya)return Ya;var t=Bo(e,document.createTextNode("AخA")),n=Va(t,0,1).getBoundingClientRect();if(!n||n.left==n.right)return!1;var r=Va(t,1,2).getBoundingClientRect();return Ya=r.right-n.right<3}function ei(e){if(null!=os)return os;var t=Bo(e,Xo("span","x")),n=t.getBoundingClientRect(),r=Va(t,0,1).getBoundingClientRect();return os=Math.abs(n.left-r.left)>1}function ti(e,t,n,r){if(!e)return r(t,n,"ltr");for(var o=!1,i=0;it||t==n&&a.to==t)&&(r(Math.max(a.from,t),Math.min(a.to,n),1==a.level?"rtl":"ltr"),o=!0)}o||r(t,n,"ltr")}function ni(e){return e.level%2?e.to:e.from}function ri(e){return e.level%2?e.from:e.to}function oi(e){var t=oo(e);return t?ni(t[0]):0}function ii(e){var t=oo(e);return t?ri(jo(t)):e.text.length}function ai(e,t){var n=Qr(e.doc,t),r=yr(n);r!=n&&(t=to(r));var o=oo(r),i=o?o[0].level%2?ii(r):oi(r):0;return Hi(t,i)}function si(e,t){for(var n,r=Qr(e.doc,t);n=vr(r);)r=n.find(1,!0).line,t=null;var o=oo(r),i=o?o[0].level%2?oi(r):ii(r):r.text.length;return Hi(null==t?to(r):t,i)}function ui(e,t){var n=ai(e,t.line),r=Qr(e.doc,n.line),o=oo(r);if(!o||0==o[0].level){var i=Math.max(0,r.text.search(/\S/)),a=t.line==n.line&&t.ch<=i&&t.ch;return Hi(n.line,a?0:i)}return n}function li(e,t,n){var r=e[0].level;return t==r?!0:n==r?!1:n>t}function ci(e,t){as=null;for(var n,r=0;rt)return r;if(o.from==t||o.to==t){if(null!=n)return li(e,o.level,e[n].level)?(o.from!=o.to&&(as=n),r):(o.from!=o.to&&(as=r),n);n=r}}return n}function fi(e,t,n,r){if(!r)return t+n;do t+=n;while(t>0&&Uo(e.text.charAt(t)));return t}function di(e,t,n,r){var o=oo(e);if(!o)return pi(e,t,n,r);for(var i=ci(o,t),a=o[i],s=fi(e,t,a.level%2?-n:n,r);;){if(s>a.from&&s0==a.level%2?a.to:a.from);if(a=o[i+=n],!a)return null;s=n>0==a.level%2?fi(e,a.to,-1,r):fi(e,a.from,1,r)}}function pi(e,t,n,r){var o=t+n;if(r)for(;o>0&&Uo(e.text.charAt(o));)o+=n;return 0>o||o>e.text.length?null:o}var hi=navigator.userAgent,mi=navigator.platform,vi=/gecko\/\d/i.test(hi),gi=/MSIE \d/.test(hi),yi=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(hi),bi=gi||yi,xi=bi&&(gi?document.documentMode||6:yi[1]),Ai=/WebKit\//.test(hi),wi=Ai&&/Qt\/\d+\.\d+/.test(hi),ki=/Chrome\//.test(hi),Pi=/Opera\//.test(hi),Ci=/Apple Computer/.test(navigator.vendor),Ti=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(hi),Ei=/PhantomJS/.test(hi),Ni=/AppleWebKit/.test(hi)&&/Mobile\/\w+/.test(hi),Mi=Ni||/Android|webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(hi),Si=Ni||/Mac/.test(mi),Oi=/\bCrOS\b/.test(hi),Li=/win/i.test(mi),ji=Pi&&hi.match(/Version\/(\d*\.\d*)/);ji&&(ji=Number(ji[1])),ji&&ji>=15&&(Pi=!1,Ai=!0);var Ri=Si&&(wi||Pi&&(null==ji||12.11>ji)),Di=vi||bi&&xi>=9,Ii=!1,zi=!1;m.prototype=Ho({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 o=e.viewHeight-(t?r:0);this.vert.firstChild.style.height=Math.max(0,e.scrollHeight-e.clientHeight+o)+"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 i=e.viewWidth-e.barLeft-(n?r:0);this.horiz.firstChild.style.width=e.scrollWidth-e.clientWidth+i+"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}},setScrollLeft:function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz)},setScrollTop:function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert)},zeroWidthHack:function(){var e=Si&&!Ti?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new Oo,this.disableVert=new Oo},enableZeroWidthBar:function(e,t){function n(){var r=e.getBoundingClientRect(),o=document.elementFromPoint(r.left+1,r.bottom-1);o!=e?e.style.pointerEvents="none":t.set(1e3,n)}e.style.pointerEvents="auto",t.set(1e3,n)},clear:function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)}},m.prototype),v.prototype=Ho({update:function(){return{bottom:0,right:0}},setScrollLeft:function(){},setScrollTop:function(){},clear:function(){}},v.prototype),e.scrollbarModel={"native":m,"null":v},C.prototype.signal=function(e,t){Mo(e,t)&&this.events.push(arguments)},C.prototype.finish=function(){for(var e=0;e=9&&n.hasSelection&&(n.hasSelection=null),n.poll()}),Sa(i,"paste",function(e){Eo(r,e)||_(e,r)||(r.state.pasteIncoming=!0,n.fastPoll())}),Sa(i,"cut",t),Sa(i,"copy",t),Sa(e.scroller,"paste",function(t){Bt(e,t)||Eo(r,t)||(r.state.pasteIncoming=!0,n.focus())}),Sa(e.lineSpace,"selectstart",function(t){Bt(e,t)||Ea(t)}),Sa(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"})}}),Sa(i,"compositionend",function(){n.composing&&(n.poll(),n.composing.range.clear(),n.composing=null)})},prepareSelection:function(){var e=this.cm,t=e.display,n=e.doc,r=De(e);if(e.options.moveInputWithCursor){var o=pt(e,n.sel.primary().head,"div"),i=t.wrapper.getBoundingClientRect(),a=t.lineDiv.getBoundingClientRect();r.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,o.top+a.top-i.top)),r.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,o.left+a.left-i.left))}return r},showSelection:function(e){var t=this.cm,n=t.display;Bo(n.cursorDiv,e.cursors),Bo(n.selectionDiv,e.selection),null!=e.teTop&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},reset:function(e){if(!this.contextMenuPending){var t,n,r=this.cm,o=r.doc;if(r.somethingSelected()){this.prevInput="";var i=o.sel.primary();t=rs&&(i.to().line-i.from().line>100||(n=r.getSelection()).length>1e3);var a=t?"-":n||r.getSelection();this.textarea.value=a,r.state.focused&&Xa(this.textarea),bi&&xi>=9&&(this.hasSelection=a)}else e||(this.prevInput=this.textarea.value="",bi&&xi>=9&&(this.hasSelection=null));this.inaccurateSelection=t}},getField:function(){return this.textarea},supportsTouch:function(){return!1},focus:function(){if("nocursor"!=this.cm.options.readOnly&&(!Mi||Zo()!=this.textarea))try{this.textarea.focus()}catch(e){}},blur:function(){this.textarea.blur()},resetPosition:function(){this.wrapper.style.top=this.wrapper.style.left=0},receivedFocus:function(){this.slowPoll()},slowPoll:function(){var e=this;e.pollingFast||e.polling.set(this.cm.options.pollInterval,function(){e.poll(),e.cm.state.focused&&e.slowPoll()})},fastPoll:function(){function e(){var r=n.poll();r||t?(n.pollingFast=!1,n.slowPoll()):(t=!0,n.polling.set(60,e))}var t=!1,n=this;n.pollingFast=!0,n.polling.set(20,e)},poll:function(){var e=this.cm,t=this.textarea,n=this.prevInput;if(this.contextMenuPending||!e.state.focused||ns(t)&&!n&&!this.composing||e.isReadOnly()||e.options.disableInput||e.state.keySeq)return!1;var r=t.value;if(r==n&&!e.somethingSelected())return!1;if(bi&&xi>=9&&this.hasSelection===r||Si&&/[\uf700-\uf7ff]/.test(r))return e.display.input.reset(),!1;if(e.doc.sel==e.display.selForContextMenu){var o=r.charCodeAt(0);if(8203!=o||n||(n="​"),8666==o)return this.reset(),this.cm.execCommand("undo")}for(var i=0,a=Math.min(n.length,r.length);a>i&&n.charCodeAt(i)==r.charCodeAt(i);)++i;var s=this;return Mt(e,function(){Q(e,r.slice(i),n.length-i,null,s.composing?"*compose":null),r.length>1e3||r.indexOf("\n")>-1?t.value=s.prevInput="":s.prevInput=r,s.composing&&(s.composing.range.clear(),s.composing.range=e.markText(s.composing.start,e.getCursor("to"),{className:"CodeMirror-composing"}))}),!0},ensurePolled:function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},onKeyPress:function(){bi&&xi>=9&&(this.hasSelection=null),this.fastPoll()},onContextMenu:function(e){function t(){if(null!=a.selectionStart){var e=o.somethingSelected(),t="​"+(e?a.value:"");a.value="⇚",a.value=t,r.prevInput=e?"":"​",a.selectionStart=1,a.selectionEnd=t.length,i.selForContextMenu=o.doc.sel}}function n(){if(r.contextMenuPending=!1,r.wrapper.style.cssText=f,a.style.cssText=c,bi&&9>xi&&i.scrollbars.setScrollTop(i.scroller.scrollTop=u),null!=a.selectionStart){(!bi||bi&&9>xi)&&t();var e=0,n=function(){i.selForContextMenu==o.doc.sel&&0==a.selectionStart&&a.selectionEnd>0&&"​"==r.prevInput?St(o,ca.selectAll)(o):e++<10?i.detectingSelectAll=setTimeout(n,500):i.input.reset()};i.detectingSelectAll=setTimeout(n,200)}}var r=this,o=r.cm,i=o.display,a=r.textarea,s=Zt(o,e),u=i.scroller.scrollTop;if(s&&!Pi){var l=o.options.resetSelectionOnContextMenu;l&&-1==o.doc.sel.contains(s)&&St(o,Te)(o.doc,pe(s),za);var c=a.style.cssText,f=r.wrapper.style.cssText;r.wrapper.style.cssText="position: absolute";var d=r.wrapper.getBoundingClientRect();if(a.style.cssText="position: absolute; width: 30px; height: 30px; top: "+(e.clientY-d.top-5)+"px; left: "+(e.clientX-d.left-5)+"px; z-index: 1000; background: "+(bi?"rgba(255, 255, 255, .05)":"transparent")+"; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);",Ai)var p=window.scrollY;if(i.input.focus(),Ai&&window.scrollTo(null,p),i.input.reset(),o.somethingSelected()||(a.value=r.prevInput=" "),r.contextMenuPending=!0,i.selForContextMenu=o.doc.sel,clearTimeout(i.detectingSelectAll),bi&&xi>=9&&t(),Di){Ma(e);var h=function(){La(window,"mouseup",h),setTimeout(n,20)};Sa(window,"mouseup",h)}else setTimeout(n,50)}},readOnlyChanged:function(e){e||this.reset()},setUneditable:Io,needsContentAttribute:!1},ne.prototype),oe.prototype=Ho({init:function(e){function t(e){if(!Eo(r,e)){if(r.somethingSelected())Fi=r.getSelections(),"cut"==e.type&&r.replaceSelection("",null,"cut");else{if(!r.options.lineWiseCopyCut)return;var t=ee(r);Fi=t.text,"cut"==e.type&&r.operation(function(){r.setSelections(t.ranges,0,za),r.replaceSelection("",null,"cut")})}if(e.clipboardData&&!Ni)e.preventDefault(),e.clipboardData.clearData(),e.clipboardData.setData("text/plain",Fi.join("\n"));else{var n=re(),o=n.firstChild;r.display.lineSpace.insertBefore(n,r.display.lineSpace.firstChild),o.value=Fi.join("\n");var i=document.activeElement;Xa(o),setTimeout(function(){r.display.lineSpace.removeChild(n),i.focus()},50)}}}var n=this,r=n.cm,o=n.div=e.lineDiv;te(o),Sa(o,"paste",function(e){Eo(r,e)||_(e,r)}),Sa(o,"compositionstart",function(e){var t=e.data;if(n.composing={sel:r.doc.sel,data:t,startData:t},t){var o=r.doc.sel.primary(),i=r.getLine(o.head.line),a=i.indexOf(t,Math.max(0,o.head.ch-t.length));a>-1&&a<=o.head.ch&&(n.composing.sel=pe(Hi(o.head.line,a),Hi(o.head.line,a+t.length)))}}),Sa(o,"compositionupdate",function(e){n.composing.data=e.data}),Sa(o,"compositionend",function(e){var t=n.composing;t&&(e.data==t.startData||/\u200b/.test(e.data)||(t.data=e.data),setTimeout(function(){t.handled||n.applyComposition(t),n.composing==t&&(n.composing=null)},50))}),Sa(o,"touchstart",function(){n.forceCompositionEnd()}),Sa(o,"input",function(){n.composing||!r.isReadOnly()&&n.pollContent()||Mt(n.cm,function(){Dt(r)})}),Sa(o,"copy",t),Sa(o,"cut",t)},prepareSelection:function(){var e=De(this.cm,!1);return e.focus=this.cm.state.focused,e},showSelection:function(e){e&&this.cm.display.view.length&&(e.focus&&this.showPrimarySelection(),this.showMultipleSelections(e))},showPrimarySelection:function(){var e=window.getSelection(),t=this.cm.doc.sel.primary(),n=se(this.cm,e.anchorNode,e.anchorOffset),r=se(this.cm,e.focusNode,e.focusOffset);if(!n||n.bad||!r||r.bad||0!=Wi(K(n,r),t.from())||0!=Wi(J(n,r),t.to())){var o=ie(this.cm,t.from()),i=ie(this.cm,t.to());if(o||i){var a=this.cm.display.view,s=e.rangeCount&&e.getRangeAt(0);if(o){if(!i){var u=a[a.length-1].measure,l=u.maps?u.maps[u.maps.length-1]:u.map;i={node:l[l.length-1],offset:l[l.length-2]-l[l.length-3]}}}else o={node:a[0].measure.map[2],offset:0};try{var c=Va(o.node,o.offset,i.offset,i.node)}catch(f){}c&&(!vi&&this.cm.state.focused?(e.collapse(o.node,o.offset),c.collapsed||e.addRange(c)):(e.removeAllRanges(),e.addRange(c)),s&&null==e.anchorNode?e.addRange(s):vi&&this.startGracePeriod()),this.rememberSelection()}}},startGracePeriod:function(){var e=this;clearTimeout(this.gracePeriod),this.gracePeriod=setTimeout(function(){e.gracePeriod=!1,e.selectionChanged()&&e.cm.operation(function(){e.cm.curOp.selectionChanged=!0})},20)},showMultipleSelections:function(e){Bo(this.cm.display.cursorDiv,e.cursors),Bo(this.cm.display.selectionDiv,e.selection)},rememberSelection:function(){var e=window.getSelection();this.lastAnchorNode=e.anchorNode,this.lastAnchorOffset=e.anchorOffset,this.lastFocusNode=e.focusNode,this.lastFocusOffset=e.focusOffset},selectionInEditor:function(){var e=window.getSelection();if(!e.rangeCount)return!1;var t=e.getRangeAt(0).commonAncestorContainer;return Ja(this.div,t)},focus:function(){"nocursor"!=this.cm.options.readOnly&&this.div.focus()},blur:function(){this.div.blur()},getField:function(){return this.div},supportsTouch:function(){return!0},receivedFocus:function(){function e(){t.cm.state.focused&&(t.pollSelection(),t.polling.set(t.cm.options.pollInterval,e))}var t=this;this.selectionInEditor()?this.pollSelection():Mt(this.cm,function(){t.cm.curOp.selectionChanged=!0}),this.polling.set(this.cm.options.pollInterval,e)},selectionChanged:function(){var e=window.getSelection();return e.anchorNode!=this.lastAnchorNode||e.anchorOffset!=this.lastAnchorOffset||e.focusNode!=this.lastFocusNode||e.focusOffset!=this.lastFocusOffset},pollSelection:function(){if(!this.composing&&!this.gracePeriod&&this.selectionChanged()){var e=window.getSelection(),t=this.cm;this.rememberSelection();var n=se(t,e.anchorNode,e.anchorOffset),r=se(t,e.focusNode,e.focusOffset);n&&r&&Mt(t,function(){Te(t.doc,pe(n,r),za),(n.bad||r.bad)&&(t.curOp.selectionChanged=!0)})}},pollContent:function(){var e=this.cm,t=e.display,n=e.doc.sel.primary(),r=n.from(),o=n.to();if(r.linet.viewTo-1)return!1;var i;if(r.line==t.viewFrom||0==(i=Ht(e,r.line)))var a=to(t.view[0].line),s=t.view[0].node;else var a=to(t.view[i].line),s=t.view[i-1].node.nextSibling;var u=Ht(e,o.line);if(u==t.view.length-1)var l=t.viewTo-1,c=t.lineDiv.lastChild;else var l=to(t.view[u+1].line)-1,c=t.view[u+1].node.previousSibling;for(var f=e.doc.splitLines(le(e,s,c,a,l)),d=_r(e.doc,Hi(a,0),Hi(l,Qr(e.doc,l).text.length));f.length>1&&d.length>1;)if(jo(f)==jo(d))f.pop(),d.pop(),l--;else{if(f[0]!=d[0])break;f.shift(),d.shift(),a++}for(var p=0,h=0,m=f[0],v=d[0],g=Math.min(m.length,v.length);g>p&&m.charCodeAt(p)==v.charCodeAt(p);)++p;for(var y=jo(f),b=jo(d),x=Math.min(y.length-(1==f.length?p:0),b.length-(1==d.length?p:0));x>h&&y.charCodeAt(y.length-h-1)==b.charCodeAt(b.length-h-1);)++h;f[f.length-1]=y.slice(0,y.length-h),f[0]=f[0].slice(p);var A=Hi(a,p),w=Hi(l,d.length?jo(d).length-h:0);return f.length>1||f[0]||Wi(A,w)?(Ln(e.doc,f,A,w,"+input"),!0):void 0},ensurePolled:function(){this.forceCompositionEnd()},reset:function(){this.forceCompositionEnd()},forceCompositionEnd:function(){this.composing&&!this.composing.handled&&(this.applyComposition(this.composing),this.composing.handled=!0,this.div.blur(),this.div.focus())},applyComposition:function(e){this.cm.isReadOnly()?St(this.cm,Dt)(this.cm):e.data&&e.data!=e.startData&&St(this.cm,Q)(this.cm,e.data,0,e.sel)},setUneditable:function(e){e.contentEditable="false"},onKeyPress:function(e){e.preventDefault(),this.cm.isReadOnly()||St(this.cm,Q)(this.cm,String.fromCharCode(null==e.charCode?e.keyCode:e.charCode),0)},readOnlyChanged:function(e){this.div.contentEditable=String("nocursor"!=e)},onContextMenu:Io,resetPosition:Io,needsContentAttribute:!0},oe.prototype),e.inputStyles={textarea:ne,contenteditable:oe},ce.prototype={primary:function(){return this.ranges[this.primIndex]},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=0&&Wi(e,r.to())<=0)return n}return-1}},fe.prototype={from:function(){return K(this.anchor,this.head)},to:function(){return J(this.anchor,this.head)},empty:function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch}};var qi,Ui,Xi,Vi={left:0,right:0,top:0,bottom:0},Bi=null,Zi=0,Gi=0,Ji=0,Ki=null;bi?Ki=-.53:vi?Ki=15:ki?Ki=-.7:Ci&&(Ki=-1/3);var Yi=function(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}};e.wheelEventPixels=function(e){var t=Yi(e);return t.x*=Ki,t.y*=Ki,t};var Qi=new Oo,_i=null,$i=e.changeEnd=function(e){return e.text?Hi(e.from.line+e.text.length-1,jo(e.text).length+(1==e.text.length?e.from.ch:0)):e.to};e.prototype={constructor:e,focus:function(){window.focus(),this.display.input.focus()},setOption:function(e,t){var n=this.options,r=n[e];n[e]==t&&"mode"!=e||(n[e]=t,ta.hasOwnProperty(e)&&St(this,ta[e])(this,t,r))},getOption:function(e){return this.options[e]},getDoc:function(){return this.doc},addKeyMap:function(e,t){this.state.keyMaps[t?"push":"unshift"](Gn(e))},removeKeyMap:function(e){for(var t=this.state.keyMaps,n=0;nn&&(Fn(this,o.head.line,e,!0),n=o.head.line,r==this.doc.sel.primIndex&&Hn(this));else{var i=o.from(),a=o.to(),s=Math.max(n,i.line);n=Math.min(this.lastLine(),a.line-(a.ch?0:1))+1;for(var u=s;n>u;++u)Fn(this,u,e);var l=this.doc.sel.ranges;0==i.ch&&t.length==l.length&&l[r].from().ch>0&&we(this.doc,r,new fe(i,l[r].to()),za)}}}),getTokenAt:function(e,t){return Lr(this,e,t)},getLineTokens:function(e,t){return Lr(this,Hi(e),t,!0)},getTokenTypeAt:function(e){e=me(this.doc,e);var t,n=Dr(this,Qr(this.doc,e.line)),r=0,o=(n.length-1)/2,i=e.ch;if(0==i)t=n[2];else for(;;){var a=r+o>>1;if((a?n[2*a-1]:0)>=i)o=a;else{if(!(n[2*a+1]s?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 n=[];if(!sa.hasOwnProperty(t))return n;var r=sa[t],o=this.getModeAt(e);if("string"==typeof o[t])r[o[t]]&&n.push(r[o[t]]);else if(o[t])for(var i=0;io&&(e=o,r=!0),n=Qr(this.doc,e)}else n=e;return ct(this,n,{top:0,left:0},t||"page").top+(r?this.doc.height-ro(n):0)},defaultTextHeight:function(){return yt(this.display)},defaultCharWidth:function(){return bt(this.display)},setGutterMarker:Ot(function(e,t,n){return qn(this.doc,e,"gutter",function(e){var r=e.gutterMarkers||(e.gutterMarkers={});return r[t]=n,!n&&qo(r)&&(e.gutterMarkers=null),!0})}),clearGutter:Ot(function(e){var t=this,n=t.doc,r=n.first;n.iter(function(n){n.gutterMarkers&&n.gutterMarkers[e]&&(n.gutterMarkers[e]=null,It(t,r,"gutter"),qo(n.gutterMarkers)&&(n.gutterMarkers=null)),++r})}),lineInfo:function(e){if("number"==typeof e){if(!ge(this.doc,e))return null;var t=e;if(e=Qr(this.doc,e),!e)return null}else{var t=to(e);if(null==t)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}},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(e,t,n,r,o){var i=this.display;e=pt(this,me(this.doc,e));var a=e.bottom,s=e.left;if(t.style.position="absolute",t.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(t),i.sizer.appendChild(t),"over"==r)a=e.top;else if("above"==r||"near"==r){var u=Math.max(i.wrapper.clientHeight,this.doc.height),l=Math.max(i.sizer.clientWidth,i.lineSpace.clientWidth);("above"==r||e.bottom+t.offsetHeight>u)&&e.top>t.offsetHeight?a=e.top-t.offsetHeight:e.bottom+t.offsetHeight<=u&&(a=e.bottom),s+t.offsetWidth>l&&(s=l-t.offsetWidth)}t.style.top=a+"px",t.style.left=t.style.right="","right"==o?(s=i.sizer.clientWidth-t.offsetWidth,t.style.right="0px"):("left"==o?s=0:"middle"==o&&(s=(i.sizer.clientWidth-t.offsetWidth)/2),t.style.left=s+"px"),n&&Dn(this,s,a,s+t.offsetWidth,a+t.offsetHeight)},triggerOnKeyDown:Ot(dn),triggerOnKeyPress:Ot(mn),triggerOnKeyUp:hn,execCommand:function(e){return ca.hasOwnProperty(e)?ca[e].call(null,this):void 0},triggerElectric:Ot(function(e){$(this,e)}),findPosH:function(e,t,n,r){var o=1;0>t&&(o=-1,t=-t);for(var i=0,a=me(this.doc,e);t>i&&(a=Xn(this.doc,a,o,n,r),!a.hitSide);++i);return a},moveH:Ot(function(e,t){var n=this;n.extendSelectionsBy(function(r){return n.display.shift||n.doc.extend||r.empty()?Xn(n.doc,r.head,e,t,n.options.rtlMoveVisually):0>e?r.from():r.to()},Wa)}),deleteH:Ot(function(e,t){var n=this.doc.sel,r=this.doc;n.somethingSelected()?r.replaceSelection("",null,"+delete"):Un(this,function(n){var o=Xn(r,n.head,e,t,!1);return 0>e?{from:o,to:n.head}:{from:n.head,to:o}})}),findPosV:function(e,t,n,r){var o=1,i=r;0>t&&(o=-1,t=-t);for(var a=0,s=me(this.doc,e);t>a;++a){var u=pt(this,s,"div");if(null==i?i=u.left:u.left=i,s=Vn(this,u,o,n),s.hitSide)break}return s},moveV:Ot(function(e,t){var n=this,r=this.doc,o=[],i=!n.display.shift&&!r.extend&&r.sel.somethingSelected();if(r.extendSelectionsBy(function(a){if(i)return 0>e?a.from():a.to();var s=pt(n,a.head,"div");null!=a.goalColumn&&(s.left=a.goalColumn),o.push(s.left);var u=Vn(n,s,e,t);return"page"==t&&a==r.sel.primary()&&zn(n,null,dt(n,u,"div").top-s.top),u},Wa),o.length)for(var a=0;a0&&s(n.charAt(r-1));)--r;for(;o.5)&&a(this),ja(this,"refresh",this)}),swapDoc:Ot(function(e){var t=this.doc;return t.cm=null,Yr(this,e),st(this),this.display.input.reset(),this.scrollTo(e.scrollLeft,e.scrollTop),this.curOp.forceScroll=!0,Co(this,"swapDoc",this,t),t}),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}},So(e);var ea=e.defaults={},ta=e.optionHandlers={},na=e.Init={toString:function(){return"CodeMirror.Init"}};Bn("value","",function(e,t){e.setValue(t)},!0),Bn("mode",null,function(e,t){e.doc.modeOption=t,n(e)},!0),Bn("indentUnit",2,n,!0),Bn("indentWithTabs",!1),Bn("smartIndent",!0),Bn("tabSize",4,function(e){r(e),st(e),Dt(e)},!0),Bn("lineSeparator",null,function(e,t){if(e.doc.lineSep=t,t){var n=[],r=e.doc.first;e.doc.iter(function(e){for(var o=0;;){var i=e.text.indexOf(t,o);if(-1==i)break;o=i+t.length,n.push(Hi(r,i))}r++});for(var o=n.length-1;o>=0;o--)Ln(e.doc,t,n[o],Hi(n[o].line,n[o].ch+t.length))}}),Bn("specialChars",/[\t\u0000-\u0019\u00ad\u200b-\u200f\u2028\u2029\ufeff]/g,function(t,n,r){t.state.specialChars=new RegExp(n.source+(n.test(" ")?"":"| "),"g"),r!=e.Init&&t.refresh()}),Bn("specialCharPlaceholder",Wr,function(e){e.refresh()},!0),Bn("electricChars",!0),Bn("inputStyle",Mi?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),Bn("rtlMoveVisually",!Li),Bn("wholeLineUpdateBefore",!0),Bn("theme","default",function(e){s(e),u(e)},!0),Bn("keyMap","default",function(t,n,r){var o=Gn(n),i=r!=e.Init&&Gn(r);i&&i.detach&&i.detach(t,o),o.attach&&o.attach(t,i||null)}),Bn("extraKeys",null),Bn("lineWrapping",!1,o,!0),Bn("gutters",[],function(e){p(e.options),u(e)},!0),Bn("fixedGutter",!0,function(e,t){e.display.gutters.style.left=t?P(e.display)+"px":"0",e.refresh()},!0),Bn("coverGutterNextToScrollbar",!1,function(e){y(e)},!0),Bn("scrollbarStyle","native",function(e){g(e),y(e),e.display.scrollbars.setScrollTop(e.doc.scrollTop),e.display.scrollbars.setScrollLeft(e.doc.scrollLeft)},!0),Bn("lineNumbers",!1,function(e){p(e.options),u(e)},!0),Bn("firstLineNumber",1,u,!0),Bn("lineNumberFormatter",function(e){return e},u,!0),Bn("showCursorWhenSelecting",!1,Re,!0),Bn("resetSelectionOnContextMenu",!0),Bn("lineWiseCopyCut",!0),Bn("readOnly",!1,function(e,t){"nocursor"==t?(yn(e),e.display.input.blur(),e.display.disabled=!0):e.display.disabled=!1,e.display.input.readOnlyChanged(t)}),Bn("disableInput",!1,function(e,t){t||e.display.input.reset()},!0),Bn("dragDrop",!0,Xt),Bn("allowDropFileTypes",null),Bn("cursorBlinkRate",530),Bn("cursorScrollMargin",0),Bn("cursorHeight",1,Re,!0),Bn("singleCursorHeightPerLine",!0,Re,!0),Bn("workTime",100),Bn("workDelay",100),Bn("flattenSpans",!0,r,!0),Bn("addModeClass",!1,r,!0),Bn("pollInterval",100),Bn("undoDepth",200,function(e,t){e.doc.history.undoDepth=t}),Bn("historyEventDelay",1250),Bn("viewportMargin",10,function(e){e.refresh()},!0),Bn("maxHighlightLength",1e4,r,!0),Bn("moveInputWithCursor",!0,function(e,t){t||e.display.input.resetPosition()}),Bn("tabindex",null,function(e,t){e.display.input.getField().tabIndex=t||""}),Bn("autofocus",null);var ra=e.modes={},oa=e.mimeModes={};e.defineMode=function(t,n){e.defaults.mode||"null"==t||(e.defaults.mode=t),arguments.length>2&&(n.dependencies=Array.prototype.slice.call(arguments,2)),ra[t]=n},e.defineMIME=function(e,t){oa[e]=t},e.resolveMode=function(t){if("string"==typeof t&&oa.hasOwnProperty(t))t=oa[t];else if(t&&"string"==typeof t.name&&oa.hasOwnProperty(t.name)){var n=oa[t.name];"string"==typeof n&&(n={name:n}),t=zo(n,t),t.name=n.name}else if("string"==typeof t&&/^[\w\-]+\/[\w\-]+\+xml$/.test(t))return e.resolveMode("application/xml");return"string"==typeof t?{name:t}:t||{name:"null"}},e.getMode=function(t,n){var n=e.resolveMode(n),r=ra[n.name];if(!r)return e.getMode(t,"text/plain");var o=r(t,n);if(ia.hasOwnProperty(n.name)){var i=ia[n.name];for(var a in i)i.hasOwnProperty(a)&&(o.hasOwnProperty(a)&&(o["_"+a]=o[a]),o[a]=i[a])}if(o.name=n.name,n.helperType&&(o.helperType=n.helperType),n.modeProps)for(var a in n.modeProps)o[a]=n.modeProps[a];return o},e.defineMode("null",function(){return{token:function(e){e.skipToEnd()}}}),e.defineMIME("text/plain","null");var ia=e.modeExtensions={};e.extendMode=function(e,t){var n=ia.hasOwnProperty(e)?ia[e]:ia[e]={};Ho(t,n)},e.defineExtension=function(t,n){e.prototype[t]=n},e.defineDocExtension=function(e,t){Pa.prototype[e]=t},e.defineOption=Bn;var aa=[];e.defineInitHook=function(e){aa.push(e)};var sa=e.helpers={};e.registerHelper=function(t,n,r){sa.hasOwnProperty(t)||(sa[t]=e[t]={_global:[]}),sa[t][n]=r},e.registerGlobalHelper=function(t,n,r,o){e.registerHelper(t,n,o),sa[t]._global.push({pred:r,val:o})};var ua=e.copyState=function(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var n={};for(var r in t){var o=t[r];o instanceof Array&&(o=o.concat([])),n[r]=o}return n},la=e.startState=function(e,t,n){return e.startState?e.startState(t,n):!0};e.innerMode=function(e,t){for(;e.innerMode;){var n=e.innerMode(t);if(!n||n.mode==e)break;t=n.state,e=n.mode}return n||{mode:e,state:t}};var ca=e.commands={selectAll:function(e){e.setSelection(Hi(e.firstLine(),0),Hi(e.lastLine()),za)},singleSelection:function(e){e.setSelection(e.getCursor("anchor"),e.getCursor("head"),za)},killLine:function(e){Un(e,function(t){if(t.empty()){var n=Qr(e.doc,t.head.line).text.length;return t.head.ch==n&&t.head.line0)o=new Hi(o.line,o.ch+1),e.replaceRange(i.charAt(o.ch-1)+i.charAt(o.ch-2),Hi(o.line,o.ch-2),o,"+transpose");else if(o.line>e.doc.first){var a=Qr(e.doc,o.line-1).text;a&&e.replaceRange(i.charAt(0)+e.doc.lineSeparator()+a.charAt(a.length-1),Hi(o.line-1,a.length-1),Hi(o.line,1),"+transpose")}n.push(new fe(o,o))}e.setSelections(n)})},newlineAndIndent:function(e){Mt(e,function(){for(var t=e.listSelections().length,n=0;t>n;n++){var r=e.listSelections()[n];e.replaceRange(e.doc.lineSeparator(),r.anchor,r.head,"+input"),e.indentLine(r.from().line+1,null,!0)}Hn(e)})},toggleOverwrite:function(e){e.toggleOverwrite()}},fa=e.keyMap={};fa.basic={Left:"goCharLeft",Right:"goCharRight",Up:"goLineUp",Down:"goLineDown",End:"goLineEnd",Home:"goLineStartSmart",PageUp:"goPageUp",PageDown:"goPageDown",Delete:"delCharAfter",Backspace:"delCharBefore","Shift-Backspace":"delCharBefore",Tab:"defaultTab","Shift-Tab":"indentAuto",Enter:"newlineAndIndent",Insert:"toggleOverwrite",Esc:"singleSelection"},fa.pcDefault={"Ctrl-A":"selectAll","Ctrl-D":"deleteLine","Ctrl-Z":"undo","Shift-Ctrl-Z":"redo","Ctrl-Y":"redo","Ctrl-Home":"goDocStart","Ctrl-End":"goDocEnd","Ctrl-Up":"goLineUp","Ctrl-Down":"goLineDown","Ctrl-Left":"goGroupLeft","Ctrl-Right":"goGroupRight","Alt-Left":"goLineStart","Alt-Right":"goLineEnd","Ctrl-Backspace":"delGroupBefore","Ctrl-Delete":"delGroupAfter","Ctrl-S":"save","Ctrl-F":"find","Ctrl-G":"findNext","Shift-Ctrl-G":"findPrev","Shift-Ctrl-F":"replace","Shift-Ctrl-R":"replaceAll","Ctrl-[":"indentLess","Ctrl-]":"indentMore","Ctrl-U":"undoSelection","Shift-Ctrl-U":"redoSelection","Alt-U":"redoSelection",fallthrough:"basic"},fa.emacsy={"Ctrl-F":"goCharRight","Ctrl-B":"goCharLeft","Ctrl-P":"goLineUp","Ctrl-N":"goLineDown","Alt-F":"goWordRight","Alt-B":"goWordLeft","Ctrl-A":"goLineStart","Ctrl-E":"goLineEnd","Ctrl-V":"goPageDown","Shift-Ctrl-V":"goPageUp","Ctrl-D":"delCharAfter","Ctrl-H":"delCharBefore","Alt-D":"delWordAfter","Alt-Backspace":"delWordBefore","Ctrl-K":"killLine","Ctrl-T":"transposeChars"},fa.macDefault={"Cmd-A":"selectAll","Cmd-D":"deleteLine","Cmd-Z":"undo","Shift-Cmd-Z":"redo","Cmd-Y":"redo","Cmd-Home":"goDocStart","Cmd-Up":"goDocStart","Cmd-End":"goDocEnd","Cmd-Down":"goDocEnd","Alt-Left":"goGroupLeft","Alt-Right":"goGroupRight","Cmd-Left":"goLineLeft","Cmd-Right":"goLineRight","Alt-Backspace":"delGroupBefore","Ctrl-Alt-Backspace":"delGroupAfter","Alt-Delete":"delGroupAfter","Cmd-S":"save","Cmd-F":"find","Cmd-G":"findNext","Shift-Cmd-G":"findPrev","Cmd-Alt-F":"replace","Shift-Cmd-Alt-F":"replaceAll","Cmd-[":"indentLess","Cmd-]":"indentMore","Cmd-Backspace":"delWrappedLineLeft","Cmd-Delete":"delWrappedLineRight","Cmd-U":"undoSelection","Shift-Cmd-U":"redoSelection","Ctrl-Up":"goDocStart","Ctrl-Down":"goDocEnd",fallthrough:["basic","emacsy"]},fa["default"]=Si?fa.macDefault:fa.pcDefault,e.normalizeKeyMap=function(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 o=Do(n.split(" "),Zn),i=0;i=this.string.length},sol:function(){return this.pos==this.lineStart},peek:function(){return this.string.charAt(this.pos)||void 0},next:function(){return this.post},eatSpace:function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},skipToEnd:function(){this.pos=this.string.length},skipTo:function(e){var t=this.string.indexOf(e,this.pos);return t>-1?(this.pos=t,!0):void 0},backUp:function(e){this.pos-=e},column:function(){return this.lastColumnPos0?null:(r&&t!==!1&&(this.pos+=r[0].length),r)}var o=function(e){return n?e.toLowerCase():e},i=this.string.substr(this.pos,e.length);return o(i)==o(e)?(t!==!1&&(this.pos+=e.length),!0):void 0},current:function(){return this.string.slice(this.start,this.pos)},hideFirstChars:function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}}};var va=0,ga=e.TextMarker=function(e,t){this.lines=[],this.type=t,this.doc=e,this.id=++va};So(ga),ga.prototype.clear=function(){if(!this.explicitlyCleared){var e=this.doc.cm,t=e&&!e.curOp;if(t&&xt(e),Mo(this,"clear")){var n=this.find();n&&Co(this,"clear",n.from,n.to)}for(var r=null,o=null,i=0;ie.display.maxLineLength&&(e.display.maxLine=u,e.display.maxLineLength=l,e.display.maxLineChanged=!0)}null!=r&&e&&this.collapsed&&Dt(e,r,o+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Me(e.doc)),e&&Co(e,"markerCleared",e,this),t&&wt(e),this.parent&&this.parent.clear()}},ga.prototype.find=function(e,t){null==e&&"bookmark"==this.type&&(e=1);for(var n,r,o=0;on;++n){var o=this.lines[n];this.height-=o.height,Nr(o),Co(o,"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;re;++e)if(n(this.lines[e]))return!0}},Jr.prototype={chunkSize:function(){return this.size},removeInner:function(e,t){this.size-=t;for(var n=0;ne){var i=Math.min(t,o-e),a=r.height;if(r.removeInner(e,i),this.height-=a-r.height,o==i&&(this.children.splice(n--,1),r.parent=null),0==(t-=i))break;e=0}else e-=o}if(this.size-t<25&&(this.children.length>1||!(this.children[0]instanceof Gr))){var s=[];this.collapse(s),this.children=[new Gr(s)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t=e){if(o.insertInner(e,t,n),o.lines&&o.lines.length>50){for(;o.lines.length>50;){var a=o.lines.splice(o.lines.length-25,25),s=new Gr(a);o.height-=s.height,this.children.splice(r+1,0,s),s.parent=this}this.maybeSpill()}break}e-=i}},maybeSpill:function(){if(!(this.children.length<=10)){var e=this;do{var t=e.children.splice(e.children.length-5,5),n=new Jr(t);if(e.parent){e.size-=n.size,e.height-=n.height;var r=Ro(e.parent.children,e);e.parent.children.splice(r+1,0,n)}else{var o=new Jr(e.children);o.parent=e,e.children=[o,n],e=o}n.parent=e.parent}while(e.children.length>10);e.parent.maybeSpill()}},iterN:function(e,t,n){for(var r=0;re){var a=Math.min(t,i-e);if(o.iterN(e,a,n))return!0;if(0==(t-=a))break;e=0}else e-=i}}};var ka=0,Pa=e.Doc=function(e,t,n,r){if(!(this instanceof Pa))return new Pa(e,t,n,r);null==n&&(n=0),Jr.call(this,[new Gr([new xa("",null)])]),this.first=n,this.scrollTop=this.scrollLeft=0,this.cantEdit=!1,this.cleanGeneration=1,this.frontier=n;var o=Hi(n,0);this.sel=pe(o),this.history=new io(null),this.id=++ka,this.modeOption=t,this.lineSep=r,this.extend=!1,"string"==typeof e&&(e=this.splitLines(e)),Zr(this,{from:o,to:o,text:e}),Te(this,pe(o),za)};Pa.prototype=zo(Jr.prototype,{constructor:Pa,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=0;i--)Tn(this,r[i]);s?Ce(this,s):this.cm&&Hn(this.cm)}),undo:Lt(function(){Nn(this,"undo")}),redo:Lt(function(){Nn(this,"redo")}),undoSelection:Lt(function(){Nn(this,"undo",!0)}),redoSelection:Lt(function(){Nn(this,"redo",!0)}),setExtending:function(e){this.extend=e},getExtending:function(){return this.extend},historySize:function(){for(var e=this.history,t=0,n=0,r=0;r=e.ch)&&t.push(o.marker.parent||o.marker)}return t},findMarks:function(e,t,n){e=me(this,e),t=me(this,t);var r=[],o=e.line;return this.iter(e.line,t.line+1,function(i){var a=i.markedSpans;if(a)for(var s=0;s=u.to||null==u.from&&o!=e.line||null!=u.from&&o==t.line&&u.from>=t.ch||n&&!n(u.marker)||r.push(u.marker.parent||u.marker)}++o}),r},getAllMarks:function(){var e=[];return this.iter(function(t){var n=t.markedSpans;if(n)for(var r=0;re?(t=e,!0):(e-=i,void++n)}),me(this,Hi(n,t))},indexFromPos:function(e){e=me(this,e);var t=e.ch;if(e.linet&&(t=e.from),null!=e.to&&e.tos||s>=t)return a+(t-i);a+=s-i,a+=n-a%n,i=s+1}},qa=e.findColumn=function(e,t,n){for(var r=0,o=0;;){var i=e.indexOf(" ",r);-1==i&&(i=e.length);var a=i-r;if(i==e.length||o+a>=t)return r+Math.min(a,t-o);if(o+=i-r,o+=n-o%n,r=i+1,o>=t)return r}},Ua=[""],Xa=function(e){e.select()};Ni?Xa=function(e){e.selectionStart=0,e.selectionEnd=e.value.length}:bi&&(Xa=function(e){try{e.select()}catch(t){}});var Va,Ba=/[\u00df\u0587\u0590-\u05f4\u0600-\u06ff\u3040-\u309f\u30a0-\u30ff\u3400-\u4db5\u4e00-\u9fcc\uac00-\ud7af]/,Za=e.isWordChar=function(e){return/\w/.test(e)||e>"€"&&(e.toUpperCase()!=e.toLowerCase()||Ba.test(e))},Ga=/[\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]/;Va=document.createRange?function(e,t,n,r){var o=document.createRange();return o.setEnd(r||e,n),o.setStart(e,t),o}:function(e,t,n){var r=document.body.createTextRange();try{r.moveToElementText(e.parentNode)}catch(o){return r}return r.collapse(!0),r.moveEnd("character",n),r.moveStart("character",t),r};var Ja=e.contains=function(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)};bi&&11>xi&&(Zo=function(){try{return document.activeElement}catch(e){return document.body}});var Ka,Ya,Qa=e.rmClass=function(e,t){var n=e.className,r=Go(t).exec(n);if(r){var o=n.slice(r.index+r[0].length);e.className=n.slice(0,r.index)+(o?r[1]+o:"")}},_a=e.addClass=function(e,t){var n=e.className;Go(t).test(n)||(e.className+=(n?" ":"")+t)},$a=!1,es=function(){if(bi&&9>xi)return!1;var e=Xo("div");return"draggable"in e||"dragDrop"in e}(),ts=e.splitLines=3!="\n\nb".split(/\n/).length?function(e){for(var t=0,n=[],r=e.length;r>=t;){var o=e.indexOf("\n",t);-1==o&&(o=e.length);var i=e.slice(t,"\r"==e.charAt(o-1)?o-1:o),a=i.indexOf("\r");-1!=a?(n.push(i.slice(0,a)),t+=a+1):(n.push(i),t=o+1)}return n}:function(e){return e.split(/\r\n?|\n/)},ns=window.getSelection?function(e){try{return e.selectionStart!=e.selectionEnd}catch(t){return!1}}:function(e){try{var t=e.ownerDocument.selection.createRange()}catch(n){}return t&&t.parentElement()==e?0!=t.compareEndPoints("StartToEnd",t):!1},rs=function(){var e=Xo("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),"function"==typeof e.oncopy)}(),os=null,is=e.keyNames={3:"Enter",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:"/",127:"Delete",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"};!function(){for(var e=0;10>e;e++)is[e+48]=is[e+96]=String(e);for(var e=65;90>=e;e++)is[e]=String.fromCharCode(e);for(var e=1;12>=e;e++)is[e+111]=is[e+63235]="F"+e}();var as,ss=function(){function e(e){return 247>=e?n.charAt(e):e>=1424&&1524>=e?"R":e>=1536&&1773>=e?r.charAt(e-1536):e>=1774&&2220>=e?"r":e>=8192&&8203>=e?"w":8204==e?"b":"L"}function t(e,t,n){this.level=e,this.from=t,this.to=n}var n="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",r="rrrrrrrrrrrr,rNNmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmrrrrrrrnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmNmmmm",o=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,i=/[stwN]/,a=/[LRr]/,s=/[Lb1n]/,u=/[1n]/,l="L";return function(n){if(!o.test(n))return!1;for(var r,c=n.length,f=[],d=0;c>d;++d)f.push(r=e(n.charCodeAt(d)));for(var d=0,p=l;c>d;++d){var r=f[d];"m"==r?f[d]=p:p=r}for(var d=0,h=l;c>d;++d){var r=f[d];"1"==r&&"r"==h?f[d]="n":a.test(r)&&(h=r,"r"==r&&(f[d]="R"))}for(var d=1,p=f[0];c-1>d;++d){var r=f[d];"+"==r&&"1"==p&&"1"==f[d+1]?f[d]="1":","!=r||p!=f[d+1]||"1"!=p&&"n"!=p||(f[d]=p),p=r}for(var d=0;c>d;++d){var r=f[d];if(","==r)f[d]="N";else if("%"==r){for(var m=d+1;c>m&&"%"==f[m];++m);for(var v=d&&"!"==f[d-1]||c>m&&"1"==f[m]?"1":"N",g=d;m>g;++g)f[g]=v;d=m-1}}for(var d=0,h=l;c>d;++d){var r=f[d];"L"==h&&"1"==r?f[d]="L":a.test(r)&&(h=r)}for(var d=0;c>d;++d)if(i.test(f[d])){for(var m=d+1;c>m&&i.test(f[m]);++m);for(var y="L"==(d?f[d-1]:l),b="L"==(c>m?f[m]:l),v=y||b?"L":"R",g=d;m>g;++g)f[g]=v;d=m-1}for(var x,A=[],d=0;c>d;)if(s.test(f[d])){var w=d;for(++d;c>d&&s.test(f[d]);++d);A.push(new t(0,w,d))}else{var k=d,P=A.length;for(++d;c>d&&"L"!=f[d];++d);for(var g=k;d>g;)if(u.test(f[g])){g>k&&A.splice(P,0,new t(1,k,g));var C=g;for(++g;d>g&&u.test(f[g]);++g);A.splice(P,0,new t(2,C,g)),k=g}else++g;d>k&&A.splice(P,0,new t(1,k,d))}return 1==A[0].level&&(x=n.match(/^\s+/))&&(A[0].from=x[0].length,A.unshift(new t(0,0,x[0].length))),1==jo(A).level&&(x=n.match(/\s+$/))&&(jo(A).to-=x[0].length,A.push(new t(0,c-x[0].length,c))),2==A[0].level&&A.unshift(new t(1,A[0].to,A[0].to)),A[0].level!=jo(A).level&&A.push(new t(A[0].level,c,c)),A}}();return e.version="5.14.2",e})},function(e,t){"use strict";var n=function(e){var t;for(t in e)if(e.hasOwnProperty(t))return t;return null};e.exports=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return null==e||p["default"].isValidElement(e)}function i(e){return o(e)||Array.isArray(e)&&e.every(o)}function a(e,t,n){e=e||"UnknownComponent";for(var r in t)if(Object.prototype.hasOwnProperty.call(t,r)){var o=t[r](n,r,e);o instanceof Error}}function s(e,t){return f({},e,t)}function u(e){var t=e.type,n=s(t.defaultProps,e.props);if(t.propTypes&&a(t.displayName||t.name,t.propTypes,n),n.children){var r=l(n.children,n);r.length&&(n.childRoutes=r),delete n.children}return n}function l(e,t){var n=[];return p["default"].Children.forEach(e,function(e){if(p["default"].isValidElement(e))if(e.type.createRouteFromReactElement){var r=e.type.createRouteFromReactElement(e,t);r&&n.push(r)}else n.push(u(e))}),n}function c(e){return i(e)?e=l(e):e&&!Array.isArray(e)&&(e=[e]),e}t.__esModule=!0;var f=Object.assign||function(e){for(var t=1;t should not have a "'+t+'" prop'):void 0}t.__esModule=!0,t.falsy=r;var o=n(2),i=o.PropTypes.func,a=o.PropTypes.object,s=o.PropTypes.arrayOf,u=o.PropTypes.oneOfType,l=o.PropTypes.element,c=o.PropTypes.shape,f=o.PropTypes.string,d=c({listen:i.isRequired,push:i.isRequired,replace:i.isRequired,go:i.isRequired,goBack:i.isRequired,goForward:i.isRequired});t.history=d;var p=u([i,f]);t.component=p;var h=u([p,a]);t.components=h;var m=u([a,l]);t.route=m;var v=u([m,s(m)]);t.routes=v},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=e.match(/^https?:\/\/[^\/]*/);return null==t?e:e.substring(t[0].length)}function i(e){var t=o(e),n="",r="",i=t.indexOf("#");-1!==i&&(r=t.substring(i),t=t.substring(0,i));var a=t.indexOf("?");return-1!==a&&(n=t.substring(a),t=t.substring(0,a)),""===t&&(t="/"),{pathname:t,search:n,hash:r}}t.__esModule=!0,t.extractPath=o,t.parsePath=i;var a=n(14);r(a)},function(e,t,n){"use strict";function r(){o.attachRefs(this,this._currentElement)}var o=n(293),i={mountComponent:function(e,t,n,o){var i=e.mountComponent(t,n,o);return e._currentElement&&null!=e._currentElement.ref&&n.getReactMountReady().enqueue(r,e),i},unmountComponent:function(e){o.detachRefs(e,e._currentElement),e.unmountComponent()},receiveComponent:function(e,t,n,i){var a=e._currentElement;if(t!==a||i!==e._context){var s=o.shouldUpdateRefs(a,t);s&&o.detachRefs(e,a),e.receiveComponent(t,n,i),s&&e._currentElement&&null!=e._currentElement.ref&&n.getReactMountReady().enqueue(r,e)}},performUpdateIfNecessary:function(e,t){e.performUpdateIfNecessary(t)}};e.exports=i},function(e,t,n){"use strict";function r(e,t,n,r){this.dispatchConfig=e,this.dispatchMarker=t,this.nativeEvent=n;var o=this.constructor.Interface;for(var i in o)if(o.hasOwnProperty(i)){var s=o[i];s?this[i]=s(n):"target"===i?this.target=r:this[i]=n[i]}var u=null!=n.defaultPrevented?n.defaultPrevented:n.returnValue===!1;u?this.isDefaultPrevented=a.thatReturnsTrue:this.isDefaultPrevented=a.thatReturnsFalse,this.isPropagationStopped=a.thatReturnsFalse}var o=n(21),i=n(4),a=n(15),s=(n(3),{type:null,target:null,currentTarget:a.thatReturnsNull,eventPhase:null,bubbles:null,cancelable:null,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:null,isTrusted:null});i(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():e.returnValue=!1,this.isDefaultPrevented=a.thatReturnsTrue)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():e.cancelBubble=!0,this.isPropagationStopped=a.thatReturnsTrue)},persist:function(){this.isPersistent=a.thatReturnsTrue},isPersistent:a.thatReturnsFalse,destructor:function(){var e=this.constructor.Interface;for(var t in e)this[t]=null;this.dispatchConfig=null,this.dispatchMarker=null,this.nativeEvent=null}}),r.Interface=s,r.augmentClass=function(e,t){var n=this,r=Object.create(n.prototype);i(r,e.prototype),e.prototype=r,e.prototype.constructor=e,e.Interface=i({},n.Interface,t),e.augmentClass=n.augmentClass,o.addPoolingTo(e,o.fourArgumentPooler)},o.addPoolingTo(r,o.fourArgumentPooler),e.exports=r},function(e,t,n){"use strict";var r=n(1),o=function(e){var t,n={};e instanceof Object&&!Array.isArray(e)?void 0:r(!1);for(t in e)e.hasOwnProperty(t)&&(n[t]=t);return n};e.exports=o},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function i(e){for(var t="",n=[],r=[],i=void 0,a=0,s=/:([a-zA-Z_$][a-zA-Z0-9_$]*)|\*\*|\*|\(|\)/g;i=s.exec(e);)i.index!==a&&(r.push(e.slice(a,i.index)),t+=o(e.slice(a,i.index))),i[1]?(t+="([^/]+)",n.push(i[1])):"**"===i[0]?(t+="(.*)",n.push("splat")):"*"===i[0]?(t+="(.*?)",n.push("splat")):"("===i[0]?t+="(?:":")"===i[0]&&(t+=")?"),r.push(i[0]),a=s.lastIndex;return a!==e.length&&(r.push(e.slice(a,e.length)),t+=o(e.slice(a,e.length))),{pattern:e,regexpSource:t,paramNames:n,tokens:r}}function a(e){return e in p||(p[e]=i(e)),p[e]}function s(e,t){"/"!==e.charAt(0)&&(e="/"+e);var n=a(e),r=n.regexpSource,o=n.paramNames,i=n.tokens;"/"!==e.charAt(e.length-1)&&(r+="/?"),"*"===i[i.length-1]&&(r+="$");var s=t.match(new RegExp("^"+r,"i")),u=void 0,l=void 0;if(null!=s){var c=s[0];if(u=t.substr(c.length)){if("/"!==c.charAt(c.length-1))return{remainingPathname:null,paramNames:o,paramValues:null};u="/"+u}l=s.slice(1).map(function(e){return e&&decodeURIComponent(e)})}else u=l=null;return{remainingPathname:u,paramNames:o,paramValues:l}}function u(e){return a(e).paramNames}function l(e,t){var n=s(e,t),r=n.paramNames,o=n.paramValues;return null!=o?r.reduce(function(e,t,n){return e[t]=o[n],e},{}):null}function c(e,t){t=t||{};for(var n=a(e),r=n.tokens,o=0,i="",s=0,u=void 0,l=void 0,c=void 0,f=0,p=r.length;p>f;++f)u=r[f],"*"===u||"**"===u?(c=Array.isArray(t.splat)?t.splat[s++]:t.splat,null!=c||o>0?void 0:d["default"](!1),null!=c&&(i+=encodeURI(c))):"("===u?o+=1:")"===u?o-=1:":"===u.charAt(0)?(l=u.substring(1),c=t[l],null!=c||o>0?void 0:d["default"](!1),null!=c&&(i+=encodeURIComponent(c))):i+=u;return i.replace(/\/+/g,"/")}t.__esModule=!0,t.compilePattern=a,t.matchPattern=s,t.getParamNames=u,t.getParams=l,t.formatPattern=c;var f=n(10),d=r(f),p={}},function(e,t){"use strict";t.__esModule=!0;var n="PUSH";t.PUSH=n;var r="REPLACE";t.REPLACE=r;var o="POP";t.POP=o,t["default"]={PUSH:n,REPLACE:r,POP:o}},function(e,t,n){"use strict";function r(e,t){return(e&t)===t}var o=n(1),i={MUST_USE_ATTRIBUTE:1,MUST_USE_PROPERTY:2,HAS_SIDE_EFFECTS:4,HAS_BOOLEAN_VALUE:8,HAS_NUMERIC_VALUE:16,HAS_POSITIVE_NUMERIC_VALUE:48,HAS_OVERLOADED_BOOLEAN_VALUE:64,injectDOMPropertyConfig:function(e){var t=i,n=e.Properties||{},a=e.DOMAttributeNamespaces||{},u=e.DOMAttributeNames||{},l=e.DOMPropertyNames||{},c=e.DOMMutationMethods||{};e.isCustomAttribute&&s._isCustomAttributeFunctions.push(e.isCustomAttribute);for(var f in n){s.properties.hasOwnProperty(f)?o(!1):void 0;var d=f.toLowerCase(),p=n[f],h={attributeName:d,attributeNamespace:null,propertyName:f,mutationMethod:null,mustUseAttribute:r(p,t.MUST_USE_ATTRIBUTE),mustUseProperty:r(p,t.MUST_USE_PROPERTY),hasSideEffects:r(p,t.HAS_SIDE_EFFECTS),hasBooleanValue:r(p,t.HAS_BOOLEAN_VALUE),hasNumericValue:r(p,t.HAS_NUMERIC_VALUE),hasPositiveNumericValue:r(p,t.HAS_POSITIVE_NUMERIC_VALUE),hasOverloadedBooleanValue:r(p,t.HAS_OVERLOADED_BOOLEAN_VALUE)};if(h.mustUseAttribute&&h.mustUseProperty?o(!1):void 0,!h.mustUseProperty&&h.hasSideEffects?o(!1):void 0,h.hasBooleanValue+h.hasNumericValue+h.hasOverloadedBooleanValue<=1?void 0:o(!1),u.hasOwnProperty(f)){var m=u[f];h.attributeName=m}a.hasOwnProperty(f)&&(h.attributeNamespace=a[f]),l.hasOwnProperty(f)&&(h.propertyName=l[f]),c.hasOwnProperty(f)&&(h.mutationMethod=c[f]),s.properties[f]=h}}},a={},s={ID_ATTRIBUTE_NAME:"data-reactid",properties:{},getPossibleStandardName:null,_isCustomAttributeFunctions:[],isCustomAttribute:function(e){for(var t=0;t=a;a++)if(o(e,a)&&o(t,a))r=a;else if(e.charAt(a)!==t.charAt(a))break;var s=e.substr(0,r);return i(s)?void 0:d(!1),s}function c(e,t,n,r,o,i){e=e||"",t=t||"",e===t?d(!1):void 0;var l=a(t,e);l||a(e,t)?void 0:d(!1);for(var c=0,f=l?s:u,p=e;;p=f(p,t)){var h;if(o&&p===e||i&&p===t||(h=n(p,l,r)),h===!1||p===t)break;c++1){var t=e.indexOf(p,1);return t>-1?e.substr(0,t):e}return null},traverseEnterLeave:function(e,t,n,r,o){var i=l(e,t);i!==e&&c(e,i,n,r,!1,!0),i!==t&&c(i,t,n,o,!0,!1)},traverseTwoPhase:function(e,t,n){e&&(c("",e,t,n,!0,!1),c(e,"",t,n,!1,!0))},traverseTwoPhaseSkipTarget:function(e,t,n){e&&(c("",e,t,n,!0,!0),c(e,"",t,n,!0,!0))},traverseAncestors:function(e,t,n){c("",e,t,n,!0,!1)},getFirstCommonAncestorID:l,_getNextDescendantID:u,isAncestorIDOf:a,SEPARATOR:p};e.exports=v},function(e,t,n){"use strict";var r={};e.exports=r},function(e,t,n){"use strict";var r=n(112),o=n(271),i=n(125),a=n(134),s=n(135),u=n(1),l=(n(3),{}),c=null,f=function(e,t){e&&(o.executeDispatchesInOrder(e,t),e.isPersistent()||e.constructor.release(e))},d=function(e){return f(e,!0)},p=function(e){return f(e,!1)},h=null,m={injection:{injectMount:o.injection.injectMount,injectInstanceHandle:function(e){h=e},getInstanceHandle:function(){return h},injectEventPluginOrder:r.injectEventPluginOrder,injectEventPluginsByName:r.injectEventPluginsByName},eventNameDispatchConfigs:r.eventNameDispatchConfigs,registrationNameModules:r.registrationNameModules,putListener:function(e,t,n){"function"!=typeof n?u(!1):void 0;var o=l[t]||(l[t]={});o[e]=n;var i=r.registrationNameModules[t];i&&i.didPutListener&&i.didPutListener(e,t,n)},getListener:function(e,t){var n=l[t];return n&&n[e]},deleteListener:function(e,t){var n=r.registrationNameModules[t];n&&n.willDeleteListener&&n.willDeleteListener(e,t);var o=l[t];o&&delete o[e]},deleteAllListeners:function(e){for(var t in l)if(l[t][e]){var n=r.registrationNameModules[t];n&&n.willDeleteListener&&n.willDeleteListener(e,t),delete l[t][e]}},extractEvents:function(e,t,n,o,i){for(var s,u=r.plugins,l=0;l=200&&e.status<300)return e;401===e.status&&u["default"].logout();var n=void 0;try{n=JSON.parse(e)}catch(r){n={error:e.statusText}}n.statusCode=e.status,n.response=e,t(n)}).then(function(e){return e.json()}).then(function(t){e(t)})["catch"](function(){t({error:"Unknown error"})})})},this.post=function(e,n){return t.fetch(e,"POST",n)},this.put=function(e,n){return t.fetch(e,"PUT",n)},this.get=function(e,n){return t.fetch(e,"GET",n)},this["delete"]=function(e,n){return t.fetch(e,"DELETE",n)},this.constructQueryString=function(e){return a["default"].map(e,function(e,t){return encodeURIComponent(t)+"="+encodeURIComponent(e)}).join("&")},this.baseUrl=n.baseUrl||c["default"].API_BASE_URL,this.userAgent=n.userAgent||c["default"].API_USER_AGENT};t["default"]=f;var d=new f;t.client=d}).call(t,n(89))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0,t.connect=t.Provider=void 0;var o=n(235),i=r(o),a=n(236),s=r(a);t.Provider=i["default"],t.connect=s["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t1?r-1:0),i=1;r>i;i++)o[i-1]=arguments[i];var a=x.createLocation.apply(x,[n(e,e.query)].concat(o));return e.query&&(a.query=e.query),t(a)}function g(e,t,n){"string"==typeof t&&(t=f.parsePath(t)),s(a({state:e},t,{query:n}))}function y(e,t,n){"string"==typeof t&&(t=f.parsePath(t)),u(a({state:e},t,{query:n}))}var b=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],x=e(b),A=b.stringifyQuery,w=b.parseQueryString;return"function"!=typeof A&&(A=o),"function"!=typeof w&&(w=m),a({},x,{listenBefore:r,listen:i,push:s,replace:u,createPath:l,createHref:d,createLocation:v,pushState:p["default"](g,"pushState is deprecated; use push instead"),replaceState:p["default"](y,"replaceState is deprecated; use replace instead")})}}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t":">","<":"<",'"':""","'":"'"},i=/[&><"']/g;e.exports=r},function(e,t,n){"use strict";var r=n(6),o=/^[ \r\n\t\f]/,i=/<(!--|link|noscript|meta|script|style)[ \r\n\t\f\/>]/,a=function(e,t){e.innerHTML=t};if("undefined"!=typeof MSApp&&MSApp.execUnsafeLocalFunction&&(a=function(e,t){MSApp.execUnsafeLocalFunction(function(){e.innerHTML=t})}),r.canUseDOM){var s=document.createElement("div");s.innerHTML=" ",""===s.innerHTML&&(a=function(e,t){if(e.parentNode&&e.parentNode.replaceChild(e,e),o.test(t)||"<"===t[0]&&i.test(t)){e.innerHTML=String.fromCharCode(65279)+t;var n=e.firstChild;1===n.data.length?e.removeChild(n):n.deleteData(0,1)}else e.innerHTML=t})}e.exports=a},function(e,t){e.exports=function(e){return e.webpackPolyfill||(e.deprecate=function(){},e.paths=[],e.children=[],e.webpackPolyfill=1),e}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(26),i=r(o),a=n(213),s=(0,i["default"])({JWT_STORE_KEY:null}),u={API_USER_AGENT:a.name+"/"+a.version,API_BASE_URL:"http://localhost:3000/api"};t["default"]=Object.assign(s,u)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(53),i=r(o),a=n(81),s=r(a),u=n(38);t["default"]={login:function(e,t){var n=this;return new Promise(function(r,o){u.client.post("/authenticate",{email:e,password:t}).then(function(e){localStorage.setItem(i["default"].JWT_STORE_KEY,e.jwt_token),n.onChange(!0),r(e)})["catch"](function(e){o(e)})})},getToken:function(){return localStorage.getItem(i["default"].JWT_STORE_KEY)},logout:function(){localStorage.removeItem(i["default"].JWT_STORE_KEY),s["default"].push(i["default"].LOGIN_PATH),this.onChange(!1)},loggedIn:function(){return!!localStorage.getItem(i["default"].JWT_STORE_KEY)},onChange:function(){}}},function(e,t,n){function r(e){if(!a(e)||d.call(e)!=s||i(e))return!1;var t=o(e);if(null===t)return!0;var n=c.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&l.call(n)==f}var o=n(222),i=n(223),a=n(224),s="[object Object]",u=Object.prototype,l=Function.prototype.toString,c=u.hasOwnProperty,f=l.call(Object),d=u.toString;e.exports=r},function(e,t){"use strict";function n(e,t,n){function r(){return s=!0,u?void(c=[].concat(o.call(arguments))):void n.apply(this,arguments)}function i(){if(!s&&(l=!0,!u)){for(u=!0;!s&&e>a&&l;)l=!1,t.call(this,a++,i,r);return u=!1,s?void n.apply(this,c):void(a>=e&&l&&(s=!0,n()))}}var a=0,s=!1,u=!1,l=!1,c=void 0;i()}function r(e,t,n){function r(e,t,r){a||(t?(a=!0,n(t)):(i[e]=r,a=++s===o,a&&n(null,i)))}var o=e.length,i=[];if(0===o)return n(null,i);var a=!1,s=0;e.forEach(function(e,n){t(e,n,function(e,t){r(n,e,t)})})}t.__esModule=!0;var o=Array.prototype.slice;t.loopAsync=n,t.mapAsync=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!0;return!1}function i(e,t){function n(t){var n=arguments.length<=1||void 0===arguments[1]?!1:arguments[1],r=arguments.length<=2||void 0===arguments[2]?null:arguments[2],o=void 0;return n&&n!==!0||null!==r?(t={pathname:t,query:n},o=r||!1):(t=e.createLocation(t),o=n),p["default"](t,o,A.location,A.routes,A.params)}function r(t){return e.createLocation(t,u.REPLACE)}function i(e,n){w&&w.location===e?s(w,n):g["default"](t,e,function(t,r){t?n(t):r?s(a({},r,{location:e}),n):n()})}function s(e,t){function n(n,r){return n||r?o(n,r):void m["default"](e,function(n,r){n?t(n):t(null,null,A=a({},e,{components:r}))})}function o(e,n){e?t(e):t(null,r(n))}var i=c["default"](A,e),s=i.leaveRoutes,u=i.changeRoutes,l=i.enterRoutes;f.runLeaveHooks(s),s.filter(function(e){return-1===l.indexOf(e)}).forEach(y),f.runChangeHooks(u,A,e,function(t,r){return t||r?o(t,r):void f.runEnterHooks(l,e,n)})}function l(e){var t=arguments.length<=1||void 0===arguments[1]?!0:arguments[1];return e.__id__||t&&(e.__id__=k++)}function d(e){return e.reduce(function(e,t){return e.push.apply(e,P[l(t)]),e},[])}function h(e,n){g["default"](t,e,function(t,r){if(null==r)return void n();w=a({},r,{location:e});for(var o=d(c["default"](A,w).leaveRoutes),i=void 0,s=0,u=o.length;null==i&&u>s;++s)i=o[s](e);n(i)})}function v(){if(A.routes){for(var e=d(A.routes),t=void 0,n=0,r=e.length;"string"!=typeof t&&r>n;++n)t=e[n]();return t}}function y(e){var t=l(e,!1);t&&(delete P[t],o(P)||(C&&(C(),C=null),T&&(T(),T=null)))}function b(t,n){var r=l(t),i=P[r];if(i)-1===i.indexOf(n)&&i.push(n);else{var a=!o(P);P[r]=[n],a&&(C=e.listenBefore(h),e.listenBeforeUnload&&(T=e.listenBeforeUnload(v)))}return function(){var e=P[r];if(e){var o=e.filter(function(e){return e!==n});0===o.length?y(t):P[r]=o}}}function x(t){return e.listen(function(n){A.location===n?t(null,A):i(n,function(n,r,o){n?t(n):r?e.transitionTo(r):o&&t(null,o)})})}var A={},w=void 0,k=1,P=Object.create(null),C=void 0,T=void 0;return{isActive:n,match:i,listenBeforeLeavingRoute:b,listen:x}}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;tt||e.hasOverloadedBooleanValue&&t===!1}var i=n(29),a=n(12),s=n(316),u=(n(3),/^[a-zA-Z_][\w\.\-]*$/),l={},c={},f={createMarkupForID:function(e){return i.ID_ATTRIBUTE_NAME+"="+s(e)},setAttributeForID:function(e,t){e.setAttribute(i.ID_ATTRIBUTE_NAME,t)},createMarkupForProperty:function(e,t){var n=i.properties.hasOwnProperty(e)?i.properties[e]:null;if(n){if(o(n,t))return"";var r=n.attributeName;return n.hasBooleanValue||n.hasOverloadedBooleanValue&&t===!0?r+'=""':r+"="+s(t)}return i.isCustomAttribute(e)?null==t?"":e+"="+s(t):null},createMarkupForCustomAttribute:function(e,t){return r(e)&&null!=t?e+"="+s(t):""},setValueForProperty:function(e,t,n){var r=i.properties.hasOwnProperty(t)?i.properties[t]:null;if(r){var a=r.mutationMethod;if(a)a(e,n);else if(o(r,n))this.deleteValueForProperty(e,t);else if(r.mustUseAttribute){var s=r.attributeName,u=r.attributeNamespace;u?e.setAttributeNS(u,s,""+n):r.hasBooleanValue||r.hasOverloadedBooleanValue&&n===!0?e.setAttribute(s,""):e.setAttribute(s,""+n)}else{var l=r.propertyName;r.hasSideEffects&&""+e[l]==""+n||(e[l]=n)}}else i.isCustomAttribute(t)&&f.setValueForAttribute(e,t,n)},setValueForAttribute:function(e,t,n){r(t)&&(null==n?e.removeAttribute(t):e.setAttribute(t,""+n))},deleteValueForProperty:function(e,t){var n=i.properties.hasOwnProperty(t)?i.properties[t]:null;if(n){var r=n.mutationMethod;if(r)r(e,void 0);else if(n.mustUseAttribute)e.removeAttribute(n.attributeName);else{var o=n.propertyName,a=i.getDefaultValueForProperty(e.nodeName,o);n.hasSideEffects&&""+e[o]===a||(e[o]=a)}}else i.isCustomAttribute(t)&&e.removeAttribute(t)}};a.measureMethods(f,"DOMPropertyOperations",{setValueForProperty:"setValueForProperty",setValueForAttribute:"setValueForAttribute",deleteValueForProperty:"deleteValueForProperty"}),e.exports=f},function(e,t,n){"use strict";function r(e){null!=e.checkedLink&&null!=e.valueLink?l(!1):void 0}function o(e){r(e),null!=e.value||null!=e.onChange?l(!1):void 0}function i(e){r(e),null!=e.checked||null!=e.onChange?l(!1):void 0}function a(e){if(e){var t=e.getName();if(t)return" Check the render method of `"+t+"`."}return""}var s=n(131),u=n(46),l=n(1),c=(n(3),{button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0}),f={value:function(e,t,n){return!e[t]||c[e.type]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`.")},checked:function(e,t,n){return!e[t]||e.onChange||e.readOnly||e.disabled?null:new Error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")},onChange:s.func},d={},p={checkPropTypes:function(e,t,n){for(var r in f){if(f.hasOwnProperty(r))var o=f[r](t,r,e,u.prop);if(o instanceof Error&&!(o.message in d)){d[o.message]=!0;a(n)}}},getValue:function(e){return e.valueLink?(o(e),e.valueLink.value):e.value},getChecked:function(e){return e.checkedLink?(i(e),e.checkedLink.value):e.checked},executeOnChange:function(e,t){return e.valueLink?(o(e),e.valueLink.requestChange(t.target.value)):e.checkedLink?(i(e),e.checkedLink.requestChange(t.target.checked)):e.onChange?e.onChange.call(void 0,t):void 0}};e.exports=p},function(e,t,n){"use strict";var r=n(66),o=n(8),i={processChildrenUpdates:r.dangerouslyProcessChildrenUpdates,replaceNodeWithMarkupByID:r.dangerouslyReplaceNodeWithMarkupByID,unmountIDFromEnvironment:function(e){o.purgeID(e)}};e.exports=i},function(e,t,n){"use strict";var r=n(1),o=!1,i={unmountIDFromEnvironment:null,replaceNodeWithMarkupByID:null,processChildrenUpdates:null,injection:{injectEnvironment:function(e){o?r(!1):void 0,i.unmountIDFromEnvironment=e.unmountIDFromEnvironment,i.replaceNodeWithMarkupByID=e.replaceNodeWithMarkupByID,i.processChildrenUpdates=e.processChildrenUpdates,o=!0}}};e.exports=i},function(e,t,n){"use strict";var r=n(111),o=n(62),i=n(8),a=n(12),s=n(1),u={dangerouslySetInnerHTML:"`dangerouslySetInnerHTML` must be set using `updateInnerHTMLByID()`.",style:"`style` must be set using `updateStylesByID()`."},l={updatePropertyByID:function(e,t,n){var r=i.getNode(e);u.hasOwnProperty(t)?s(!1):void 0,null!=n?o.setValueForProperty(r,t,n):o.deleteValueForProperty(r,t)},dangerouslyReplaceNodeWithMarkupByID:function(e,t){var n=i.getNode(e);r.dangerouslyReplaceNodeWithMarkup(n,t)},dangerouslyProcessChildrenUpdates:function(e,t){for(var n=0;n=32||13===t?t:0}e.exports=n},function(e,t){"use strict";function n(e){var t=this,n=t.nativeEvent;if(n.getModifierState)return n.getModifierState(e);var r=o[e];return r?!!n[r]:!1}function r(e){return n}var o={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};e.exports=r},function(e,t){"use strict";function n(e){var t=e.target||e.srcElement||window;return 3===t.nodeType?t.parentNode:t}e.exports=n},function(e,t){"use strict";function n(e){var t=e&&(r&&e[r]||e[o]);return"function"==typeof t?t:void 0}var r="function"==typeof Symbol&&Symbol.iterator,o="@@iterator";e.exports=n},function(e,t,n){"use strict";function r(e){return"function"==typeof e&&"undefined"!=typeof e.prototype&&"function"==typeof e.prototype.mountComponent&&"function"==typeof e.prototype.receiveComponent}function o(e){var t;if(null===e||e===!1)t=new a(o);else if("object"==typeof e){var n=e;!n||"function"!=typeof n.type&&"string"!=typeof n.type?l(!1):void 0,t="string"==typeof n.type?s.createInternalComponent(n):r(n.type)?new n.type(n):new c}else"string"==typeof e||"number"==typeof e?t=s.createInstanceForText(e):l(!1);return t.construct(e),t._mountIndex=0,t._mountImage=null,t}var i=n(277),a=n(123),s=n(129),u=n(4),l=n(1),c=(n(3),function(){});u(c.prototype,i.Mixin,{_instantiateReactComponent:o}),e.exports=o},function(e,t,n){"use strict";/** * Checks if an event is supported in the current execution environment. * * NOTE: This will not work correctly for non-generic events such as `change`, @@ -18,33 +18,35 @@ g.ReactEventListener.trapCapturedEvent(u.topBlur,"blur",n)):f("focusin")&&(g.Rea * @internal * @license Modernizr 3.0.0pre (Custom Build) | MIT */ -function r(e,t){if(!o.canUseDOM||t&&!("addEventListener"in document))return!1;var n="on"+e,r=n in document;if(!r){var a=document.createElement("div");a.setAttribute(n,"return;"),r="function"==typeof a[n]}return!r&&i&&"wheel"===e&&(r=document.implementation.hasFeature("Events.wheel","3.0")),r}var i,o=n(5);o.canUseDOM&&(i=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0),e.exports=r},function(e,t,n){"use strict";var r=n(5),i=n(46),o=n(47),a=function(e,t){e.textContent=t};r.canUseDOM&&("textContent"in document.documentElement||(a=function(e,t){o(e,i(t))})),e.exports=a},function(e,t){"use strict";function n(e,t){var n=null===e||e===!1,r=null===t||t===!1;if(n||r)return n===r;var i=typeof e,o=typeof t;return"string"===i||"number"===i?"string"===o||"number"===o:"object"===o&&e.type===t.type&&e.key===t.key}e.exports=n},function(e,t,n){"use strict";function r(e){return m[e]}function i(e,t){return e&&null!=e.key?a(e.key):t.toString(36)}function o(e){return(""+e).replace(v,r)}function a(e){return"$"+o(e)}function s(e,t,n,r){var o=typeof e;if(("undefined"===o||"boolean"===o)&&(e=null),null===e||"string"===o||"number"===o||l.isValidElement(e))return n(r,e,""===t?p+i(e,0):t),1;var u,c,m=0,v=""===t?p:t+h;if(Array.isArray(e))for(var g=0;g":a.innerHTML="<"+e+">",s[e]=!a.firstChild),s[e]?d[e]:null}var i=n(5),o=n(1),a=i.canUseDOM?document.createElement("div"):null,s={},u=[1,'"],l=[1,"","
"],c=[3,"","
"],f=[1,'',""],d={"*":[1,"?
","
"],area:[1,"",""],col:[2,"","
"],legend:[1,"
","
"],param:[1,"",""],tr:[2,"","
"],optgroup:u,option:u,caption:l,colgroup:l,tbody:l,tfoot:l,thead:l,td:c,th:c},p=["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"];p.forEach(function(e){d[e]=f,s[e]=!0}),e.exports=r},function(e,t){"use strict";function n(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),i=Object.keys(t);if(n.length!==i.length)return!1;for(var o=r.bind(t),a=0;a-1&&e%1==0&&c>=e}function u(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function l(e){return!!e&&"object"==typeof e}var c=9007199254740991,f="[object Arguments]",d="[object Function]",p="[object GeneratorFunction]",h=Object.prototype,m=h.hasOwnProperty,v=h.toString,g=h.propertyIsEnumerable,y=n("length");e.exports=r},function(e,t){function n(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=n},function(e,t,n){var r;(function(e,i){(function(){function o(e,t){return e.set(t[0],t[1]),e}function a(e,t){return e.add(t),e}function s(e,t,n){var r=n.length;switch(r){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function u(e,t,n,r){for(var i=-1,o=e.length;++i-1}function m(e,t,n){for(var r=-1,i=e.length;++r-1;);return n}function R(e,t){for(var n=e.length;n--&&P(t,e[n],0)>-1;);return n}function j(e){return e&&e.Object===Object?e:null}function D(e,t){if(e!==t){var n=null===e,r=e===Q,i=e===e,o=null===t,a=t===Q,s=t===t;if(e>t&&!o||!i||n&&!a&&s||r&&s)return 1;if(t>e&&!n||!s||o&&!r&&i||a&&i)return-1}return 0}function I(e,t,n){for(var r=-1,i=e.criteria,o=t.criteria,a=i.length,s=n.length;++r=s)return u;var l=n[r];return u*("desc"==l?-1:1)}}return e.index-t.index}function z(e){return wn[e]}function H(e){return kn[e]}function W(e){return"\\"+Tn[e]}function F(e,t,n){for(var r=e.length,i=t+(n?0:-1);n?i--:++i-1&&e%1==0&&t>e}function U(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function V(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function B(e,t){for(var n=-1,r=e.length,i=-1,o=[];++nt,i=n?e.length:0,o=fi(0,i,this.__views__),a=o.start,s=o.end,u=s-a,l=r?s:a-1,c=this.__iteratees__,f=c.length,d=0,p=ll(u,this.__takeCount__);if(!n||me>i||i==u&&p==u)return wr(e,this.__actions__);var h=[];e:for(;u--&&p>d;){l+=t;for(var m=-1,v=e[l];++mn)return!1;var r=e.length-1;return n==r?e.pop():nl.call(e,n,1),!0}function $t(e,t){var n=tn(e,t);return 0>n?Q:e[n][1]}function en(e,t){return tn(e,t)>-1}function tn(e,t){for(var n=e.length;n--;)if(ma(e[n][0],t))return n;return-1}function nn(e,t,n){var r=tn(e,t);0>r?e.push([t,n]):e[r][1]=n}function rn(e,t,n,r){return e===Q||ma(e,zu[n])&&!Wu.call(r,n)?t:e}function on(e,t,n){(n!==Q&&!ma(e[t],n)||"number"==typeof t&&n===Q&&!(t in e))&&(e[t]=n)}function an(e,t,n){var r=e[t];(!ma(r,n)||ma(r,zu[t])&&!Wu.call(e,t)||n===Q&&!(t in e))&&(e[t]=n)}function sn(e,t,n,r){return Tl(e,function(e,i,o){t(r,e,n(e),o)}),r}function un(e,t){return e&&Dr(t,xs(t),e)}function ln(e,t){for(var n=-1,r=null==e,i=t.length,o=Array(i);++n=e?e:n),t!==Q&&(e=e>=t?e:t)),e}function fn(e,t,n,r,i,o){var a;if(n&&(a=i?n(e,r,i,o):n(e)),a!==Q)return a;if(!Ra(e))return e;var s=vc(e);if(s){if(a=pi(e),!t)return jr(e,a)}else{var u=ci(e),l=u==je||u==De;if(gc(e))return Cr(e,t);if(u!=He&&u!=Ne&&(!l||i))return An[u]?mi(e,u,t):i?e:{};if(q(e))return i?e:{};if(a=hi(l?{}:e),!t)return zr(e,un(a,e))}o||(o=new Zt);var f=o.get(e);return f?f:(o.set(e,a),(s?c:On)(e,function(r,i){an(a,i,fn(r,t,n,i,e,o))}),s?a:zr(e,a))}function pn(e){var t=xs(e),n=t.length;return function(r){if(null==r)return!n;for(var i=n;i--;){var o=t[i],a=e[o],s=r[o];if(s===Q&&!(o in Object(r))||!a(s))return!1}return!0}}function wn(e,t,n){if("function"!=typeof e)throw new Du(be);return tl(function(){e.apply(Q,n)},t)}function kn(e,t,n,r){var i=-1,o=h,a=!0,s=e.length,u=[],l=t.length;if(!s)return u;n&&(t=v(t,M(n))),r?(o=m,a=!1):t.length>=me&&(o=Vt,a=!1,t=new Ut(t));e:for(;++in&&(n=-n>i?0:i+n),r=r===Q||r>i?i:ns(r),0>r&&(r+=i),r=n>r?0:rs(r);r>n;)e[n++]=t;return e}function Tn(e,t){var n=[];return Tl(e,function(e,r,i){t(e,r,i)&&n.push(e)}),n}function Nn(e,t,n,r){r||(r=[]);for(var i=-1,o=e.length;++in;)e=e[t[n++]];return n&&n==r?e:Q}function Hn(e,t){return Wu.call(e,t)||"object"==typeof e&&t in e&&null===Qu(e)}function Wn(e,t){return t in Object(e)}function Fn(e,t,n){return e>=ll(t,n)&&e=120)?new Ut(o&&u):Q}u=e[0];var l=-1,c=u.length,f=a[0];e:for(;++l-1;)o!==e&&nl.call(o,a,1),nl.call(e,a,1);return e}function ur(e,t){for(var n=e?t.length:0,r=n-1;n--;){var i=t[n];if(r==n||i!=o){var o=i;if(X(i))nl.call(e,i,1);else if(yi(i,e))delete e[i];else{var a=yr(i),s=Ci(e,a);null!=s&&delete s[Gi(a)]}}}return e}function lr(e,t){return e+il(fl()*(t-e+1))}function cr(e,t,n,r){for(var i=-1,o=ul(rl((t-e)/(n||1)),0),a=Array(o);o--;)a[r?o:++i]=e,e+=n;return a}function fr(e,t,n,r){t=yi(t,e)?[t+""]:yr(t);for(var i=-1,o=t.length,a=o-1,s=e;null!=s&&++it&&(t=-t>i?0:i+t),n=n>i?i:n,0>n&&(n+=i),i=t>n?0:n-t>>>0,t>>>=0;for(var o=Array(i);++r=i){for(;i>r;){var o=r+i>>>1,a=e[o];(n?t>=a:t>a)&&null!==a?r=o+1:i=o}return i}return mr(e,t,lu,n)}function mr(e,t,n,r){t=n(t);for(var i=0,o=e?e.length:0,a=t!==t,s=null===t,u=t===Q;o>i;){var l=il((i+o)/2),c=n(e[l]),f=c!==Q,d=c===c;if(a)var p=d||r;else p=s?d&&f&&(r||null!=c):u?d&&(r||f):null==c?!1:r?t>=c:t>c;p?i=l+1:o=l}return ll(o,Te)}function vr(e){return gr(e)}function gr(e,t){for(var n=0,r=e.length,i=e[0],o=t?t(i):i,a=o,s=0,u=[i];++n=me){var l=t?null:Ol(e);if(l)return Z(l);a=!1,i=Vt,u=new Ut}else u=t?[]:s;e:for(;++rr?t[r]:Q);return a}function Cr(e,t){if(t)return e.slice();var n=e.constructor,r=new n(e.length);return e.copy(r),r}function Tr(e){var t=e.constructor,n=new t(e.byteLength),r=new Ju(n);return r.set(new Ju(e)),n}function Er(e){var t=e.constructor;return y(V(e),o,new t)}function Sr(e){var t=e.constructor,n=new t(e.source,At.exec(e));return n.lastIndex=e.lastIndex,n}function Nr(e){var t=e.constructor;return y(Z(e),a,new t)}function Mr(e){return Gu?Object(wl.call(e)):{}}function Or(e,t){var n=e.buffer,r=e.constructor;return new r(t?Tr(n):n,e.byteOffset,e.length)}function Lr(e,t,n){for(var r=n.length,i=-1,o=ul(e.length-r,0),a=-1,s=t.length,u=Array(s+o);++a1?n[i-1]:Q,a=i>2?n[2]:Q;for(o="function"==typeof o?(i--,o):Q,a&&gi(n[0],n[1],a)&&(o=3>i?Q:o,i=1),t=Object(t);++ra&&l[0]!==f&&l[a-1]!==f?[]:B(l,f);return a-=d.length,r>a?ei(e,n,Jr,f,Q,l,d,Q,Q,r-a):s(c,this,l)}var o=Br(e);return i}function Gr(e){return aa(function(t){t=Nn(t);var n=t.length,i=n,o=r.prototype.thru;for(e&&t.reverse();i--;){var a=t[i];if("function"!=typeof a)throw new Du(be);if(o&&!s&&"wrapper"==ai(a))var s=new r([],!0)}for(i=s?i:n;++i=me)return s.plant(r).value();for(var i=0,o=n?t[i].apply(this,e):r;++ib)return ei(e,n,Jr,w,r,A,k,u,l,c-b)}var P=p?r:this,C=h?P[e]:e;return u?A=Ti(A,u):g&&A.length>1&&A.reverse(),d&&l=t)return"";var i=t-r;n=n===Q?" ":n+"";var o=Gs(n,rl(i/G(n)));return hn.test(n)?J(o).slice(0,i).join(""):o.slice(0,i)}function _r(e,t,n,r){function i(){for(var t=-1,u=arguments.length,l=-1,c=r.length,f=Array(c+u),d=this&&this!==In&&this instanceof i?a:e;++lt?1:-1:is(r)||0,cr(t,n,r,e)}}function ei(e,t,n,r,i,o,a,s,u,l){var c=t&ne,f=s?jr(s):Q,d=c?a:Q,p=c?Q:a,h=c?o:Q,m=c?Q:o;t|=c?ie:oe,t&=~(c?oe:ie),t&te||(t&=~($|ee));var v=[e,t,i,h,d,m,p,f,u,l],g=n.apply(Q,v);return xi(e)&&Dl(g,v),g.placeholder=r,g}function ti(e){var t=Ru[e];return function(e,n){if(e=is(e),n=ns(n)){var r=(ss(e)+"e").split("e"),i=t(r[0]+"e"+(+r[1]+n));return r=(ss(i)+"e").split("e"),+(r[0]+"e"+(+r[1]-n))}return t(e)}}function ni(e,t,n,r,i,o,a,s){var u=tⅇif(!u&&"function"!=typeof e)throw new Du(be);var l=r?r.length:0;if(l||(t&=~(ie|oe),r=i=Q),a=a===Q?a:ul(ns(a),0),s=s===Q?s:ns(s),l-=i?i.length:0,t&oe){var c=r,f=i;r=i=Q}var d=u?Q:Ll(e),p=[e,t,n,r,i,c,f,o,a,s];if(d&&ki(p,d),e=p[0],t=p[1],n=p[2],r=p[3],i=p[4],s=p[9]=null==p[9]?u?0:e.length:ul(p[9]-l,0),!s&&t&(ne|re)&&(t&=~(ne|re)),t&&t!=$)h=t==ne||t==re?Zr(e,t,s):t!=ie&&t!=($|ie)||i.length?Jr.apply(Q,p):_r(e,t,n,r);else var h=Xr(e,t,n);var m=d?Ml:Dl;return m(h,p)}function ri(e,t,n,r,i,o){var a=-1,s=i&ce,u=i&le,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var f=o.get(e);if(f)return f==t;var d=!0;for(o.set(e,t);++ai,a=r==ae&&n==ne||r==ae&&n==se&&e[7].length<=t[8]||r==(ae|se)&&t[7].length<=t[8]&&n==ne;if(!o&&!a)return e;r&$&&(e[2]=t[2],i|=n&$?0:te);var s=t[3];if(s){var u=e[3];e[3]=u?Lr(u,s,t[4]):jr(s),e[4]=u?B(e[3],Se):jr(t[4])}return s=t[5],s&&(u=e[5],e[5]=u?Rr(u,s,t[6]):jr(s),e[6]=u?B(e[5],Se):jr(t[6])),s=t[7],s&&(e[7]=jr(s)),r&ae&&(e[8]=null==e[8]?t[8]:ll(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=i,e}function Pi(e,t,n,r,i,o){return Ra(e)&&Ra(t)&&(o.set(t,e),$n(e,t,Q,Pi,o)),e}function Ci(e,t){return 1==t.length?e:gs(e,dr(t,0,-1))}function Ti(e,t){for(var n=e.length,r=ll(t.length,n),i=jr(e);r--;){var o=t[r];e[r]=X(o,n)?i[o]:Q}return e}function Ei(e){var t=[];return ss(e).replace(pt,function(e,n,r,i){t.push(r?i.replace(bt,"$1"):n||e)}),t}function Si(e){return Aa(e)?e:[]}function Ni(e){return"function"==typeof e?e:lu}function Mi(e){if(e instanceof i)return e.clone();var t=new r(e.__wrapped__,e.__chain__);return t.__actions__=jr(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function Oi(e,t){t=ul(ns(t),0);var n=e?e.length:0;if(!n||1>t)return[];for(var r=0,i=-1,o=Array(rl(n/t));n>r;)o[++i]=dr(e,r,r+=t);return o}function Li(e){for(var t=-1,n=e?e.length:0,r=-1,i=[];++tt?0:t,r)):[]}function ji(e,t,n){var r=e?e.length:0;return r?(t=n||t===Q?1:ns(t),t=r-t,dr(e,0,0>t?0:t)):[]}function Di(e,t){return e&&e.length?Ar(e,si(t,3),!0,!0):[]}function Ii(e,t){return e&&e.length?Ar(e,si(t,3),!0):[]}function zi(e,t,n,r){var i=e?e.length:0;return i?(n&&"number"!=typeof n&&gi(e,t,n)&&(n=0,r=i),Cn(e,t,n,r)):[]}function Hi(e,t){return e&&e.length?k(e,si(t,3)):-1}function Wi(e,t){return e&&e.length?k(e,si(t,3),!0):-1}function Fi(e){var t=e?e.length:0;return t?Nn(e):[]}function qi(e){var t=e?e.length:0;return t?Nn(e,!0):[]}function Xi(e){for(var t=-1,n=e?e.length:0,r={};++tn&&(n=ul(r+n,0)), -P(e,t,n)):-1}function Bi(e){return ji(e,1)}function Zi(e,t){return e?al.call(e,t):""}function Gi(e){var t=e?e.length:0;return t?e[t-1]:Q}function Ji(e,t,n){var r=e?e.length:0;if(!r)return-1;var i=r;if(n!==Q&&(i=ns(n),i=(0>i?ul(r+i,0):ll(i,r-1))+1),t!==t)return F(e,i,!0);for(;i--;)if(e[i]===t)return i;return-1}function Ki(e,t){return e&&e.length&&t&&t.length?ar(e,t):e}function Yi(e,t,n){return e&&e.length&&t&&t.length?sr(e,t,si(n)):e}function Qi(e,t){var n=[];if(!e||!e.length)return n;var r=-1,i=[],o=e.length;for(t=si(t,3);++rr&&ma(e[r],t))return r}return-1}function ro(e,t){return hr(e,t,!0)}function io(e,t,n){return mr(e,t,si(n),!0)}function oo(e,t){var n=e?e.length:0;if(n){var r=hr(e,t,!0)-1;if(ma(e[r],t))return r}return-1}function ao(e){return e&&e.length?vr(e):[]}function so(e,t){return e&&e.length?gr(e,si(t)):[]}function uo(e){return Ri(e,1)}function lo(e,t,n){return e&&e.length?(t=n||t===Q?1:ns(t),dr(e,0,0>t?0:t)):[]}function co(e,t,n){var r=e?e.length:0;return r?(t=n||t===Q?1:ns(t),t=r-t,dr(e,0>t?0:t,r)):[]}function fo(e,t){return e&&e.length?Ar(e,si(t,3),!1,!0):[]}function po(e,t){return e&&e.length?Ar(e,si(t,3)):[]}function ho(e){return e&&e.length?br(e):[]}function mo(e,t){return e&&e.length?br(e,si(t)):[]}function vo(e,t){return e&&e.length?br(e,Q,t):[]}function go(e){if(!e||!e.length)return[];var t=0;return e=p(e,function(e){return Aa(e)?(t=ul(e.length,t),!0):void 0}),S(t,function(t){return v(e,ir(t))})}function yo(e,t){if(!e||!e.length)return[];var n=go(e);return null==t?n:v(n,function(e){return s(t,Q,e)})}function bo(e,t){return Pr(e||[],t||[],an)}function xo(e,t){return Pr(e||[],t||[],fr)}function Ao(e){var n=t(e);return n.__chain__=!0,n}function wo(e,t){return t(e),e}function ko(e,t){return t(e)}function Po(){return Ao(this)}function Co(){return new r(this.value(),this.__chain__)}function To(e){return this.map(e).flatten()}function Eo(){this.__values__===Q&&(this.__values__=ts(this.value()));var e=this.__index__>=this.__values__.length,t=e?Q:this.__values__[this.__index__++];return{done:e,value:t}}function So(){return this}function No(e){for(var t,r=this;r instanceof n;){var i=Mi(r);i.__index__=0,i.__values__=Q,t?o.__wrapped__=i:t=i;var o=i;r=r.__wrapped__}return o.__wrapped__=e,t}function Mo(){var e=this.__wrapped__;if(e instanceof i){var t=e;return this.__actions__.length&&(t=new i(this)),t=t.reverse(),t.__actions__.push({func:ko,args:[_i],thisArg:Q}),new r(t,this.__chain__)}return this.thru(_i)}function Oo(){return wr(this.__wrapped__,this.__actions__)}function Lo(e,t,n){var r=vc(e)?d:Pn;return n&&gi(e,t,n)&&(t=Q),r(e,si(t,3))}function Ro(e,t){var n=vc(e)?p:Tn;return n(e,si(t,3))}function jo(e,t){if(t=si(t,3),vc(e)){var n=k(e,t);return n>-1?e[n]:Q}return w(e,t,Tl)}function Do(e,t){if(t=si(t,3),vc(e)){var n=k(e,t,!0);return n>-1?e[n]:Q}return w(e,t,El)}function Io(e,t){return Nn(Fo(e,t))}function zo(e,t){return"function"==typeof t&&vc(e)?c(e,t):Tl(e,Ni(t))}function Ho(e,t){return"function"==typeof t&&vc(e)?f(e,t):El(e,Ni(t))}function Wo(e,t,n,r){e=xa(e)?e:Rs(e),n=n&&!r?ns(n):0;var i=e.length;return 0>n&&(n=ul(i+n,0)),Ga(e)?i>=n&&e.indexOf(t,n)>-1:!!i&&P(e,t,n)>-1}function Fo(e,t){var n=vc(e)?v:Yn;return n(e,si(t,3))}function qo(e,t,n,r){return null==e?[]:(vc(t)||(t=null==t?[]:[t]),n=r?Q:n,vc(n)||(n=null==n?[]:[n]),tr(e,t,n))}function Xo(e,t,n){var r=vc(e)?y:C,i=arguments.length<3;return r(e,si(t,4),n,i,Tl)}function Uo(e,t,n){var r=vc(e)?b:C,i=arguments.length<3;return r(e,si(t,4),n,i,El)}function Vo(e,t){var n=vc(e)?p:Tn;return t=si(t,3),n(e,function(e,n,r){return!t(e,n,r)})}function Bo(e){var t=xa(e)?e:Rs(e),n=t.length;return n>0?t[lr(0,n-1)]:Q}function Zo(e,t){var n=-1,r=ts(e),i=r.length,o=i-1;for(t=cn(ns(t),0,i);++n0&&(n=t.apply(this,arguments)),1>=e&&(t=Q),n}}function $o(e,n,r){n=r?Q:n;var i=ni(e,ne,Q,Q,Q,Q,Q,n);return i.placeholder=t.placeholder||$o.placeholder,i}function ea(e,n,r){n=r?Q:n;var i=ni(e,re,Q,Q,Q,Q,Q,n);return i.placeholder=t.placeholder||ea.placeholder,i}function ta(e,t,n){function r(){h&&Ku(h),c&&Ku(c),v=0,l=c=p=h=m=Q}function i(t,n){n&&Ku(n),c=h=m=Q,t&&(v=sc(),f=e.apply(p,l),h||c||(l=p=Q))}function o(){var e=t-(sc()-d);0>=e||e>t?i(m,c):h=tl(o,e)}function a(){return(h&&m||c&&b)&&(f=e.apply(p,l)),r(),f}function s(){i(b,h)}function u(){if(l=arguments,d=sc(),p=this,m=b&&(h||!g),y===!1)var n=g&&!h;else{v||c||g||(v=d);var r=y-(d-v),i=0>=r||r>y;i?(c&&(c=Ku(c)),v=d,f=e.apply(p,l)):c||(c=tl(s,r))}return i&&h?h=Ku(h):h||t===y||(h=tl(o,t)),n&&(i=!0,f=e.apply(p,l)),!i||h||c||(l=p=Q),f}var l,c,f,d,p,h,m,v=0,g=!1,y=!1,b=!0;if("function"!=typeof e)throw new Du(be);return t=is(t)||0,Ra(n)&&(g=!!n.leading,y="maxWait"in n&&ul(is(n.maxWait)||0,t),b="trailing"in n?!!n.trailing:b),u.cancel=r,u.flush=a,u}function na(e){return ni(e,ue)}function ra(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new Du(be);var n=function(){var r=arguments,i=t?t.apply(this,r):r[0],o=n.cache;if(o.has(i))return o.get(i);var a=e.apply(this,r);return n.cache=o.set(i,a),a};return n.cache=new ra.Cache,n}function ia(e){if("function"!=typeof e)throw new Du(be);return function(){return!e.apply(this,arguments)}}function oa(e){return _o(2,e)}function aa(e,t){if("function"!=typeof e)throw new Du(be);return t=ul(t===Q?e.length-1:ns(t),0),function(){for(var n=arguments,r=-1,i=ul(n.length-t,0),o=Array(i);++rt}function ga(e,t){return e>=t}function ya(e){return Aa(e)&&Wu.call(e,"callee")&&(!el.call(e,"callee")||Xu.call(e)==Ne)}function ba(e){return ja(e)&&Xu.call(e)==Be}function xa(e){return null!=e&&!("function"==typeof e&&Ma(e))&&La(Rl(e))}function Aa(e){return ja(e)&&xa(e)}function wa(e){return e===!0||e===!1||ja(e)&&Xu.call(e)==Oe}function ka(e){return ja(e)&&Xu.call(e)==Le}function Pa(e){return!!e&&1===e.nodeType&&ja(e)&&!Ua(e)}function Ca(e){if(xa(e)&&(vc(e)||Ga(e)||Ma(e.splice)||ya(e)))return!e.length;for(var t in e)if(Wu.call(e,t))return!1;return!0}function Ta(e,t){return Vn(e,t)}function Ea(e,t,n){n="function"==typeof n?n:Q;var r=n?n(e,t):Q;return r===Q?Vn(e,t,n):!!r}function Sa(e){return ja(e)&&"string"==typeof e.message&&Xu.call(e)==Re}function Na(e){return"number"==typeof e&&ol(e)}function Ma(e){var t=Ra(e)?Xu.call(e):"";return t==je||t==De}function Oa(e){return"number"==typeof e&&e==ns(e)}function La(e){return"number"==typeof e&&e>-1&&e%1==0&&we>=e}function Ra(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ja(e){return!!e&&"object"==typeof e}function Da(e){return ja(e)&&ci(e)==Ie}function Ia(e,t){return e===t||Zn(e,t,ui(t))}function za(e,t,n){return n="function"==typeof n?n:Q,Zn(e,t,ui(t),n)}function Ha(e){return Xa(e)&&e!=+e}function Wa(e){return null==e?!1:Ma(e)?Vu.test(Hu.call(e)):ja(e)&&(q(e)?Vu:Ct).test(e)}function Fa(e){return null===e}function qa(e){return null==e}function Xa(e){return"number"==typeof e||ja(e)&&Xu.call(e)==ze}function Ua(e){if(!ja(e)||Xu.call(e)!=He||q(e))return!1;var t=zu;if("function"==typeof e.constructor&&(t=Qu(e)),null===t)return!0;var n=t.constructor;return"function"==typeof n&&n instanceof n&&Hu.call(n)==qu}function Va(e){return Ra(e)&&Xu.call(e)==We}function Ba(e){return Oa(e)&&e>=-we&&we>=e}function Za(e){return ja(e)&&ci(e)==Fe}function Ga(e){return"string"==typeof e||!vc(e)&&ja(e)&&Xu.call(e)==qe}function Ja(e){return"symbol"==typeof e||ja(e)&&Xu.call(e)==Xe}function Ka(e){return ja(e)&&La(e.length)&&!!xn[Xu.call(e)]}function Ya(e){return e===Q}function Qa(e){return ja(e)&&ci(e)==Ue}function _a(e){return ja(e)&&Xu.call(e)==Ve}function $a(e,t){return t>e}function es(e,t){return t>=e}function ts(e){if(!e)return[];if(xa(e))return Ga(e)?J(e):jr(e);if($u&&e[$u])return U(e[$u]());var t=ci(e),n=t==Ie?V:t==Fe?Z:Rs;return n(e)}function ns(e){if(!e)return 0===e?e:0;if(e=is(e),e===Ae||e===-Ae){var t=0>e?-1:1;return t*ke}var n=e%1;return e===e?n?e-n:e:0}function rs(e){return e?cn(ns(e),0,Ce):0}function is(e){if(Ra(e)){var t=Ma(e.valueOf)?e.valueOf():e;e=Ra(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(vt,"");var n=Pt.test(e);return n||Tt.test(e)?Sn(e.slice(2),n?2:8):kt.test(e)?Pe:+e}function os(e){return Dr(e,As(e))}function as(e){return cn(ns(e),-we,we)}function ss(e){if("string"==typeof e)return e;if(null==e)return"";if(Ja(e))return Gu?kl.call(e):"";var t=e+"";return"0"==t&&1/e==-Ae?"-0":t}function us(e,t){var n=Cl(e);return t?un(n,t):n}function ls(e,t){return w(e,si(t,3),On,!0)}function cs(e,t){return w(e,si(t,3),Ln,!0)}function fs(e,t){return null==e?e:Sl(e,Ni(t),As)}function ds(e,t){return null==e?e:Nl(e,Ni(t),As)}function ps(e,t){return e&&On(e,Ni(t))}function hs(e,t){return e&&Ln(e,Ni(t))}function ms(e){return null==e?[]:Rn(e,xs(e))}function vs(e){return null==e?[]:Rn(e,As(e))}function gs(e,t,n){var r=null==e?Q:Dn(e,t);return r===Q?n:r}function ys(e,t){return di(e,t,Hn)}function bs(e,t){return di(e,t,Wn)}function xs(e){var t=Ai(e);if(!t&&!xa(e))return Jn(e);var n=vi(e),r=!!n,i=n||[],o=i.length;for(var a in e)!Hn(e,a)||r&&("length"==a||X(a,o))||t&&"constructor"==a||i.push(a);return i}function As(e){for(var t=-1,n=Ai(e),r=Kn(e),i=r.length,o=vi(e),a=!!o,s=o||[],u=s.length;++tt){var r=e;e=t,t=r}if(n||e%1||t%1){var i=fl();return ll(e+i*(t-e+En("1e-"+((i+"").length-1))),t)}return lr(e,t)}function Hs(e){return Ic(ss(e).toLowerCase())}function Ws(e){return e=ss(e),e&&e.replace(St,z).replace(dn,"")}function Fs(e,t,n){e=ss(e),t="string"==typeof t?t:t+"";var r=e.length;return n=n===Q?r:cn(ns(n),0,r),n-=t.length,n>=0&&e.indexOf(t,n)==n}function qs(e){return e=ss(e),e&&st.test(e)?e.replace(ot,H):e}function Xs(e){return e=ss(e),e&&mt.test(e)?e.replace(ht,"\\$&"):e}function Us(e,t,n){e=ss(e),t=ns(t);var r=G(e);if(!t||r>=t)return e;var i=(t-r)/2,o=il(i),a=rl(i);return Qr("",o,n)+e+Qr("",a,n)}function Vs(e,t,n){return e=ss(e),e+Qr(e,t,n)}function Bs(e,t,n){return e=ss(e),Qr(e,t,n)+e}function Zs(e,t,n){return n||null==t?t=0:t&&(t=+t),e=ss(e).replace(vt,""),cl(e,t||(wt.test(e)?16:10))}function Gs(e,t){e=ss(e),t=ns(t);var n="";if(!e||1>t||t>we)return n;do t%2&&(n+=e),t=il(t/2),e+=e;while(t);return n}function Js(){var e=arguments,t=ss(e[0]);return e.length<3?t:t.replace(e[1],e[2])}function Ks(e,t,n){return ss(e).split(t,n)}function Ys(e,t,n){return e=ss(e),n=cn(ns(n),0,e.length),e.lastIndexOf(t,n)==n}function Qs(e,n,r){var i=t.templateSettings;r&&gi(e,n,r)&&(n=Q),e=ss(e),n=xc({},n,i,rn);var o,a,s=xc({},n.imports,i.imports,rn),u=xs(s),l=O(s,u),c=0,f=n.interpolate||Nt,d="__p += '",p=ju((n.escape||Nt).source+"|"+f.source+"|"+(f===ct?xt:Nt).source+"|"+(n.evaluate||Nt).source+"|$","g"),h="//# sourceURL="+("sourceURL"in n?n.sourceURL:"lodash.templateSources["+ ++bn+"]")+"\n";e.replace(p,function(t,n,r,i,s,u){return r||(r=i),d+=e.slice(c,u).replace(Mt,W),n&&(o=!0,d+="' +\n__e("+n+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=u+t.length,t}),d+="';\n";var m=n.variable;m||(d="with (obj) {\n"+d+"\n}\n"),d=(a?d.replace(tt,""):d).replace(nt,"$1").replace(rt,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(o?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var v=Fc(function(){return Function(u,h+"return "+d).apply(Q,l)});if(v.source=d,Sa(v))throw v;return v}function _s(e){return ss(e).toLowerCase()}function $s(e){return ss(e).toUpperCase()}function eu(e,t,n){if(e=ss(e),!e)return e;if(n||t===Q)return e.replace(vt,"");if(t+="",!t)return e;var r=J(e),i=J(t);return r.slice(L(r,i),R(r,i)+1).join("")}function tu(e,t,n){if(e=ss(e),!e)return e;if(n||t===Q)return e.replace(yt,"");if(t+="",!t)return e;var r=J(e);return r.slice(0,R(r,J(t))+1).join("")}function nu(e,t,n){if(e=ss(e),!e)return e;if(n||t===Q)return e.replace(gt,"");if(t+="",!t)return e;var r=J(e);return r.slice(L(r,J(t))).join("")}function ru(e,t){var n=fe,r=de;if(Ra(t)){var i="separator"in t?t.separator:i;n="length"in t?ns(t.length):n,r="omission"in t?ss(t.omission):r}e=ss(e);var o=e.length;if(hn.test(e)){var a=J(e);o=a.length}if(n>=o)return e;var s=n-G(r);if(1>s)return r;var u=a?a.slice(0,s).join(""):e.slice(0,s);if(i===Q)return u+r;if(a&&(s+=u.length-s),Va(i)){if(e.slice(s).search(i)){var l,c=u;for(i.global||(i=ju(i.source,ss(At.exec(i))+"g")),i.lastIndex=0;l=i.exec(c);)var f=l.index;u=u.slice(0,f===Q?s:f)}}else if(e.indexOf(i,s)!=s){var d=u.lastIndexOf(i);d>-1&&(u=u.slice(0,d))}return u+r}function iu(e){return e=ss(e),e&&at.test(e)?e.replace(it,K):e}function ou(e,t,n){return e=ss(e),t=n?Q:t,t===Q&&(t=gn.test(e)?vn:mn),e.match(t)||[]}function au(e){var t=e?e.length:0,n=si();return e=t?v(e,function(e){if("function"!=typeof e[1])throw new Du(be);return[n(e[0]),e[1]]}):[],aa(function(n){for(var r=-1;++re||e>we)return[];var n=Ce,r=ll(e,Ce);t=Ni(t),e-=Ce;for(var i=S(r,t);++n0){if(++e>=pe)return n}else e=0;return Ml(n,r)}}(),Il=aa(function(e,t){return vc(e)||(e=null==e?[]:[Object(e)]),t=Nn(t),l(e,t)}),zl=aa(function(e,t){return Aa(e)?kn(e,Nn(t,!1,!0)):[]}),Hl=aa(function(e,t){var n=Gi(t);return Aa(n)&&(n=Q),Aa(e)?kn(e,Nn(t,!1,!0),si(n)):[]}),Wl=aa(function(e,t){var n=Gi(t);return Aa(n)&&(n=Q),Aa(e)?kn(e,Nn(t,!1,!0),Q,n):[]}),Fl=aa(function(e){var t=v(e,Si);return t.length&&t[0]===e[0]?qn(t):[]}),ql=aa(function(e){var t=Gi(e),n=v(e,Si);return t===Gi(n)?t=Q:n.pop(),n.length&&n[0]===e[0]?qn(n,si(t)):[]}),Xl=aa(function(e){var t=Gi(e),n=v(e,Si);return t===Gi(n)?t=Q:n.pop(),n.length&&n[0]===e[0]?qn(n,Q,t):[]}),Ul=aa(Ki),Vl=aa(function(e,t){t=v(Nn(t),String);var n=ln(e,t);return ur(e,t.sort(D)),n}),Bl=aa(function(e){return br(Nn(e,!1,!0))}),Zl=aa(function(e){var t=Gi(e);return Aa(t)&&(t=Q),br(Nn(e,!1,!0),si(t))}),Gl=aa(function(e){var t=Gi(e);return Aa(t)&&(t=Q),br(Nn(e,!1,!0),Q,t)}),Jl=aa(function(e,t){return Aa(e)?kn(e,t):[]}),Kl=aa(function(e){return kr(p(e,Aa))}),Yl=aa(function(e){var t=Gi(e);return Aa(t)&&(t=Q),kr(p(e,Aa),si(t))}),Ql=aa(function(e){var t=Gi(e);return Aa(t)&&(t=Q),kr(p(e,Aa),Q,t)}),_l=aa(go),$l=aa(function(e){var t=e.length,n=t>1?e[t-1]:Q;return n="function"==typeof n?(e.pop(),n):Q,yo(e,n)}),ec=aa(function(e){e=Nn(e);var t=e.length,n=t?e[0]:0,o=this.__wrapped__,a=function(t){return ln(t,e)};return!(t>1||this.__actions__.length)&&o instanceof i&&X(n)?(o=o.slice(n,+n+(t?1:0)),o.__actions__.push({func:ko,args:[a],thisArg:Q}),new r(o,this.__chain__).thru(function(e){return t&&!e.length&&e.push(Q),e})):this.thru(a)}),tc=Hr(function(e,t,n){Wu.call(e,n)?++e[n]:e[n]=1}),nc=Hr(function(e,t,n){Wu.call(e,n)?e[n].push(t):e[n]=[t]}),rc=aa(function(e,t,n){var r=-1,i="function"==typeof t,o=yi(t),a=xa(e)?Array(e.length):[];return Tl(e,function(e){var u=i?t:o&&null!=e?e[t]:Q;a[++r]=u?s(u,e,n):Un(e,t,n)}),a}),ic=Hr(function(e,t,n){e[n]=t}),oc=Hr(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),ac=aa(function(e,t){if(null==e)return[];var n=t.length;return n>1&&gi(e,t[0],t[1])?t=[]:n>2&&gi(t[0],t[1],t[2])&&(t.length=1),tr(e,Nn(t),[])}),sc=Ou.now,uc=aa(function(e,n,r){var i=$;if(r.length){var o=t.placeholder||uc.placeholder,a=B(r,o);i|=ie}return ni(e,i,n,r,a)}),lc=aa(function(e,n,r){var i=$|ee;if(r.length){var o=t.placeholder||lc.placeholder,a=B(r,o);i|=ie}return ni(n,i,e,r,a)}),cc=aa(function(e,t){return wn(e,1,t)}),fc=aa(function(e,t,n){return wn(e,is(t)||0,n)}),dc=aa(function(e,t){t=v(Nn(t),si());var n=t.length;return aa(function(r){for(var i=-1,o=ll(r.length,n);++i0||0>t)?new i(n):(0>e?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==Q&&(t=ns(t),n=0>t?n.dropRight(-t):n.take(t-e)),n)},i.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},i.prototype.toArray=function(){return this.take(Ce)},On(i.prototype,function(e,n){var o=/^(?:filter|find|map|reject)|While$/.test(n),a=/^(?:head|last)$/.test(n),s=t[a?"take"+("last"==n?"Right":""):n],u=a||/^find/.test(n);s&&(t.prototype[n]=function(){var n=this.__wrapped__,l=a?[1]:arguments,c=n instanceof i,f=l[0],d=c||vc(n),p=function(e){var n=s.apply(t,g([e],l));return a&&h?n[0]:n};d&&o&&"function"==typeof f&&1!=f.length&&(c=d=!1);var h=this.__chain__,m=!!this.__actions__.length,v=u&&!h,y=c&&!m;if(!u&&d){n=y?n:new i(this);var b=e.apply(n,l);return b.__actions__.push({func:ko,args:[p],thisArg:Q}),new r(b,h)}return v&&y?e.apply(this,l):(b=this.thru(p),v?a?b.value()[0]:b.value():b)})}),c(["pop","push","shift","sort","splice","unshift"],function(e){var n=Iu[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",i=/^(?:pop|shift)$/.test(e);t.prototype[e]=function(){var e=arguments;return i&&!this.__chain__?n.apply(this.value(),e):this[r](function(t){return n.apply(t,e)})}}),On(i.prototype,function(e,n){var r=t[n];if(r){var i=r.name+"",o=Pl[i]||(Pl[i]=[]);o.push({name:n,func:r})}}),Pl[Jr(Q,ee).name]=[{name:"wrapper",func:Q}],i.prototype.clone=j,i.prototype.reverse=Et,i.prototype.value=Ot,t.prototype.at=ec,t.prototype.chain=Po,t.prototype.commit=Co,t.prototype.flatMap=To,t.prototype.next=Eo,t.prototype.plant=No,t.prototype.reverse=Mo,t.prototype.toJSON=t.prototype.valueOf=t.prototype.value=Oo,$u&&(t.prototype[$u]=So),t}var Q,_="4.3.0",$=1,ee=2,te=4,ne=8,re=16,ie=32,oe=64,ae=128,se=256,ue=512,le=1,ce=2,fe=30,de="...",pe=150,he=16,me=200,ve=1,ge=2,ye=3,be="Expected a function",xe="__lodash_hash_undefined__",Ae=1/0,we=9007199254740991,ke=1.7976931348623157e308,Pe=NaN,Ce=4294967295,Te=Ce-1,Ee=Ce>>>1,Se="__lodash_placeholder__",Ne="[object Arguments]",Me="[object Array]",Oe="[object Boolean]",Le="[object Date]",Re="[object Error]",je="[object Function]",De="[object GeneratorFunction]",Ie="[object Map]",ze="[object Number]",He="[object Object]",We="[object RegExp]",Fe="[object Set]",qe="[object String]",Xe="[object Symbol]",Ue="[object WeakMap]",Ve="[object WeakSet]",Be="[object ArrayBuffer]",Ze="[object Float32Array]",Ge="[object Float64Array]",Je="[object Int8Array]",Ke="[object Int16Array]",Ye="[object Int32Array]",Qe="[object Uint8Array]",_e="[object Uint8ClampedArray]",$e="[object Uint16Array]",et="[object Uint32Array]",tt=/\b__p \+= '';/g,nt=/\b(__p \+=) '' \+/g,rt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,it=/&(?:amp|lt|gt|quot|#39|#96);/g,ot=/[&<>"'`]/g,at=RegExp(it.source),st=RegExp(ot.source),ut=/<%-([\s\S]+?)%>/g,lt=/<%([\s\S]+?)%>/g,ct=/<%=([\s\S]+?)%>/g,ft=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,dt=/^\w*$/,pt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,ht=/[\\^$.*+?()[\]{}|]/g,mt=RegExp(ht.source),vt=/^\s+|\s+$/g,gt=/^\s+/,yt=/\s+$/,bt=/\\(\\)?/g,xt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,At=/\w*$/,wt=/^0x/i,kt=/^[-+]0x[0-9a-f]+$/i,Pt=/^0b[01]+$/i,Ct=/^\[object .+?Constructor\]$/,Tt=/^0o[0-7]+$/i,Et=/^(?:0|[1-9]\d*)$/,St=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,Nt=/($^)/,Mt=/['\n\r\u2028\u2029\\]/g,Ot="\\ud800-\\udfff",Lt="\\u0300-\\u036f\\ufe20-\\ufe23",Rt="\\u20d0-\\u20f0",jt="\\u2700-\\u27bf",Dt="a-z\\xdf-\\xf6\\xf8-\\xff",It="\\xac\\xb1\\xd7\\xf7",zt="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Ht="\\u2018\\u2019\\u201c\\u201d",Wt=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Ft="A-Z\\xc0-\\xd6\\xd8-\\xde",qt="\\ufe0e\\ufe0f",Xt=It+zt+Ht+Wt,Ut="["+Ot+"]",Vt="["+Xt+"]",Bt="["+Lt+Rt+"]",Zt="\\d+",Gt="["+jt+"]",Jt="["+Dt+"]",Kt="[^"+Ot+Xt+Zt+jt+Dt+Ft+"]",Yt="\\ud83c[\\udffb-\\udfff]",Qt="(?:"+Bt+"|"+Yt+")",_t="[^"+Ot+"]",$t="(?:\\ud83c[\\udde6-\\uddff]){2}",en="[\\ud800-\\udbff][\\udc00-\\udfff]",tn="["+Ft+"]",nn="\\u200d",rn="(?:"+Jt+"|"+Kt+")",on="(?:"+tn+"|"+Kt+")",an=Qt+"?",sn="["+qt+"]?",un="(?:"+nn+"(?:"+[_t,$t,en].join("|")+")"+sn+an+")*",ln=sn+an+un,cn="(?:"+[Gt,$t,en].join("|")+")"+ln,fn="(?:"+[_t+Bt+"?",Bt,$t,en,Ut].join("|")+")",dn=RegExp(Bt,"g"),pn=RegExp(Yt+"(?="+Yt+")|"+fn+ln,"g"),hn=RegExp("["+nn+Ot+Lt+Rt+qt+"]"),mn=/[a-zA-Z0-9]+/g,vn=RegExp([tn+"?"+Jt+"+(?="+[Vt,tn,"$"].join("|")+")",on+"+(?="+[Vt,tn+rn,"$"].join("|")+")",tn+"?"+rn+"+",tn+"+",Zt,cn].join("|"),"g"),gn=/[a-z][A-Z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,yn=["Array","Buffer","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Reflect","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],bn=-1,xn={}; -xn[Ze]=xn[Ge]=xn[Je]=xn[Ke]=xn[Ye]=xn[Qe]=xn[_e]=xn[$e]=xn[et]=!0,xn[Ne]=xn[Me]=xn[Be]=xn[Oe]=xn[Le]=xn[Re]=xn[je]=xn[Ie]=xn[ze]=xn[He]=xn[We]=xn[Fe]=xn[qe]=xn[Ue]=!1;var An={};An[Ne]=An[Me]=An[Be]=An[Oe]=An[Le]=An[Ze]=An[Ge]=An[Je]=An[Ke]=An[Ye]=An[Ie]=An[ze]=An[He]=An[We]=An[Fe]=An[qe]=An[Xe]=An[Qe]=An[_e]=An[$e]=An[et]=!0,An[Re]=An[je]=An[Ue]=!1;var wn={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},kn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Pn={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Cn={"function":!0,object:!0},Tn={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},En=parseFloat,Sn=parseInt,Nn=Cn[typeof t]&&t&&!t.nodeType?t:null,Mn=Cn[typeof e]&&e&&!e.nodeType?e:null,On=j(Nn&&Mn&&"object"==typeof i&&i),Ln=j(Cn[typeof self]&&self),Rn=j(Cn[typeof window]&&window),jn=Mn&&Mn.exports===Nn?Nn:null,Dn=j(Cn[typeof this]&&this),In=On||Rn!==(Dn&&Dn.window)&&Rn||Ln||Dn||Function("return this")(),zn=Y();(Rn||Ln||{})._=zn,r=function(){return zn}.call(t,n,t,e),!(r!==Q&&(e.exports=r))}).call(this)}).call(t,n(48)(e),function(){return this}())},function(e,t,n){"use strict";e.exports=n(111)},function(e,t,n){"use strict";t.__esModule=!0;var r=n(4);t["default"]=r.PropTypes.shape({subscribe:r.PropTypes.func.isRequired,dispatch:r.PropTypes.func.isRequired,getState:r.PropTypes.func.isRequired})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e){return 0===e.button}function a(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function s(e){for(var t in e)if(e.hasOwnProperty(t))return!1;return!0}function u(e,t){var n=t.query,r=t.hash,i=t.state;return n||r||i?{pathname:e,query:n,hash:r,state:i}:e}t.__esModule=!0;var l=Object.assign||function(e){for(var t=1;t=0;r--){var i=e[r],o=i.path||"";if(n=o.replace(/\/*$/,"/")+n,0===o.indexOf("/"))break}return"/"+n}},propTypes:{path:d,from:d,to:d.isRequired,query:p,state:p,onEnter:c.falsy,children:c.falsy},render:function(){s["default"](!1)}});t["default"]=h,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){return a({},e,{setRouteLeaveHook:t.listenBeforeLeavingRoute,isActive:t.isActive})}function o(e,t){return e=a({},e,t)}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t=0&&0===window.sessionStorage.length)return;throw n}}function a(e){var t=void 0;try{t=window.sessionStorage.getItem(i(e))}catch(n){if(n.name===c)return null}if(t)try{return JSON.parse(t)}catch(n){}return null}t.__esModule=!0,t.saveState=o,t.readState=a;var s=n(15),u=(r(s),"@@History/"),l=["QuotaExceededError","QUOTA_EXCEEDED_ERR"],c="SecurityError"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){function t(e){return u.canUseDOM?void 0:s["default"](!1),n.listen(e)}var n=f["default"](o({getUserConfirmation:l.getUserConfirmation},e,{go:l.go}));return o({},n,{listen:t})}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e){return function(){function t(e){return b&&null==e.basename&&(0===e.pathname.indexOf(b)?(e.pathname=e.pathname.substring(b.length),e.basename=b,""===e.pathname&&(e.pathname="/")):e.basename=""),e}function n(e){if(!b)return e;"string"==typeof e&&(e=u.parsePath(e));var t=e.pathname,n="/"===b.slice(-1)?b:b+"/",r="/"===t.charAt(0)?t.slice(1):t,i=n+r;return a({},e,{pathname:i})}function r(e){return A.listenBefore(function(n,r){c["default"](e,t(n),r)})}function o(e){return A.listen(function(n){e(t(n))})}function l(e){A.push(n(e))}function f(e){A.replace(n(e))}function p(e){return A.createPath(n(e))}function h(e){return A.createHref(n(e))}function m(e){for(var r=arguments.length,i=Array(r>1?r-1:0),o=1;r>o;o++)i[o-1]=arguments[o];return t(A.createLocation.apply(A,[n(e)].concat(i)))}function v(e,t){"string"==typeof t&&(t=u.parsePath(t)),l(a({state:e},t))}function g(e,t){"string"==typeof t&&(t=u.parsePath(t)),f(a({state:e},t))}var y=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],b=y.basename,x=i(y,["basename"]),A=e(x);if(null==b&&s.canUseDOM){var w=document.getElementsByTagName("base")[0];w&&(b=u.extractPath(w.href))}return a({},A,{listenBefore:r,listen:o,push:l,replace:f,createPath:p,createHref:h,createLocation:m,pushState:d["default"](v,"pushState is deprecated; use push instead"),replaceState:d["default"](g,"replaceState is deprecated; use replace instead")})}}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t=e.childNodes.length?null:e.childNodes.item(n);e.insertBefore(t,r)}var i=n(246),o=n(123),a=n(10),s=n(47),u=n(73),l=n(1),c={dangerouslyReplaceNodeWithMarkup:i.dangerouslyReplaceNodeWithMarkup,updateTextContent:u,processUpdates:function(e,t){for(var n,a=null,c=null,f=0;f-1?void 0:a(!1),!l.plugins[n]){t.extractEvents?void 0:a(!1),l.plugins[n]=t;var r=t.eventTypes;for(var o in r)i(r[o],t,o)?void 0:a(!1)}}}function i(e,t,n){l.eventNameDispatchConfigs.hasOwnProperty(n)?a(!1):void 0,l.eventNameDispatchConfigs[n]=e;var r=e.phasedRegistrationNames;if(r){for(var i in r)if(r.hasOwnProperty(i)){var s=r[i];o(s,t,n)}return!0}return e.registrationName?(o(e.registrationName,t,n),!0):!1}function o(e,t,n){l.registrationNameModules[e]?a(!1):void 0,l.registrationNameModules[e]=t,l.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var a=n(1),s=null,u={},l={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(e){s?a(!1):void 0,s=Array.prototype.slice.call(e),r()},injectEventPluginsByName:function(e){var t=!1;for(var n in e)if(e.hasOwnProperty(n)){var i=e[n];u.hasOwnProperty(n)&&u[n]===i||(u[n]?a(!1):void 0,u[n]=i,t=!0)}t&&r()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return l.registrationNameModules[t.registrationName]||null;for(var n in t.phasedRegistrationNames)if(t.phasedRegistrationNames.hasOwnProperty(n)){var r=l.registrationNameModules[t.phasedRegistrationNames[n]];if(r)return r}return null},_resetEventPlugins:function(){s=null;for(var e in u)u.hasOwnProperty(e)&&delete u[e];l.plugins.length=0;var t=l.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=l.registrationNameModules;for(var i in r)r.hasOwnProperty(i)&&delete r[i]}};e.exports=l},function(e,t,n){"use strict";function r(e){return(""+e).replace(x,"//")}function i(e,t){this.func=e,this.context=t,this.count=0}function o(e,t,n){var r=e.func,i=e.context;r.call(i,t,e.count++)}function a(e,t,n){if(null==e)return e;var r=i.getPooled(t,n);g(e,o,r),i.release(r)}function s(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.context=r,this.count=0}function u(e,t,n){var i=e.result,o=e.keyPrefix,a=e.func,s=e.context,u=a.call(s,t,e.count++);Array.isArray(u)?l(u,i,n,v.thatReturnsArgument):null!=u&&(m.isValidElement(u)&&(u=m.cloneAndReplaceKey(u,o+(u!==t?r(u.key||"")+"/":"")+n)),i.push(u))}function l(e,t,n,i,o){var a="";null!=n&&(a=r(n)+"/");var l=s.getPooled(t,a,i,o);g(e,u,l),s.release(l)}function c(e,t,n){if(null==e)return e;var r=[];return l(e,r,null,t,n),r}function f(e,t,n){return null}function d(e,t){return g(e,f,null)}function p(e){var t=[];return l(e,t,null,v.thatReturnsArgument),t}var h=n(21),m=n(9),v=n(13),g=n(75),y=h.twoArgumentPooler,b=h.fourArgumentPooler,x=/\/(?!\/)/g;i.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},h.addPoolingTo(i,y),s.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},h.addPoolingTo(s,b);var A={forEach:a,map:c,mapIntoWithKeyPrefixInternal:l,count:d,toArray:p};e.exports=A},function(e,t,n){"use strict";function r(e,t){var n=w.hasOwnProperty(t)?w[t]:null;P.hasOwnProperty(t)&&(n!==x.OVERRIDE_BASE?v(!1):void 0),e.hasOwnProperty(t)&&(n!==x.DEFINE_MANY&&n!==x.DEFINE_MANY_MERGED?v(!1):void 0)}function i(e,t){if(t){"function"==typeof t?v(!1):void 0,d.isValidElement(t)?v(!1):void 0;var n=e.prototype;t.hasOwnProperty(b)&&k.mixins(e,t.mixins);for(var i in t)if(t.hasOwnProperty(i)&&i!==b){var o=t[i];if(r(n,i),k.hasOwnProperty(i))k[i](e,o);else{var a=w.hasOwnProperty(i),l=n.hasOwnProperty(i),c="function"==typeof o,f=c&&!a&&!l&&t.autobind!==!1;if(f)n.__reactAutoBindMap||(n.__reactAutoBindMap={}),n.__reactAutoBindMap[i]=o,n[i]=o;else if(l){var p=w[i];!a||p!==x.DEFINE_MANY_MERGED&&p!==x.DEFINE_MANY?v(!1):void 0,p===x.DEFINE_MANY_MERGED?n[i]=s(n[i],o):p===x.DEFINE_MANY&&(n[i]=u(n[i],o))}else n[i]=o}}}}function o(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var i=n in k;i?v(!1):void 0;var o=n in e;o?v(!1):void 0,e[n]=r}}}function a(e,t){e&&t&&"object"==typeof e&&"object"==typeof t?void 0:v(!1);for(var n in t)t.hasOwnProperty(n)&&(void 0!==e[n]?v(!1):void 0,e[n]=t[n]);return e}function s(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var i={};return a(i,n),a(i,r),i}}function u(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function l(e,t){var n=t.bind(e);return n}function c(e){for(var t in e.__reactAutoBindMap)if(e.__reactAutoBindMap.hasOwnProperty(t)){var n=e.__reactAutoBindMap[t];e[t]=l(e,n)}}var f=n(110),d=n(9),p=(n(42),n(41),n(125)),h=n(3),m=n(31),v=n(1),g=n(26),y=n(19),b=(n(2),y({mixins:null})),x=g({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),A=[],w={mixins:x.DEFINE_MANY,statics:x.DEFINE_MANY,propTypes:x.DEFINE_MANY,contextTypes:x.DEFINE_MANY,childContextTypes:x.DEFINE_MANY,getDefaultProps:x.DEFINE_MANY_MERGED,getInitialState:x.DEFINE_MANY_MERGED,getChildContext:x.DEFINE_MANY_MERGED,render:x.DEFINE_ONCE,componentWillMount:x.DEFINE_MANY,componentDidMount:x.DEFINE_MANY,componentWillReceiveProps:x.DEFINE_MANY,shouldComponentUpdate:x.DEFINE_ONCE,componentWillUpdate:x.DEFINE_MANY,componentDidUpdate:x.DEFINE_MANY,componentWillUnmount:x.DEFINE_MANY,updateComponent:x.OVERRIDE_BASE},k={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n"+s+""},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;if(n!==this._stringText){this._stringText=n;var i=a.getNode(this._rootNodeID);r.updateTextContent(i,n)}}},unmountComponent:function(){o.unmountIDFromEnvironment(this._rootNodeID)}}),e.exports=c},function(e,t,n){"use strict";function r(){this.reinitializeTransaction()}var i=n(11),o=n(44),a=n(3),s=n(13),u={initialize:s,close:function(){d.isBatchingUpdates=!1}},l={initialize:s,close:i.flushBatchedUpdates.bind(i)},c=[l,u];a(r.prototype,o.Mixin,{getTransactionWrappers:function(){return c}});var f=new r,d={isBatchingUpdates:!1,batchedUpdates:function(e,t,n,r,i,o){var a=d.isBatchingUpdates;d.isBatchingUpdates=!0,a?e(t,n,r,i,o):f.perform(e,null,t,n,r,i,o)}};e.exports=d},function(e,t,n){"use strict";function r(){if(!C){C=!0,g.EventEmitter.injectReactEventListener(v),g.EventPluginHub.injectEventPluginOrder(s),g.EventPluginHub.injectInstanceHandle(y),g.EventPluginHub.injectMount(b),g.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:k,EnterLeaveEventPlugin:u,ChangeEventPlugin:o,SelectEventPlugin:A,BeforeInputEventPlugin:i}),g.NativeComponent.injectGenericComponentClass(h),g.NativeComponent.injectTextComponentClass(m),g.Class.injectMixin(f),g.DOMProperty.injectDOMPropertyConfig(c),g.DOMProperty.injectDOMPropertyConfig(P),g.EmptyComponent.injectEmptyComponent("noscript"),g.Updates.injectReconcileTransaction(x),g.Updates.injectBatchingStrategy(p),g.RootIndex.injectCreateReactRootIndex(l.canUseDOM?a.createReactRootIndex:w.createReactRootIndex),g.Component.injectEnvironment(d)}}var i=n(242),o=n(244),a=n(245),s=n(247),u=n(248),l=n(5),c=n(251),f=n(253),d=n(61),p=n(115),h=n(257),m=n(114),v=n(265),g=n(266),y=n(30),b=n(7),x=n(270),A=n(276),w=n(277),k=n(278),P=n(275),C=!1;e.exports={inject:r}},function(e,t,n){"use strict";function r(){if(f.current){var e=f.current.getName();if(e)return" Check the render method of `"+e+"`."}return""}function i(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;o("uniqueKey",e,t)}}function o(e,t,n){var i=r();if(!i){var o="string"==typeof n?n:n.displayName||n.name;o&&(i=" Check the top-level render call using <"+o+">.")}var a=h[e]||(h[e]={});if(a[i])return null;a[i]=!0;var s={parentOrOwner:i,url:" See https://fb.me/react-warning-keys for more information.",childOwner:null};return t&&t._owner&&t._owner!==f.current&&(s.childOwner=" It was passed a child from "+t._owner.getName()+"."),s}function a(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n/,o={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=r(e);return e.replace(i," "+o.CHECKSUM_ATTR_NAME+'="'+t+'"$&')},canReuseMarkup:function(e,t){var n=t.getAttribute(o.CHECKSUM_ATTR_NAME);n=n&&parseInt(n,10);var i=r(e);return i===n}};e.exports=o},function(e,t,n){"use strict";var r=n(26),i=r({INSERT_MARKUP:null,MOVE_EXISTING:null,REMOVE_NODE:null,SET_MARKUP:null,TEXT_CONTENT:null});e.exports=i},function(e,t,n){"use strict";function r(e){if("function"==typeof e.type)return e.type;var t=e.type,n=f[t];return null==n&&(f[t]=n=l(t)),n}function i(e){return c?void 0:u(!1),new c(e.type,e.props)}function o(e){return new d(e)}function a(e){return e instanceof d}var s=n(3),u=n(1),l=null,c=null,f={},d=null,p={injectGenericComponentClass:function(e){c=e},injectTextComponentClass:function(e){d=e},injectComponentClasses:function(e){s(f,e)}},h={getComponentClassForElement:r,createInternalComponent:i,createInstanceForText:o,isTextComponent:a,injection:p};e.exports=h},function(e,t,n){"use strict";function r(e,t){}var i=(n(2),{isMounted:function(e){return!1},enqueueCallback:function(e,t){},enqueueForceUpdate:function(e){r(e,"forceUpdate")},enqueueReplaceState:function(e,t){r(e,"replaceState")},enqueueSetState:function(e,t){r(e,"setState")},enqueueSetProps:function(e,t){r(e,"setProps")},enqueueReplaceProps:function(e,t){r(e,"replaceProps")}});e.exports=i},function(e,t,n){"use strict";function r(e){function t(t,n,r,i,o,a){if(i=i||w,a=a||r,null==n[r]){var s=b[o];return t?new Error("Required "+s+" `"+a+"` was not specified in "+("`"+i+"`.")):null}return e(n,r,i,o,a)}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function i(e){function t(t,n,r,i,o){var a=t[n],s=m(a);if(s!==e){var u=b[i],l=v(a);return new Error("Invalid "+u+" `"+o+"` of type "+("`"+l+"` supplied to `"+r+"`, expected ")+("`"+e+"`."))}return null}return r(t)}function o(){return r(x.thatReturns(null))}function a(e){function t(t,n,r,i,o){var a=t[n];if(!Array.isArray(a)){var s=b[i],u=m(a);return new Error("Invalid "+s+" `"+o+"` of type "+("`"+u+"` supplied to `"+r+"`, expected an array."))}for(var l=0;l>"}var y=n(9),b=n(41),x=n(13),A=n(70),w="<>",k={array:i("array"),bool:i("boolean"),func:i("function"),number:i("number"),object:i("object"),string:i("string"),any:o(),arrayOf:a,element:s(),instanceOf:u,node:d(),objectOf:c,oneOf:l,oneOfType:f,shape:p};e.exports=k},function(e,t){"use strict";var n={injectCreateReactRootIndex:function(e){r.createReactRootIndex=e}},r={createReactRootIndex:null,injection:n};e.exports=r},function(e,t){"use strict";var n={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(e){n.currentScrollLeft=e.x,n.currentScrollTop=e.y}};e.exports=n},function(e,t,n){"use strict";function r(e,t){if(null==t?i(!1):void 0,null==e)return t;var n=Array.isArray(e),r=Array.isArray(t);return n&&r?(e.push.apply(e,t),e):n?(e.push(t),e):r?[e].concat(t):[e,t]}var i=n(1);e.exports=r},function(e,t){"use strict";var n=function(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)};e.exports=n},function(e,t,n){"use strict";function r(){return!o&&i.canUseDOM&&(o="textContent"in document.documentElement?"textContent":"innerText"),o}var i=n(5),o=null;e.exports=r},function(e,t){"use strict";function n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&r[e.type]||"textarea"===t)}var r={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};e.exports=n},function(e,t,n){"use strict";function r(e){return"function"==typeof e}function i(e,t){return function(n,i){if(i.type!==e)return n;var a=o.isError(i)?"throw":"next";r(t)&&(t.next=t["throw"]=t);var s=t[a];return r(s)?s(n,i):n}}t.__esModule=!0,t["default"]=i;var o=n(194);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.save=t.load=void 0;var i=n(299),o=n(36),a=r(o);t.load=(0,i.createAction)(a.LOAD),t.save=(0,i.createAction)(a.SAVE)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(134);t["default"]=function(e){return function(t){var n=function(e){return t.dispatch((0,r.load)(e))};return e.load().then(function(e){return n(e),e})}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);tn;n++)t[n]=arguments[n];return function(){if(0===t.length)return arguments.length<=0?void 0:arguments[0];var e=t[t.length-1],n=t.slice(0,-1);return n.reduceRight(function(e,t){return t(e)},e.apply(void 0,arguments))}}t.__esModule=!0,t["default"]=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t,n){function r(){h===p&&(h=p.slice())}function o(){return d}function u(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return r(),h.push(e),function(){if(t){t=!1,r();var n=h.indexOf(e);h.splice(n,1)}}}function l(e){if(!(0,a["default"])(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if("undefined"==typeof e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(m)throw new Error("Reducers may not dispatch actions.");try{m=!0,d=f(d,e)}finally{m=!1}for(var t=p=h,n=0;nf;f++)l[f]=arguments[f];return n=r=o(this,(e=Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.onChange=function(e){e!==r.props.text&&r.props.onChange(e)},r.render=function(){var e={readOnly:!1,lineNumbers:!1,mode:"gfm",matchBrackets:!0,lineWrapping:!0,viewportMargin:1/0,theme:"atlas",extraKeys:{Enter:"newlineAndIndentContinueMarkdownList"}};return u["default"].createElement("div",{className:d["default"].container},u["default"].createElement(c["default"],{value:r.props.text,onChange:r.onChange,options:e}))},a=n,o(r,a)}return a(t,e),t}(u["default"].Component);p.propTypes={text:u["default"].PropTypes.string,onChange:u["default"].PropTypes.func},t["default"]=p},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(145),o=r(i);t["default"]=o["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(4),u=r(s),l=n(213),c=r(l),f=n(207),d=r(f),p=n(320),h=r(p);n(313),n(314);var m=function(e){function t(){var e,n,r,a;i(this,t);for(var s=arguments.length,l=Array(s),f=0;s>f;f++)l[f]=arguments[f];return n=r=o(this,(e=Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.onChange=function(e){e!==r.props.text&&r.props.onChange(e)},r.render=function(){return u["default"].createElement("div",{className:h["default"].container},u["default"].createElement("div",null),u["default"].createElement(c["default"],{options:{toolbar:{buttons:["bold","italic","underline","anchor","unorderedlist","orderedlist","h1","h2","h3","quote"]},placeholder:!1},text:(0,d["default"])(r.props.text),onChange:r.onChange,className:h["default"].editor}))},a=n,o(r,a)}return a(t,e),t}(u["default"].Component);m.propTypes={text:u["default"].PropTypes.string,onChange:u["default"].PropTypes.func},t["default"]=m},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(147),o=r(i);t["default"]=o["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0?n:s["default"].xor([l.ActiveEditors.MARKDOWN,l.ActiveEditors.TEXT],[t.toggledEditor]);default:return e}},f=function(){var e=arguments.length<=0||void 0===arguments[0]?{visible:!1}:arguments[0],t=arguments[1];switch(t.type){case l.TOGGLE_HISTORY_SIDEBAR:return o({},e,{visible:!e.visible});default:return e}},d="# Welcome to Beautiful Atlas\n\nThis is just a small preview here's what you can do:\n\n- Write markdown or rich text, you choose\n- Dont' worry about saving\n- One document for now\n- More to come\n",p={text:d,revisions:[],unsavedChanges:!1},h=function(){var e=arguments.length<=0||void 0===arguments[0]?p:arguments[0],t=arguments[1],n=s["default"].last(e.revisions);switch(t.type){case l.UPDATE_TEXT:var r=!1;return n&&n.text!==e.text&&(r=!0),o({},e,{unsavedChanges:r,text:t.text});case l.ADD_REVISION:if(n&&n.text===e.text)return e;var a=n?n.id:0;return o({},e,{revisions:[].concat(i(e.revisions),[{id:a+1,text:e.text,created_at:t.createdAt}]),unsavedChanges:!1});default:return e}};t["default"]=(0,u.combineReducers)({activeEditors:c,historySidebar:f,text:h})},function(e,t,n){(function(e){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0}),t.client=void 0;var o=n(89),a=r(o),s=n(37),u=r(s),l=n(78),c=r(l),f=function p(){var t=this,n=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];i(this,p),this.fetch=function(n,r,i){var o=void 0,a=void 0;"GET"===r?a=n+t.constructQueryString(i):("POST"===r||"PUT"===r)&&(o=JSON.stringify(i));var s=new Headers({Accept:"application/json","Content-Type":"application/json","User-Agent":t.userAgent});u["default"].getToken()&&s.set("Authorization","JWT "+u["default"].getToken());var l=e(t.baseUrl+(a||n),{method:r,body:o,headers:s,redirect:"follow"});return new Promise(function(e,t){l.then(function(e){if(e.status>=200&&e.status<300)return e;401===e.status&&u["default"].logout();var n=void 0;try{n=JSON.parse(e)}catch(r){n={error:e.statusText}}n.statusCode=e.status,n.response=e,t(n)}).then(function(e){return e.json()}).then(function(t){e(t)})["catch"](function(){t({error:"Unknown error"})})})},this.post=function(e,n){return t.fetch(e,"POST",n)},this.put=function(e,n){return t.fetch(e,"PUT",n)},this.get=function(e,n){return t.fetch(e,"GET",n)},this["delete"]=function(e,n){return t.fetch(e,"DELETE",n)},this.constructQueryString=function(e){return a["default"].map(e,function(e,t){return encodeURIComponent(t)+"="+encodeURIComponent(e)}).join("&")},this.baseUrl=n.baseUrl||c["default"].API_BASE_URL,this.userAgent=n.userAgent||c["default"].API_USER_AGENT};t["default"]=f;var d=new f;t.client=d}).call(t,n(196))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){var t=(0,a["default"])(e,{gfm:!0,converters:[s,u]});return t}Object.defineProperty(t,"__esModule",{value:!0}),t.toMarkdown=i;var o=n(323),a=r(o),s={filter:"li",replacement:function(e,t){e=e.replace(/^\s+/,"").replace(/\n/gm,"\n ");var n="- ",r=t.parentNode,i=Array.prototype.indexOf.call(r.children,t)+1;return n=/ol/i.test(r.nodeName)?i+". ":"- ",n+e}},u={filter:["ul","ol"],replacement:function(e,t){for(var n=[],r=0;rl;l++)u[l]=arguments[l];return n=r=o(this,(e=Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.state={loggedIn:b["default"].loggedIn()},r.componentWillMount=function(){b["default"].onChange=r.updateAuth},r.updateAuth=function(e){r.setState({loggedIn:e})},r.logout=function(){b["default"].logout()},a=n,o(r,a)}return a(t,e),s(t,[{key:"render",value:function(){return l["default"].createElement("div",{className:d["default"].container},l["default"].createElement(m["default"],{activeEditors:this.props.activeEditors,toggleEditors:this.props.toggleEditors,addRevision:this.props.addRevision,unsavedChanges:this.props.unsavedChanges}),l["default"].createElement("div",{className:d["default"].content},l["default"].createElement(g["default"],null)))}}]),t}(u.Component);x.propTypes={children:l["default"].PropTypes.element,activeEditors:l["default"].PropTypes.array.isRequired,toggleEditors:l["default"].PropTypes.func.isRequired,addRevision:l["default"].PropTypes.func.isRequired,unsavedChanges:l["default"].PropTypes.bool.isRequired};var A=function(e){return{activeEditors:e.activeEditors,unsavedChanges:e.text.unsavedChanges}},w=function(e){return{toggleEditors:function(t){e((0,p.toggleEditors)(t))},addRevision:function(){e((0,p.addRevision)())}}};x=(0,c.connect)(A,w)(x),t["default"]=x},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(152),o=r(i);t["default"]=o["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n1?y["default"].panel:y["default"].fullscreen)+" "+y["default"].markdown},l["default"].createElement(d["default"],{onChange:this.props.editMarkdown,text:this.props.text})):null,e.includes("TEXT")?l["default"].createElement("div",{className:(e.length>1?y["default"].panel:y["default"].fullscreen)+" "+y["default"].text},l["default"].createElement(h["default"],{onChange:this.props.editText,text:this.props.text})):null)}}]),t}(u.Component);b.propTypes={editMarkdown:l["default"].PropTypes.func.isRequired,editText:l["default"].PropTypes.func.isRequired,text:l["default"].PropTypes.string,activeEditors:l["default"].PropTypes.arrayOf(l["default"].PropTypes.string),showHistorySidebar:l["default"].PropTypes.bool.isRequired};var x=function(e){return{text:e.text.text,editor:e.editor,activeEditors:e.activeEditors,showHistorySidebar:e.historySidebar.visible,revisions:e.text.revisions}},A=function(e){return{editMarkdown:function(t){e((0,v.updateText)(t,"markdown"))},editText:function(t){var n=(0,m.toMarkdown)(t);e((0,v.updateText)(n,"text"))}}};b=(0,c.connect)(x,A)(b),t["default"]=b},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;nl;l++)u[l]=arguments[l];return n=r=o(this,(e=Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.state={email:"",password:"",error:null},r.handleEmailChange=function(e){r.setState({email:e.target.value})},r.handlePasswordChange=function(e){r.setState({password:e.target.value})},r.handleSubmit=function(e){e.preventDefault(),f["default"].login(r.state.email,r.state.password).then(function(){var e=r.props.location;e.state&&e.state.nextPathname?r.context.router.replace(e.state.nextPathname):r.context.router.replace("/dashboard")})["catch"](function(e){r.setState({error:e.error})})},a=n,o(r,a)}return a(t,e),s(t,[{key:"render",value:function(){return l["default"].createElement("div",null,l["default"].createElement("h2",null,"Login"),l["default"].createElement("form",{action:"",onSubmit:this.handleSubmit},this.state.error&&l["default"].createElement("p",null,this.state.error),l["default"].createElement("div",null,l["default"].createElement("input",{placeholder:"Email",onChange:this.handleEmailChange})),l["default"].createElement("div",null,l["default"].createElement("input",{placeholder:"Password",type:"password",onChange:this.handlePasswordChange})),l["default"].createElement("div",null,l["default"].createElement("input",{type:"submit"}))))}}]),t}(u.Component);d.propTypes={location:l["default"].PropTypes.object},d.contextTypes={router:l["default"].PropTypes.object.isRequired},t["default"]=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=n(155),o=r(i);t["default"]=o["default"]},function(e,t){e.exports=function(e){var t={},n=arguments[1];if("string"==typeof n){n={};for(var r=1;r":a.innerHTML="<"+e+">",s[e]=!a.firstChild),s[e]?d[e]:null}var o=n(6),i=n(1),a=o.canUseDOM?document.createElement("div"):null,s={},u=[1,'"],l=[1,"","
"],c=[3,"","
"],f=[1,'',""],d={"*":[1,"?
","
"],area:[1,"",""],col:[2,"","
"],legend:[1,"
","
"],param:[1,"",""],tr:[2,"","
"],optgroup:u,option:u,caption:l,colgroup:l,tbody:l,tfoot:l,thead:l,td:c,th:c},p=["circle","clipPath","defs","ellipse","g","image","line","linearGradient","mask","path","pattern","polygon","polyline","radialGradient","rect","stop","text","tspan"];p.forEach(function(e){d[e]=f,s[e]=!0}),e.exports=r},function(e,t){"use strict";function n(e,t){if(e===t)return!0;if("object"!=typeof e||null===e||"object"!=typeof t||null===t)return!1;var n=Object.keys(e),o=Object.keys(t);if(n.length!==o.length)return!1;for(var i=r.bind(t),a=0;a-1&&e%1==0&&c>=e}function u(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function l(e){return!!e&&"object"==typeof e}var c=9007199254740991,f="[object Arguments]",d="[object Function]",p="[object GeneratorFunction]",h=Object.prototype,m=h.hasOwnProperty,v=h.toString,g=h.propertyIsEnumerable,y=n("length");e.exports=r},function(e,t){function n(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}e.exports=n},function(e,t,n){var r;(function(e,o){(function(){function i(e,t){return e.set(t[0],t[1]),e}function a(e,t){return e.add(t),e}function s(e,t,n){var r=n.length;switch(r){case 0:return e.call(t);case 1:return e.call(t,n[0]);case 2:return e.call(t,n[0],n[1]);case 3:return e.call(t,n[0],n[1],n[2])}return e.apply(t,n)}function u(e,t,n,r){for(var o=-1,i=e.length;++o-1}function m(e,t,n){for(var r=-1,o=e.length;++r-1;);return n}function D(e,t){for(var n=e.length;n--&&P(t,e[n],0)>-1;);return n}function I(e){return e&&e.Object===Object?e:null}function z(e,t){if(e!==t){var n=null===e,r=e===te,o=e===e,i=null===t,a=t===te,s=t===t;if(e>t&&!i||!o||n&&!a&&s||r&&s)return 1;if(t>e&&!n||!s||i&&!r&&o||a&&o)return-1}return 0}function H(e,t,n){for(var r=-1,o=e.criteria,i=t.criteria,a=o.length,s=n.length;++r=s)return u;var l=n[r];return u*("desc"==l?-1:1)}}return e.index-t.index}function W(e,t){for(var n=e.length,r=0;n--;)e[n]===t&&r++;return r}function F(e){return function(t,n){var r;return t===te&&n===te?0:(t!==te&&(r=t),n!==te&&(r=r===te?n:e(r,n)),r)}}function q(e){return Ln[e]}function U(e){return jn[e]}function X(e){return"\\"+In[e]}function V(e,t,n){for(var r=e.length,o=t+(n?0:-1);n?o--:++o-1&&e%1==0&&t>e}function G(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function J(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function K(e,t){for(var n=-1,r=e.length,o=0,i=[];++nt,o=n?e.length:0,i=So(0,o,this.__views__),a=i.start,s=i.end,u=s-a,l=r?s:a-1,c=this.__iteratees__,f=c.length,d=0,p=Hl(u,this.__takeCount__);if(!n||re>o||o==u&&p==u)return Or(e,this.__actions__);var h=[];e:for(;u--&&p>d;){l+=t;for(var m=-1,v=e[l];++mn)return!1;var r=e.length-1;return n==r?e.pop():Sl.call(e,n,1),!0}function sn(e,t){var n=ln(e,t);return 0>n?te:e[n][1]}function un(e,t){return ln(e,t)>-1}function ln(e,t){for(var n=e.length;n--;)if(qa(e[n][0],t))return n;return-1}function cn(e,t,n){var r=ln(e,t);0>r?e.push([t,n]):e[r][1]=n}function fn(e,t,n,r){return e===te||qa(e,cl[n])&&!pl.call(r,n)?t:e}function dn(e,t,n){(n===te||qa(e[t],n))&&("number"!=typeof t||n!==te||t in e)||(e[t]=n)}function pn(e,t,n){var r=e[t];pl.call(e,t)&&qa(r,n)&&(n!==te||t in e)||(e[t]=n)}function hn(e,t,n,r){return sc(e,function(e,o,i){t(r,e,n(e),i)}),r}function mn(e,t){return e&&Kr(t,Zs(t),e)}function vn(e,t){for(var n=-1,r=null==e,o=t.length,i=Array(o);++n=e?e:n),t!==te&&(e=e>=t?e:t)),e}function yn(e,t,n,r,o,i,a){var s;if(r&&(s=i?r(e,o,i,a):r(e)),s!==te)return s;if(!is(e))return e;var u=Qc(e);if(u){if(s=Lo(e),!t)return Jr(e,s)}else{var l=Mo(e),f=l==He||l==We;if(_c(e))return Hr(e,t);if(l==Ue||l==je||f&&!i){if(B(e))return i?e:{};if(s=jo(f?{}:e),!t)return Yr(e,mn(s,e))}else{if(!On[l])return i?e:{};s=Ro(e,l,yn,t)}}a||(a=new $t);var d=a.get(e);if(d)return d;if(a.set(e,s),!u)var p=n?xo(e):Zs(e);return c(p||e,function(o,i){p&&(i=o,o=e[i]),pn(s,i,yn(o,t,n,r,i,e,a))}),s}function bn(e){var t=Zs(e),n=t.length;return function(r){if(null==r)return!n;for(var o=n;o--;){var i=t[o],a=e[i],s=r[i];if(s===te&&!(i in Object(r))||!a(s))return!1}return!0}}function xn(e){return is(e)?El(e):{}}function An(e,t,n){if("function"!=typeof e)throw new ul(oe);return Ml(function(){e.apply(te,n)},t)}function Pn(e,t,n,r){var o=-1,i=h,a=!0,s=e.length,u=[],l=t.length;if(!s)return u;n&&(t=v(t,L(n))),r?(i=m,a=!1):t.length>=re&&(i=Qt,a=!1,t=new Yt(t));e:for(;++on&&(n=-n>o?0:o+n),r=r===te||r>o?o:Ns(r),0>r&&(r+=o),r=n>r?0:Ms(r);r>n;)e[n++]=t;return e}function Rn(e,t){var n=[];return sc(e,function(e,r,o){t(e,r,o)&&n.push(e)}),n}function Dn(e,t,n,r,o){var i=-1,a=e.length;for(n||(n=Io),o||(o=[]);++i0&&n(s)?t>1?Dn(s,t-1,n,r,o):g(o,s):r||(o[o.length]=s)}return o}function In(e,t){return e&&lc(e,t,Zs)}function Wn(e,t){return e&&cc(e,t,Zs)}function Fn(e,t){return p(t,function(t){return ns(e[t])})}function Un(e,t){t=Wo(t,e)?[t]:Ir(t);for(var n=0,r=t.length;null!=e&&r>n;)e=e[t[n++]];return n&&n==r?e:te}function Xn(e,t,n){var r=t(e);return Qc(e)?r:g(r,n(e))}function Vn(e,t){return pl.call(e,t)||"object"==typeof e&&t in e&&null===Eo(e)}function Bn(e,t){return t in Object(e)}function Jn(e,t,n){return e>=Hl(t,n)&&e=120&&c.length>=120)?new Yt(a&&c):te}c=e[0];var f=-1,d=s[0];e:for(;++ft?n:0,Z(t,n)?e[t]:te}function cr(e,t,n){var r=-1;t=v(t.length?t:[zu],L(ko()));var o=or(e,function(e,n,o){var i=v(t,function(t){return t(e)});return{criteria:i,index:++r,value:e}});return N(o,function(e,t){return H(e,t,n)})}function fr(e,t){return e=Object(e),y(t,function(t,n){return n in e&&(t[n]=e[n]),t},{})}function dr(e,t){for(var n=-1,r=Ao(e),o=r.length,i={};++n-1;)s!==e&&Sl.call(s,u,1),Sl.call(e,u,1);return e}function vr(e,t){for(var n=e?t.length:0,r=n-1;n--;){var o=t[n];if(r==n||o!=i){var i=o;if(Z(o))Sl.call(e,o,1);else if(Wo(o,e))delete e[o];else{var a=Ir(o),s=Go(e,a);null!=s&&delete s[vi(a)]}}}return e}function gr(e,t){return e+Ll(Fl()*(t-e+1))}function yr(e,t,n,r){for(var o=-1,i=zl(Ol((t-e)/(n||1)),0),a=Array(i);i--;)a[r?i:++o]=e,e+=n;return a}function br(e,t){var n="";if(!e||1>t||t>Ee)return n;do t%2&&(n+=e),t=Ll(t/2),t&&(e+=e);while(t);return n}function xr(e,t,n,r){t=Wo(t,e)?[t]:Ir(t);for(var o=-1,i=t.length,a=i-1,s=e;null!=s&&++ot&&(t=-t>o?0:o+t),n=n>o?o:n,0>n&&(n+=o),o=t>n?0:n-t>>>0,t>>>=0;for(var i=Array(o);++r=o){for(;o>r;){var i=r+o>>>1,a=e[i];(n?t>=a:t>a)&&null!==a?r=i+1:o=i}return o}return Pr(e,t,zu,n)}function Pr(e,t,n,r){t=n(t);for(var o=0,i=e?e.length:0,a=t!==t,s=null===t,u=t===te;i>o;){var l=Ll((o+i)/2),c=n(e[l]),f=c!==te,d=c===c;if(a)var p=d||r;else p=s?d&&f&&(r||null!=c):u?d&&(r||f):null==c?!1:r?t>=c:t>c;p?o=l+1:i=l}return Hl(i,Oe)}function Cr(e){return Tr(e)}function Tr(e,t){for(var n=0,r=e.length,o=e[0],i=t?t(o):o,a=i,s=1,u=[o];++n=re){var l=t?null:dc(e);if(l)return Y(l);a=!1,o=Qt,u=new Yt}else u=t?[]:s;e:for(;++rr?t[r]:te;n(a,e[r],s)}return a}function Rr(e){return Ga(e)?e:[]}function Dr(e){return"function"==typeof e?e:zu}function Ir(e){return Qc(e)?e:gc(e)}function zr(e,t,n){var r=e.length;return n=n===te?r:n,!t&&n>=r?e:Ar(e,t,n)}function Hr(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}function Wr(e){var t=new e.constructor(e.byteLength);return new wl(t).set(new wl(e)),t}function Fr(e,t){var n=t?Wr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function qr(e,t,n){var r=t?n(J(e),!0):J(e);return y(r,i,new e.constructor)}function Ur(e){var t=new e.constructor(e.source,Nt.exec(e));return t.lastIndex=e.lastIndex,t}function Xr(e,t,n){var r=t?n(Y(e),!0):Y(e);return y(r,a,new e.constructor)}function Vr(e){return ic?Object(ic.call(e)):{}}function Br(e,t){var n=t?Wr(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Zr(e,t,n,r){for(var o=-1,i=e.length,a=n.length,s=-1,u=t.length,l=zl(i-a,0),c=Array(u+l),f=!r;++so)&&(c[n[o]]=e[o]);for(;l--;)c[s++]=e[o++];return c}function Gr(e,t,n,r){for(var o=-1,i=e.length,a=-1,s=n.length,u=-1,l=t.length,c=zl(i-s,0),f=Array(c+l),d=!r;++oo)&&(f[p+n[a]]=e[o++]);return f}function Jr(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n1?n[o-1]:te,a=o>2?n[2]:te;for(i="function"==typeof i?(o--,i):te,a&&Ho(n[0],n[1],a)&&(i=3>o?te:i,o=1),t=Object(t);++ri&&a[0]!==l&&a[i-1]!==l?[]:K(a,l);if(i-=c.length,n>i)return ho(e,t,so,r.placeholder,te,a,c,te,te,n-i);var f=this&&this!==Zn&&this instanceof r?o:e;return s(f,this,a)}var o=oo(e);return r}function ao(e){return Oa(function(t){t=Dn(t,1);var n=t.length,o=n,i=r.prototype.thru;for(e&&t.reverse();o--;){var a=t[o];if("function"!=typeof a)throw new ul(oe);if(i&&!s&&"wrapper"==wo(a))var s=new r([],!0)}for(o=s?o:n;++o=re)return s.plant(r).value();for(var o=0,i=n?t[o].apply(this,e):r;++og){var w=K(b,x);return ho(e,t,so,c.placeholder,n,b,w,s,u,l-g)}var k=d?n:this,P=p?k[e]:e;return g=b.length,s?b=Jo(b,s):m&&g>1&&b.reverse(),f&&g>u&&(b.length=u),this&&this!==Zn&&this instanceof c&&(P=v||oo(P)),P.apply(k,b)}var f=t&he,d=t&se,p=t&ue,h=t&(ce|fe),m=t&ve,v=p?te:oo(e);return c}function uo(e,t){return function(n,r){return Yn(n,e,t(r),{})}}function lo(e){return Oa(function(t){return t=1==t.length&&Qc(t[0])?v(t[0],L(ko())):v(Dn(t,1,zo),L(ko())),Oa(function(n){var r=this;return e(t,function(e){return s(e,r,n)})})})}function co(e,t){t=t===te?" ":t+"";var n=t.length;if(2>n)return n?br(t,e):t;var r=br(t,Ol(e/Q(t)));return Tn.test(t)?zr(_(r),0,e).join(""):r.slice(0,e)}function fo(e,t,n,r){function o(){for(var t=-1,u=arguments.length,l=-1,c=r.length,f=Array(c+u),d=this&&this!==Zn&&this instanceof o?a:e;++lt?1:-1:Ss(r)||0,yr(t,n,r,e)}}function ho(e,t,n,r,o,i,a,s,u,l){var c=t&ce,f=c?a:te,d=c?te:a,p=c?i:te,h=c?te:i;t|=c?de:pe,t&=~(c?pe:de),t&le||(t&=~(se|ue));var m=[e,t,o,p,f,h,d,s,u,l],v=n.apply(te,m);return qo(e)&&vc(v,m),v.placeholder=r,v}function mo(e){var t=al[e];return function(e,n){if(e=Ss(e),n=Ns(n)){var r=(js(e)+"e").split("e"),o=t(r[0]+"e"+(+r[1]+n));return r=(js(o)+"e").split("e"),+(r[0]+"e"+(+r[1]-n))}return t(e)}}function vo(e,t,n,r,o,i,a,s){var u=t&ue;if(!u&&"function"!=typeof e)throw new ul(oe);var l=r?r.length:0;if(l||(t&=~(de|pe),r=o=te),a=a===te?a:zl(Ns(a),0),s=s===te?s:Ns(s),l-=o?o.length:0,t&pe){var c=r,f=o;r=o=te}var d=u?te:pc(e),p=[e,t,n,r,o,c,f,i,a,s];if(d&&Bo(p,d),e=p[0],t=p[1],n=p[2],r=p[3],o=p[4],s=p[9]=null==p[9]?u?0:e.length:zl(p[9]-l,0),!s&&t&(ce|fe)&&(t&=~(ce|fe)),t&&t!=se)h=t==ce||t==fe?io(e,t,s):t!=de&&t!=(se|de)||o.length?so.apply(te,p):fo(e,t,n,r);else var h=to(e,t,n);var m=d?fc:vc;return m(h,p)}function go(e,t,n,r,o,i){var a=-1,s=o&ye,u=o&ge,l=e.length,c=t.length;if(l!=c&&!(s&&c>l))return!1;var f=i.get(e);if(f)return f==t;var d=!0;for(i.set(e,t);++ao,a=r==he&&n==ce||r==he&&n==me&&e[7].length<=t[8]||r==(he|me)&&t[7].length<=t[8]&&n==ce;if(!i&&!a)return e;r&se&&(e[2]=t[2],o|=n&se?0:le);var s=t[3];if(s){var u=e[3];e[3]=u?Zr(u,s,t[4]):s,e[4]=u?K(e[3],ae):t[4]}return s=t[5],s&&(u=e[5],e[5]=u?Gr(u,s,t[6]):s,e[6]=u?K(e[5],ae):t[6]),s=t[7],s&&(e[7]=s),r&he&&(e[8]=null==e[8]?t[8]:Hl(e[8],t[8])),null==e[9]&&(e[9]=t[9]),e[0]=t[0],e[1]=o,e}function Zo(e,t,n,r,o,i){return is(e)&&is(t)&&sr(e,t,te,Zo,i.set(t,e)),e}function Go(e,t){return 1==t.length?e:Un(e,Ar(t,0,-1))}function Jo(e,t){for(var n=e.length,r=Hl(t.length,n),o=Jr(e);r--;){var i=t[r];e[r]=Z(i,n)?o[i]:te}return e}function Ko(e){return"string"==typeof e||xs(e)?e:e+""; +}function Yo(e){if(null!=e){try{return dl.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function Qo(e){if(e instanceof o)return e.clone();var t=new r(e.__wrapped__,e.__chain__);return t.__actions__=Jr(e.__actions__),t.__index__=e.__index__,t.__values__=e.__values__,t}function _o(e,t,n){t=(n?Ho(e,t,n):t===te)?1:zl(Ns(t),0);var r=e?e.length:0;if(!r||1>t)return[];for(var o=0,i=0,a=Array(Ol(r/t));r>o;)a[i++]=Ar(e,o,o+=t);return a}function $o(e){for(var t=-1,n=e?e.length:0,r=0,o=[];++te)return e?Jr(t):[];for(var n=Array(e-1);e--;)n[e-1]=arguments[e];return l(t,Dn(n,1))}function ti(e,t,n){var r=e?e.length:0;return r?(t=n||t===te?1:Ns(t),Ar(e,0>t?0:t,r)):[]}function ni(e,t,n){var r=e?e.length:0;return r?(t=n||t===te?1:Ns(t),t=r-t,Ar(e,0,0>t?0:t)):[]}function ri(e,t){return e&&e.length?Sr(e,ko(t,3),!0,!0):[]}function oi(e,t){return e&&e.length?Sr(e,ko(t,3),!0):[]}function ii(e,t,n,r){var o=e?e.length:0;return o?(n&&"number"!=typeof n&&Ho(e,t,n)&&(n=0,r=o),jn(e,t,n,r)):[]}function ai(e,t){return e&&e.length?k(e,ko(t,3)):-1}function si(e,t){return e&&e.length?k(e,ko(t,3),!0):-1}function ui(e){var t=e?e.length:0;return t?Dn(e,1):[]}function li(e){var t=e?e.length:0;return t?Dn(e,Te):[]}function ci(e,t){var n=e?e.length:0;return n?(t=t===te?1:Ns(t),Dn(e,t)):[]}function fi(e){for(var t=-1,n=e?e.length:0,r={};++tn&&(n=zl(r+n,0)),P(e,t,n)):-1}function hi(e){return ni(e,1)}function mi(e,t){return e?Dl.call(e,t):""}function vi(e){var t=e?e.length:0;return t?e[t-1]:te}function gi(e,t,n){var r=e?e.length:0;if(!r)return-1;var o=r;if(n!==te&&(o=Ns(n),o=(0>o?zl(r+o,0):Hl(o,r-1))+1),t!==t)return V(e,o,!0);for(;o--;)if(e[o]===t)return o;return-1}function yi(e,t){return e&&e.length?lr(e,Ns(t)):te}function bi(e,t){return e&&e.length&&t&&t.length?mr(e,t):e}function xi(e,t,n){return e&&e.length&&t&&t.length?mr(e,t,ko(n)):e}function Ai(e,t,n){return e&&e.length&&t&&t.length?mr(e,t,te,n):e}function wi(e,t){var n=[];if(!e||!e.length)return n;var r=-1,o=[],i=e.length;for(t=ko(t,3);++rr&&qa(e[r],t))return r}return-1}function Ni(e,t){return kr(e,t,!0)}function Mi(e,t,n){return Pr(e,t,ko(n),!0)}function Si(e,t){var n=e?e.length:0;if(n){var r=kr(e,t,!0)-1;if(qa(e[r],t))return r}return-1}function Oi(e){return e&&e.length?Cr(e):[]}function Li(e,t){return e&&e.length?Tr(e,ko(t)):[]}function ji(e){return ti(e,1)}function Ri(e,t,n){return e&&e.length?(t=n||t===te?1:Ns(t),Ar(e,0,0>t?0:t)):[]}function Di(e,t,n){var r=e?e.length:0;return r?(t=n||t===te?1:Ns(t),t=r-t,Ar(e,0>t?0:t,r)):[]}function Ii(e,t){return e&&e.length?Sr(e,ko(t,3),!1,!0):[]}function zi(e,t){return e&&e.length?Sr(e,ko(t,3)):[]}function Hi(e){return e&&e.length?Er(e):[]}function Wi(e,t){return e&&e.length?Er(e,ko(t)):[]}function Fi(e,t){return e&&e.length?Er(e,te,t):[]}function qi(e){if(!e||!e.length)return[];var t=0;return e=p(e,function(e){return Ga(e)?(t=zl(e.length,t),!0):void 0}),S(t,function(t){return v(e,pr(t))})}function Ui(e,t){if(!e||!e.length)return[];var n=qi(e);return null==t?n:v(n,function(e){return s(t,te,e)})}function Xi(e,t){return jr(e||[],t||[],pn)}function Vi(e,t){return jr(e||[],t||[],xr)}function Bi(e){var n=t(e);return n.__chain__=!0,n}function Zi(e,t){return t(e),e}function Gi(e,t){return t(e)}function Ji(){return Bi(this)}function Ki(){return new r(this.value(),this.__chain__)}function Yi(){this.__values__===te&&(this.__values__=Es(this.value()));var e=this.__index__>=this.__values__.length,t=e?te:this.__values__[this.__index__++];return{done:e,value:t}}function Qi(){return this}function _i(e){for(var t,r=this;r instanceof n;){var o=Qo(r);o.__index__=0,o.__values__=te,t?i.__wrapped__=o:t=o;var i=o;r=r.__wrapped__}return i.__wrapped__=e,t}function $i(){var e=this.__wrapped__;if(e instanceof o){var t=e;return this.__actions__.length&&(t=new o(this)),t=t.reverse(),t.__actions__.push({func:Gi,args:[ki],thisArg:te}),new r(t,this.__chain__)}return this.thru(ki)}function ea(){return Or(this.__wrapped__,this.__actions__)}function ta(e,t,n){var r=Qc(e)?d:Ln;return n&&Ho(e,t,n)&&(t=te),r(e,ko(t,3))}function na(e,t){var n=Qc(e)?p:Rn;return n(e,ko(t,3))}function ra(e,t){if(t=ko(t,3),Qc(e)){var n=k(e,t);return n>-1?e[n]:te}return w(e,t,sc)}function oa(e,t){if(t=ko(t,3),Qc(e)){var n=k(e,t,!0);return n>-1?e[n]:te}return w(e,t,uc)}function ia(e,t){return Dn(fa(e,t),1)}function aa(e,t){return Dn(fa(e,t),Te)}function sa(e,t,n){return n=n===te?1:Ns(n),Dn(fa(e,t),n)}function ua(e,t){return"function"==typeof t&&Qc(e)?c(e,t):sc(e,ko(t))}function la(e,t){return"function"==typeof t&&Qc(e)?f(e,t):uc(e,ko(t))}function ca(e,t,n,r){e=Za(e)?e:su(e),n=n&&!r?Ns(n):0;var o=e.length;return 0>n&&(n=zl(o+n,0)),bs(e)?o>=n&&e.indexOf(t,n)>-1:!!o&&P(e,t,n)>-1}function fa(e,t){var n=Qc(e)?v:or;return n(e,ko(t,3))}function da(e,t,n,r){return null==e?[]:(Qc(t)||(t=null==t?[]:[t]),n=r?te:n,Qc(n)||(n=null==n?[]:[n]),cr(e,t,n))}function pa(e,t,n){var r=Qc(e)?y:E,o=arguments.length<3;return r(e,ko(t,4),n,o,sc)}function ha(e,t,n){var r=Qc(e)?b:E,o=arguments.length<3;return r(e,ko(t,4),n,o,uc)}function ma(e,t){var n=Qc(e)?p:Rn;return t=ko(t,3),n(e,function(e,n,r){return!t(e,n,r)})}function va(e){var t=Za(e)?e:su(e),n=t.length;return n>0?t[gr(0,n-1)]:te}function ga(e,t,n){var r=-1,o=Es(e),i=o.length,a=i-1;for(t=(n?Ho(e,t,n):t===te)?1:gn(Ns(t),0,i);++r0&&(n=t.apply(this,arguments)),1>=e&&(t=te),n}}function Pa(e,t,n){t=n?te:t;var r=vo(e,ce,te,te,te,te,te,t);return r.placeholder=Pa.placeholder,r}function Ca(e,t,n){t=n?te:t;var r=vo(e,fe,te,te,te,te,te,t);return r.placeholder=Ca.placeholder,r}function Ta(e,t,n){function r(t){var n=d,r=p;return d=p=te,y=t,m=e.apply(r,n)}function o(e){return y=e,v=Ml(s,t),b?r(e):m}function i(e){var n=e-g,r=e-y,o=t-n;return x?Hl(o,h-r):o}function a(e){var n=e-g,r=e-y;return!g||n>=t||0>n||x&&r>=h}function s(){var e=Uc();return a(e)?u(e):void(v=Ml(s,i(e)))}function u(e){return kl(v),v=te,A&&d?r(e):(d=p=te,m)}function l(){v!==te&&kl(v),g=y=0,d=p=v=te}function c(){return v===te?m:u(Uc())}function f(){var e=Uc(),n=a(e);if(d=arguments,p=this,g=e,n){if(v===te)return o(g);if(x)return kl(v),v=Ml(s,t),r(g)}return v===te&&(v=Ml(s,t)),m}var d,p,h,m,v,g=0,y=0,b=!1,x=!1,A=!0;if("function"!=typeof e)throw new ul(oe);return t=Ss(t)||0,is(n)&&(b=!!n.leading,x="maxWait"in n,h=x?zl(Ss(n.maxWait)||0,t):h,A="trailing"in n?!!n.trailing:A),f.cancel=l,f.flush=c,f}function Ea(e){return vo(e,ve)}function Na(e,t){if("function"!=typeof e||t&&"function"!=typeof t)throw new ul(oe);var n=function(){var r=arguments,o=t?t.apply(this,r):r[0],i=n.cache;if(i.has(o))return i.get(o);var a=e.apply(this,r);return n.cache=i.set(o,a),a};return n.cache=new(Na.Cache||Vt),n}function Ma(e){if("function"!=typeof e)throw new ul(oe);return function(){return!e.apply(this,arguments)}}function Sa(e){return ka(2,e)}function Oa(e,t){if("function"!=typeof e)throw new ul(oe);return t=zl(t===te?e.length-1:Ns(t),0),function(){for(var n=arguments,r=-1,o=zl(n.length-t,0),i=Array(o);++rt}function Xa(e,t){return e>=t}function Va(e){return Ga(e)&&pl.call(e,"callee")&&(!Nl.call(e,"callee")||vl.call(e)==je)}function Ba(e){return as(e)&&vl.call(e)==Ye}function Za(e){return null!=e&&os(hc(e))&&!ns(e)}function Ga(e){return as(e)&&Za(e)}function Ja(e){return e===!0||e===!1||as(e)&&vl.call(e)==De}function Ka(e){return as(e)&&vl.call(e)==Ie}function Ya(e){return!!e&&1===e.nodeType&&as(e)&&!ms(e)}function Qa(e){if(Za(e)&&(Qc(e)||bs(e)||ns(e.splice)||Va(e)||_c(e)))return!e.length;if(as(e)){var t=Mo(e);if(t==Fe||t==Be)return!e.size}for(var n in e)if(pl.call(e,n))return!1;return!(Ql&&Zs(e).length)}function _a(e,t){return _n(e,t)}function $a(e,t,n){n="function"==typeof n?n:te;var r=n?n(e,t):te;return r===te?_n(e,t,n):!!r}function es(e){return as(e)?vl.call(e)==ze||"string"==typeof e.message&&"string"==typeof e.name:!1}function ts(e){return"number"==typeof e&&Rl(e)}function ns(e){var t=is(e)?vl.call(e):"";return t==He||t==We}function rs(e){return"number"==typeof e&&e==Ns(e)}function os(e){return"number"==typeof e&&e>-1&&e%1==0&&Ee>=e}function is(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function as(e){return!!e&&"object"==typeof e}function ss(e){return as(e)&&Mo(e)==Fe}function us(e,t){return e===t||er(e,t,Po(t))}function ls(e,t,n){return n="function"==typeof n?n:te,er(e,t,Po(t),n)}function cs(e){return hs(e)&&e!=+e}function fs(e){if(!is(e))return!1;var t=ns(e)||B(e)?yl:Lt;return t.test(Yo(e))}function ds(e){return null===e}function ps(e){return null==e}function hs(e){return"number"==typeof e||as(e)&&vl.call(e)==qe}function ms(e){if(!as(e)||vl.call(e)!=Ue||B(e))return!1;var t=Eo(e);if(null===t)return!0;var n=pl.call(t,"constructor")&&t.constructor;return"function"==typeof n&&n instanceof n&&dl.call(n)==ml}function vs(e){return is(e)&&vl.call(e)==Ve}function gs(e){return rs(e)&&e>=-Ee&&Ee>=e}function ys(e){return as(e)&&Mo(e)==Be}function bs(e){return"string"==typeof e||!Qc(e)&&as(e)&&vl.call(e)==Ze}function xs(e){return"symbol"==typeof e||as(e)&&vl.call(e)==Ge}function As(e){return as(e)&&os(e.length)&&!!Sn[vl.call(e)]}function ws(e){return e===te}function ks(e){return as(e)&&Mo(e)==Je}function Ps(e){return as(e)&&vl.call(e)==Ke}function Cs(e,t){return t>e}function Ts(e,t){return t>=e}function Es(e){if(!e)return[];if(Za(e))return bs(e)?_(e):Jr(e);if(Tl&&e[Tl])return G(e[Tl]());var t=Mo(e),n=t==Fe?J:t==Be?Y:su;return n(e)}function Ns(e){if(!e)return 0===e?e:0;if(e=Ss(e),e===Te||e===-Te){var t=0>e?-1:1;return t*Ne}var n=e%1;return e===e?n?e-n:e:0}function Ms(e){return e?gn(Ns(e),0,Se):0}function Ss(e){if("number"==typeof e)return e;if(xs(e))return Me;if(is(e)){var t=ns(e.valueOf)?e.valueOf():e;e=is(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(wt,"");var n=Ot.test(e);return n||jt.test(e)?Hn(e.slice(2),n?2:8):St.test(e)?Me:+e}function Os(e){return Kr(e,Gs(e))}function Ls(e){return gn(Ns(e),-Ee,Ee)}function js(e){if("string"==typeof e)return e;if(null==e)return"";if(xs(e))return ac?ac.call(e):"";var t=e+"";return"0"==t&&1/e==-Te?"-0":t}function Rs(e,t){var n=xn(e);return t?mn(n,t):n}function Ds(e,t){return w(e,ko(t,3),In,!0)}function Is(e,t){return w(e,ko(t,3),Wn,!0)}function zs(e,t){return null==e?e:lc(e,ko(t),Gs)}function Hs(e,t){return null==e?e:cc(e,ko(t),Gs)}function Ws(e,t){return e&&In(e,ko(t))}function Fs(e,t){return e&&Wn(e,ko(t))}function qs(e){return null==e?[]:Fn(e,Zs(e))}function Us(e){return null==e?[]:Fn(e,Gs(e))}function Xs(e,t,n){var r=null==e?te:Un(e,t);return r===te?n:r}function Vs(e,t){return null!=e&&Oo(e,t,Vn)}function Bs(e,t){return null!=e&&Oo(e,t,Bn)}function Zs(e){var t=Uo(e);if(!t&&!Za(e))return nr(e);var n=Do(e),r=!!n,o=n||[],i=o.length;for(var a in e)!Vn(e,a)||r&&("length"==a||Z(a,i))||t&&"constructor"==a||o.push(a);return o}function Gs(e){for(var t=-1,n=Uo(e),r=rr(e),o=r.length,i=Do(e),a=!!i,s=i||[],u=s.length;++tt){var r=e;e=t,t=r}if(n||e%1||t%1){var o=Fl();return Hl(e+o*(t-e+zn("1e-"+((o+"").length-1))),t)}return gr(e,t)}function du(e){return Af(js(e).toLowerCase())}function pu(e){return e=js(e),e&&e.replace(Dt,q).replace(kn,"")}function hu(e,t,n){e=js(e),t="string"==typeof t?t:t+"";var r=e.length;return n=n===te?r:gn(Ns(n),0,r),n-=t.length,n>=0&&e.indexOf(t,n)==n}function mu(e){return e=js(e),e&&pt.test(e)?e.replace(ft,U):e}function vu(e){return e=js(e),e&&At.test(e)?e.replace(xt,"\\$&"):e}function gu(e,t,n){e=js(e),t=Ns(t);var r=t?Q(e):0;if(!t||r>=t)return e;var o=(t-r)/2;return co(Ll(o),n)+e+co(Ol(o),n)}function yu(e,t,n){e=js(e),t=Ns(t);var r=t?Q(e):0;return t&&t>r?e+co(t-r,n):e}function bu(e,t,n){e=js(e),t=Ns(t);var r=t?Q(e):0;return t&&t>r?co(t-r,n)+e:e}function xu(e,t,n){return n||null==t?t=0:t&&(t=+t),e=js(e).replace(wt,""),Wl(e,t||(Mt.test(e)?16:10))}function Au(e,t,n){return t=(n?Ho(e,t,n):t===te)?1:Ns(t),br(js(e),t)}function wu(){var e=arguments,t=js(e[0]);return e.length<3?t:ql.call(t,e[1],e[2])}function ku(e,t,n){return n&&"number"!=typeof n&&Ho(e,t,n)&&(t=n=te),(n=n===te?Se:n>>>0)?(e=js(e),e&&("string"==typeof t||null!=t&&!vs(t))&&(t+="",""==t&&Tn.test(e))?zr(_(e),0,n):Xl.call(e,t,n)):[]}function Pu(e,t,n){return e=js(e),n=gn(Ns(n),0,e.length),e.lastIndexOf(t,n)==n}function Cu(e,n,r){var o=t.templateSettings;r&&Ho(e,n,r)&&(n=te),e=js(e),n=tf({},n,o,fn);var i,a,s=tf({},n.imports,o.imports,fn),u=Zs(s),l=j(s,u),c=0,f=n.interpolate||It,d="__p += '",p=sl((n.escape||It).source+"|"+f.source+"|"+(f===vt?Et:It).source+"|"+(n.evaluate||It).source+"|$","g"),h="//# sourceURL="+("sourceURL"in n?n.sourceURL:"lodash.templateSources["+ ++Mn+"]")+"\n";e.replace(p,function(t,n,r,o,s,u){return r||(r=o),d+=e.slice(c,u).replace(zt,X),n&&(i=!0,d+="' +\n__e("+n+") +\n'"),s&&(a=!0,d+="';\n"+s+";\n__p += '"),r&&(d+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),c=u+t.length,t}),d+="';\n";var m=n.variable;m||(d="with (obj) {\n"+d+"\n}\n"),d=(a?d.replace(st,""):d).replace(ut,"$1").replace(lt,"$1;"),d="function("+(m||"obj")+") {\n"+(m?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(a?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+d+"return __p\n}";var v=wf(function(){return Function(u,h+"return "+d).apply(te,l)});if(v.source=d,es(v))throw v;return v}function Tu(e){return js(e).toLowerCase()}function Eu(e){return js(e).toUpperCase()}function Nu(e,t,n){if(e=js(e),!e)return e;if(n||t===te)return e.replace(wt,"");if(!(t+=""))return e;var r=_(e),o=_(t),i=R(r,o),a=D(r,o)+1;return zr(r,i,a).join("")}function Mu(e,t,n){if(e=js(e),!e)return e;if(n||t===te)return e.replace(Pt,"");if(!(t+=""))return e;var r=_(e),o=D(r,_(t))+1;return zr(r,0,o).join("")}function Su(e,t,n){if(e=js(e),!e)return e;if(n||t===te)return e.replace(kt,"");if(!(t+=""))return e;var r=_(e),o=R(r,_(t));return zr(r,o).join("")}function Ou(e,t){var n=be,r=xe;if(is(t)){var o="separator"in t?t.separator:o;n="length"in t?Ns(t.length):n,r="omission"in t?js(t.omission):r}e=js(e);var i=e.length;if(Tn.test(e)){var a=_(e);i=a.length}if(n>=i)return e;var s=n-Q(r);if(1>s)return r;var u=a?zr(a,0,s).join(""):e.slice(0,s);if(o===te)return u+r;if(a&&(s+=u.length-s),vs(o)){if(e.slice(s).search(o)){var l,c=u;for(o.global||(o=sl(o.source,js(Nt.exec(o))+"g")),o.lastIndex=0;l=o.exec(c);)var f=l.index;u=u.slice(0,f===te?s:f)}}else if(e.indexOf(o,s)!=s){var d=u.lastIndexOf(o);d>-1&&(u=u.slice(0,d))}return u+r}function Lu(e){return e=js(e),e&&dt.test(e)?e.replace(ct,$):e}function ju(e,t,n){return e=js(e),t=n?te:t,t===te&&(t=En.test(e)?Cn:Ct),e.match(t)||[]}function Ru(e){var t=e?e.length:0,n=ko();return e=t?v(e,function(e){if("function"!=typeof e[1])throw new ul(oe);return[n(e[0]),e[1]]}):[],Oa(function(n){for(var r=-1;++re||e>Ee)return[];var n=Se,r=Hl(e,Se);t=ko(t),e-=Se;for(var o=S(r,t);++n0){if(++e>=Ae)return n}else e=0;return fc(n,r)}}(),gc=Na(function(e){var t=[];return js(e).replace(bt,function(e,n,r,o){t.push(r?o.replace(Tt,"$1"):n||e)}),t}),yc=Oa(function(e,t){return Ga(e)?Pn(e,Dn(t,1,Ga,!0)):[]}),bc=Oa(function(e,t){var n=vi(t);return Ga(n)&&(n=te),Ga(e)?Pn(e,Dn(t,1,Ga,!0),ko(n)):[]}),xc=Oa(function(e,t){var n=vi(t);return Ga(n)&&(n=te),Ga(e)?Pn(e,Dn(t,1,Ga,!0),te,n):[]}),Ac=Oa(function(e){var t=v(e,Rr);return t.length&&t[0]===e[0]?Kn(t):[]}),wc=Oa(function(e){var t=vi(e),n=v(e,Rr);return t===vi(n)?t=te:n.pop(),n.length&&n[0]===e[0]?Kn(n,ko(t)):[]}),kc=Oa(function(e){var t=vi(e),n=v(e,Rr);return t===vi(n)?t=te:n.pop(),n.length&&n[0]===e[0]?Kn(n,te,t):[]}),Pc=Oa(bi),Cc=Oa(function(e,t){t=v(Dn(t,1),String);var n=vn(e,t);return vr(e,t.sort(z)),n}),Tc=Oa(function(e){return Er(Dn(e,1,Ga,!0))}),Ec=Oa(function(e){var t=vi(e);return Ga(t)&&(t=te),Er(Dn(e,1,Ga,!0),ko(t))}),Nc=Oa(function(e){var t=vi(e);return Ga(t)&&(t=te),Er(Dn(e,1,Ga,!0),te,t)}),Mc=Oa(function(e,t){return Ga(e)?Pn(e,t):[]}),Sc=Oa(function(e){return Lr(p(e,Ga))}),Oc=Oa(function(e){var t=vi(e);return Ga(t)&&(t=te),Lr(p(e,Ga),ko(t))}),Lc=Oa(function(e){var t=vi(e);return Ga(t)&&(t=te),Lr(p(e,Ga),te,t)}),jc=Oa(qi),Rc=Oa(function(e){var t=e.length,n=t>1?e[t-1]:te;return n="function"==typeof n?(e.pop(),n):te,Ui(e,n)}),Dc=Oa(function(e){e=Dn(e,1);var t=e.length,n=t?e[0]:0,i=this.__wrapped__,a=function(t){return vn(t,e)};return!(t>1||this.__actions__.length)&&i instanceof o&&Z(n)?(i=i.slice(n,+n+(t?1:0)),i.__actions__.push({func:Gi,args:[a],thisArg:te}),new r(i,this.__chain__).thru(function(e){return t&&!e.length&&e.push(te),e})):this.thru(a)}),Ic=Qr(function(e,t,n){pl.call(e,n)?++e[n]:e[n]=1}),zc=Qr(function(e,t,n){pl.call(e,n)?e[n].push(t):e[n]=[t]}),Hc=Oa(function(e,t,n){var r=-1,o="function"==typeof t,i=Wo(t),a=Za(e)?Array(e.length):[];return sc(e,function(e){var u=o?t:i&&null!=e?e[t]:te;a[++r]=u?s(u,e,n):Qn(e,t,n)}),a}),Wc=Qr(function(e,t,n){e[n]=t}),Fc=Qr(function(e,t,n){e[n?0:1].push(t)},function(){return[[],[]]}),qc=Oa(function(e,t){if(null==e)return[];var n=t.length;return n>1&&Ho(e,t[0],t[1])?t=[]:n>2&&Ho(t[0],t[1],t[2])&&(t=[t[0]]),t=1==t.length&&Qc(t[0])?t[0]:Dn(t,1,zo),cr(e,t,[])}),Uc=ol.now,Xc=Oa(function(e,t,n){var r=se;if(n.length){var o=K(n,To(Xc));r|=de}return vo(e,r,t,n,o)}),Vc=Oa(function(e,t,n){var r=se|ue;if(n.length){var o=K(n,To(Vc));r|=de}return vo(t,r,e,n,o)}),Bc=Oa(function(e,t){return An(e,1,t)}),Zc=Oa(function(e,t,n){return An(e,Ss(t)||0,n)});Na.Cache=Vt;var Gc=Oa(function(e,t){t=1==t.length&&Qc(t[0])?v(t[0],L(ko())):v(Dn(t,1,zo),L(ko()));var n=t.length;return Oa(function(r){for(var o=-1,i=Hl(r.length,n);++o0||0>t)?new o(n):(0>e?n=n.takeRight(-e):e&&(n=n.drop(e)),t!==te&&(t=Ns(t),n=0>t?n.dropRight(-t):n.take(t-e)),n)},o.prototype.takeRightWhile=function(e){return this.reverse().takeWhile(e).reverse()},o.prototype.toArray=function(){return this.take(Se)},In(o.prototype,function(e,n){var i=/^(?:filter|find|map|reject)|While$/.test(n),a=/^(?:head|last)$/.test(n),s=t[a?"take"+("last"==n?"Right":""):n],u=a||/^find/.test(n);s&&(t.prototype[n]=function(){var n=this.__wrapped__,l=a?[1]:arguments,c=n instanceof o,f=l[0],d=c||Qc(n),p=function(e){var n=s.apply(t,g([e],l));return a&&h?n[0]:n};d&&i&&"function"==typeof f&&1!=f.length&&(c=d=!1);var h=this.__chain__,m=!!this.__actions__.length,v=u&&!h,y=c&&!m;if(!u&&d){n=y?n:new o(this);var b=e.apply(n,l);return b.__actions__.push({func:Gi,args:[p],thisArg:te}),new r(b,h)}return v&&y?e.apply(this,l):(b=this.thru(p),v?a?b.value()[0]:b.value():b)})}),c(["pop","push","shift","sort","splice","unshift"],function(e){var n=ll[e],r=/^(?:push|sort|unshift)$/.test(e)?"tap":"thru",o=/^(?:pop|shift)$/.test(e);t.prototype[e]=function(){var e=arguments;if(o&&!this.__chain__){var t=this.value();return n.apply(Qc(t)?t:[],e)}return this[r](function(t){return n.apply(Qc(t)?t:[],e)})}}),In(o.prototype,function(e,n){var r=t[n];if(r){var o=r.name+"",i=_l[o]||(_l[o]=[]);i.push({name:n,func:r})}}),_l[so(te,ue).name]=[{name:"wrapper",func:te}],o.prototype.clone=I,o.prototype.reverse=Rt,o.prototype.value=Ht,t.prototype.at=Dc,t.prototype.chain=Ji,t.prototype.commit=Ki,t.prototype.next=Yi,t.prototype.plant=_i,t.prototype.reverse=$i,t.prototype.toJSON=t.prototype.valueOf=t.prototype.value=ea,Tl&&(t.prototype[Tl]=Qi),t}var te,ne="4.11.1",re=200,oe="Expected a function",ie="__lodash_hash_undefined__",ae="__lodash_placeholder__",se=1,ue=2,le=4,ce=8,fe=16,de=32,pe=64,he=128,me=256,ve=512,ge=1,ye=2,be=30,xe="...",Ae=150,we=16,ke=1,Pe=2,Ce=3,Te=1/0,Ee=9007199254740991,Ne=1.7976931348623157e308,Me=NaN,Se=4294967295,Oe=Se-1,Le=Se>>>1,je="[object Arguments]",Re="[object Array]",De="[object Boolean]",Ie="[object Date]",ze="[object Error]",He="[object Function]",We="[object GeneratorFunction]",Fe="[object Map]",qe="[object Number]",Ue="[object Object]",Xe="[object Promise]",Ve="[object RegExp]",Be="[object Set]",Ze="[object String]",Ge="[object Symbol]",Je="[object WeakMap]",Ke="[object WeakSet]",Ye="[object ArrayBuffer]",Qe="[object DataView]",_e="[object Float32Array]",$e="[object Float64Array]",et="[object Int8Array]",tt="[object Int16Array]",nt="[object Int32Array]",rt="[object Uint8Array]",ot="[object Uint8ClampedArray]",it="[object Uint16Array]",at="[object Uint32Array]",st=/\b__p \+= '';/g,ut=/\b(__p \+=) '' \+/g,lt=/(__e\(.*?\)|\b__t\)) \+\n'';/g,ct=/&(?:amp|lt|gt|quot|#39|#96);/g,ft=/[&<>"'`]/g,dt=RegExp(ct.source),pt=RegExp(ft.source),ht=/<%-([\s\S]+?)%>/g,mt=/<%([\s\S]+?)%>/g,vt=/<%=([\s\S]+?)%>/g,gt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,yt=/^\w*$/,bt=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]/g,xt=/[\\^$.*+?()[\]{}|]/g,At=RegExp(xt.source),wt=/^\s+|\s+$/g,kt=/^\s+/,Pt=/\s+$/,Ct=/[a-zA-Z0-9]+/g,Tt=/\\(\\)?/g,Et=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,Nt=/\w*$/,Mt=/^0x/i,St=/^[-+]0x[0-9a-f]+$/i,Ot=/^0b[01]+$/i,Lt=/^\[object .+?Constructor\]$/,jt=/^0o[0-7]+$/i,Rt=/^(?:0|[1-9]\d*)$/,Dt=/[\xc0-\xd6\xd8-\xde\xdf-\xf6\xf8-\xff]/g,It=/($^)/,zt=/['\n\r\u2028\u2029\\]/g,Ht="\\ud800-\\udfff",Wt="\\u0300-\\u036f\\ufe20-\\ufe23",Ft="\\u20d0-\\u20f0",qt="\\u2700-\\u27bf",Ut="a-z\\xdf-\\xf6\\xf8-\\xff",Xt="\\xac\\xb1\\xd7\\xf7",Vt="\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf",Bt="\\u2018\\u2019\\u201c\\u201d",Zt=" \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",Gt="A-Z\\xc0-\\xd6\\xd8-\\xde",Jt="\\ufe0e\\ufe0f",Kt=Xt+Vt+Bt+Zt,Yt="['’]",Qt="["+Ht+"]",_t="["+Kt+"]",$t="["+Wt+Ft+"]",en="\\d+",tn="["+qt+"]",nn="["+Ut+"]",rn="[^"+Ht+Kt+en+qt+Ut+Gt+"]",on="\\ud83c[\\udffb-\\udfff]",an="(?:"+$t+"|"+on+")",sn="[^"+Ht+"]",un="(?:\\ud83c[\\udde6-\\uddff]){2}",ln="[\\ud800-\\udbff][\\udc00-\\udfff]",cn="["+Gt+"]",fn="\\u200d",dn="(?:"+nn+"|"+rn+")",pn="(?:"+cn+"|"+rn+")",hn="(?:"+Yt+"(?:d|ll|m|re|s|t|ve))?",mn="(?:"+Yt+"(?:D|LL|M|RE|S|T|VE))?",vn=an+"?",gn="["+Jt+"]?",yn="(?:"+fn+"(?:"+[sn,un,ln].join("|")+")"+gn+vn+")*",bn=gn+vn+yn,xn="(?:"+[tn,un,ln].join("|")+")"+bn,An="(?:"+[sn+$t+"?",$t,un,ln,Qt].join("|")+")",wn=RegExp(Yt,"g"),kn=RegExp($t,"g"),Pn=RegExp(on+"(?="+on+")|"+An+bn,"g"),Cn=RegExp([cn+"?"+nn+"+"+hn+"(?="+[_t,cn,"$"].join("|")+")",pn+"+"+mn+"(?="+[_t,cn+dn,"$"].join("|")+")",cn+"?"+dn+"+"+hn,cn+"+"+mn,en,xn].join("|"),"g"),Tn=RegExp("["+fn+Ht+Wt+Ft+Jt+"]"),En=/[a-z][A-Z]|[A-Z]{2,}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Nn=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","Reflect","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],Mn=-1,Sn={};Sn[_e]=Sn[$e]=Sn[et]=Sn[tt]=Sn[nt]=Sn[rt]=Sn[ot]=Sn[it]=Sn[at]=!0,Sn[je]=Sn[Re]=Sn[Ye]=Sn[De]=Sn[Qe]=Sn[Ie]=Sn[ze]=Sn[He]=Sn[Fe]=Sn[qe]=Sn[Ue]=Sn[Ve]=Sn[Be]=Sn[Ze]=Sn[Je]=!1;var On={};On[je]=On[Re]=On[Ye]=On[Qe]=On[De]=On[Ie]=On[_e]=On[$e]=On[et]=On[tt]=On[nt]=On[Fe]=On[qe]=On[Ue]=On[Ve]=On[Be]=On[Ze]=On[Ge]=On[rt]=On[ot]=On[it]=On[at]=!0,On[ze]=On[He]=On[Je]=!1;var Ln={"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss"},jn={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"},Rn={"&":"&","<":"<",">":">",""":'"',"'":"'","`":"`"},Dn={"function":!0,object:!0},In={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},zn=parseFloat,Hn=parseInt,Wn=Dn[typeof t]&&t&&!t.nodeType?t:te,Fn=Dn[typeof e]&&e&&!e.nodeType?e:te,qn=Fn&&Fn.exports===Wn?Wn:te,Un=I(Wn&&Fn&&"object"==typeof o&&o),Xn=I(Dn[typeof self]&&self),Vn=I(Dn[typeof window]&&window),Bn=I(Dn[typeof this]&&this),Zn=Un||Vn!==(Bn&&Bn.window)&&Vn||Xn||Bn||Function("return this")(),Gn=ee();(Vn||Xn||{})._=Gn,r=function(){return Gn}.call(t,n,t,e),!(r!==te&&(e.exports=r))}).call(this)}).call(t,n(52)(e),function(){return this}())},function(e,t,n){"use strict";e.exports=n(116)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(232);Object.defineProperty(t,"Keyframes",{enumerable:!0,get:function(){return r(o)["default"]}});var i=n(231);Object.defineProperty(t,"Frame",{enumerable:!0,get:function(){return r(i)["default"]}})},function(e,t,n){"use strict";t.__esModule=!0;var r=n(2);t["default"]=r.PropTypes.shape({subscribe:r.PropTypes.func.isRequired,dispatch:r.PropTypes.func.isRequired,getState:r.PropTypes.func.isRequired})},function(e,t){"use strict";function n(e){"undefined"!=typeof console&&"function"==typeof console.error&&console.error(e);try{throw new Error(e)}catch(t){}}t.__esModule=!0,t["default"]=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e){return 0===e.button}function a(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function s(e){for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))return!1;return!0}function u(e,t){var n=t.query,r=t.hash,o=t.state;return n||r||o?{pathname:e,query:n,hash:r,state:o}:e}t.__esModule=!0;var l=Object.assign||function(e){for(var t=1;t=0;r--){var o=e[r],i=o.path||"";if(n=i.replace(/\/*$/,"/")+n,0===i.indexOf("/"))break}return"/"+n}},propTypes:{path:d,from:d,to:d.isRequired,query:p,state:p,onEnter:c.falsy,children:c.falsy},render:function(){s["default"](!1)}});t["default"]=h,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){return a({},e,{setRouteLeaveHook:t.listenBeforeLeavingRoute,isActive:t.isActive})}function i(e,t){return e=a({},e,t)}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t=0&&0===window.sessionStorage.length)return;throw n}}function a(e){var t=void 0;try{t=window.sessionStorage.getItem(o(e))}catch(n){if(n.name===c)return null}if(t)try{return JSON.parse(t)}catch(n){}return null}t.__esModule=!0,t.saveState=i,t.readState=a;var s=n(14),u=(r(s),"@@History/"),l=["QuotaExceededError","QUOTA_EXCEEDED_ERR"],c="SecurityError"},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){function t(e){return u.canUseDOM?void 0:s["default"](!1),n.listen(e)}var n=f["default"](i({getUserConfirmation:l.getUserConfirmation},e,{go:l.go}));return i({},n,{listen:t})}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t1?r-1:0),i=1;r>i;i++)o[i-1]=arguments[i];return t(y.createLocation.apply(y,[n(e)].concat(o)))}function m(e,t){"string"==typeof t&&(t=u.parsePath(t)),a(i({state:e},t))}function v(e,t){"string"==typeof t&&(t=u.parsePath(t)),l(i({state:e},t))}var g=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],y=e(g),b=g.basename;if(null==b&&s.canUseDOM){var x=document.getElementsByTagName("base")[0];x&&(b=x.getAttribute("href"))}return i({},y,{listenBefore:r,listen:o,push:a,replace:l,createPath:f,createHref:p,createLocation:h,pushState:d["default"](m,"pushState is deprecated; use push instead"),replaceState:d["default"](v,"replaceState is deprecated; use replace instead")})}}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t=e.childNodes.length?null:e.childNodes.item(n);e.insertBefore(t,r)}var o=n(268),i=n(128),a=n(12),s=n(51),u=n(76),l=n(1),c={dangerouslyReplaceNodeWithMarkup:o.dangerouslyReplaceNodeWithMarkup,updateTextContent:u,processUpdates:function(e,t){for(var n,a=null,c=null,f=0;f-1?void 0:a(!1),!l.plugins[n]){t.extractEvents?void 0:a(!1),l.plugins[n]=t;var r=t.eventTypes;for(var i in r)o(r[i],t,i)?void 0:a(!1)}}}function o(e,t,n){l.eventNameDispatchConfigs.hasOwnProperty(n)?a(!1):void 0,l.eventNameDispatchConfigs[n]=e;var r=e.phasedRegistrationNames;if(r){for(var o in r)if(r.hasOwnProperty(o)){var s=r[o];i(s,t,n)}return!0}return e.registrationName?(i(e.registrationName,t,n),!0):!1}function i(e,t,n){l.registrationNameModules[e]?a(!1):void 0,l.registrationNameModules[e]=t,l.registrationNameDependencies[e]=t.eventTypes[n].dependencies}var a=n(1),s=null,u={},l={plugins:[],eventNameDispatchConfigs:{},registrationNameModules:{},registrationNameDependencies:{},injectEventPluginOrder:function(e){s?a(!1):void 0,s=Array.prototype.slice.call(e),r()},injectEventPluginsByName:function(e){var t=!1;for(var n in e)if(e.hasOwnProperty(n)){var o=e[n];u.hasOwnProperty(n)&&u[n]===o||(u[n]?a(!1):void 0,u[n]=o,t=!0)}t&&r()},getPluginModuleForEvent:function(e){var t=e.dispatchConfig;if(t.registrationName)return l.registrationNameModules[t.registrationName]||null;for(var n in t.phasedRegistrationNames)if(t.phasedRegistrationNames.hasOwnProperty(n)){var r=l.registrationNameModules[t.phasedRegistrationNames[n]];if(r)return r}return null},_resetEventPlugins:function(){s=null;for(var e in u)u.hasOwnProperty(e)&&delete u[e];l.plugins.length=0;var t=l.eventNameDispatchConfigs;for(var n in t)t.hasOwnProperty(n)&&delete t[n];var r=l.registrationNameModules;for(var o in r)r.hasOwnProperty(o)&&delete r[o]}};e.exports=l},function(e,t,n){"use strict";function r(e){return(""+e).replace(x,"//")}function o(e,t){this.func=e,this.context=t,this.count=0}function i(e,t,n){var r=e.func,o=e.context;r.call(o,t,e.count++)}function a(e,t,n){if(null==e)return e;var r=o.getPooled(t,n);g(e,i,r),o.release(r)}function s(e,t,n,r){this.result=e,this.keyPrefix=t,this.func=n,this.context=r,this.count=0}function u(e,t,n){var o=e.result,i=e.keyPrefix,a=e.func,s=e.context,u=a.call(s,t,e.count++);Array.isArray(u)?l(u,o,n,v.thatReturnsArgument):null!=u&&(m.isValidElement(u)&&(u=m.cloneAndReplaceKey(u,i+(u!==t?r(u.key||"")+"/":"")+n)),o.push(u))}function l(e,t,n,o,i){var a="";null!=n&&(a=r(n)+"/");var l=s.getPooled(t,a,o,i);g(e,u,l),s.release(l)}function c(e,t,n){if(null==e)return e;var r=[];return l(e,r,null,t,n),r}function f(e,t,n){return null}function d(e,t){return g(e,f,null)}function p(e){var t=[];return l(e,t,null,v.thatReturnsArgument),t}var h=n(21),m=n(11),v=n(15),g=n(78),y=h.twoArgumentPooler,b=h.fourArgumentPooler,x=/\/(?!\/)/g;o.prototype.destructor=function(){this.func=null,this.context=null,this.count=0},h.addPoolingTo(o,y),s.prototype.destructor=function(){this.result=null,this.keyPrefix=null,this.func=null,this.context=null,this.count=0},h.addPoolingTo(s,b);var A={forEach:a,map:c,mapIntoWithKeyPrefixInternal:l,count:d,toArray:p};e.exports=A},function(e,t,n){"use strict";function r(e,t){var n=w.hasOwnProperty(t)?w[t]:null;P.hasOwnProperty(t)&&(n!==x.OVERRIDE_BASE?v(!1):void 0),e.hasOwnProperty(t)&&(n!==x.DEFINE_MANY&&n!==x.DEFINE_MANY_MERGED?v(!1):void 0)}function o(e,t){if(t){"function"==typeof t?v(!1):void 0,d.isValidElement(t)?v(!1):void 0;var n=e.prototype;t.hasOwnProperty(b)&&k.mixins(e,t.mixins);for(var o in t)if(t.hasOwnProperty(o)&&o!==b){var i=t[o];if(r(n,o),k.hasOwnProperty(o))k[o](e,i);else{var a=w.hasOwnProperty(o),l=n.hasOwnProperty(o),c="function"==typeof i,f=c&&!a&&!l&&t.autobind!==!1;if(f)n.__reactAutoBindMap||(n.__reactAutoBindMap={}),n.__reactAutoBindMap[o]=i,n[o]=i;else if(l){var p=w[o];!a||p!==x.DEFINE_MANY_MERGED&&p!==x.DEFINE_MANY?v(!1):void 0,p===x.DEFINE_MANY_MERGED?n[o]=s(n[o],i):p===x.DEFINE_MANY&&(n[o]=u(n[o],i))}else n[o]=i}}}}function i(e,t){if(t)for(var n in t){var r=t[n];if(t.hasOwnProperty(n)){var o=n in k;o?v(!1):void 0;var i=n in e;i?v(!1):void 0,e[n]=r}}}function a(e,t){e&&t&&"object"==typeof e&&"object"==typeof t?void 0:v(!1);for(var n in t)t.hasOwnProperty(n)&&(void 0!==e[n]?v(!1):void 0,e[n]=t[n]);return e}function s(e,t){return function(){var n=e.apply(this,arguments),r=t.apply(this,arguments);if(null==n)return r;if(null==r)return n;var o={};return a(o,n),a(o,r),o}}function u(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function l(e,t){var n=t.bind(e);return n}function c(e){for(var t in e.__reactAutoBindMap)if(e.__reactAutoBindMap.hasOwnProperty(t)){var n=e.__reactAutoBindMap[t];e[t]=l(e,n)}}var f=n(115),d=n(11),p=(n(46),n(45),n(130)),h=n(4),m=n(31),v=n(1),g=n(26),y=n(19),b=(n(3),y({mixins:null})),x=g({DEFINE_ONCE:null,DEFINE_MANY:null,OVERRIDE_BASE:null,DEFINE_MANY_MERGED:null}),A=[],w={mixins:x.DEFINE_MANY,statics:x.DEFINE_MANY,propTypes:x.DEFINE_MANY,contextTypes:x.DEFINE_MANY,childContextTypes:x.DEFINE_MANY,getDefaultProps:x.DEFINE_MANY_MERGED,getInitialState:x.DEFINE_MANY_MERGED,getChildContext:x.DEFINE_MANY_MERGED,render:x.DEFINE_ONCE,componentWillMount:x.DEFINE_MANY,componentDidMount:x.DEFINE_MANY,componentWillReceiveProps:x.DEFINE_MANY,shouldComponentUpdate:x.DEFINE_ONCE,componentWillUpdate:x.DEFINE_MANY,componentDidUpdate:x.DEFINE_MANY,componentWillUnmount:x.DEFINE_MANY,updateComponent:x.OVERRIDE_BASE},k={displayName:function(e,t){e.displayName=t},mixins:function(e,t){if(t)for(var n=0;n"+s+""},receiveComponent:function(e,t){if(e!==this._currentElement){this._currentElement=e;var n=""+e;if(n!==this._stringText){this._stringText=n;var o=a.getNode(this._rootNodeID);r.updateTextContent(o,n)}}},unmountComponent:function(){i.unmountIDFromEnvironment(this._rootNodeID)}}),e.exports=c},function(e,t,n){"use strict";function r(){this.reinitializeTransaction()}var o=n(13),i=n(48),a=n(4),s=n(15),u={initialize:s,close:function(){d.isBatchingUpdates=!1}},l={initialize:s,close:o.flushBatchedUpdates.bind(o)},c=[l,u];a(r.prototype,i.Mixin,{getTransactionWrappers:function(){return c}});var f=new r,d={isBatchingUpdates:!1,batchedUpdates:function(e,t,n,r,o,i){var a=d.isBatchingUpdates;d.isBatchingUpdates=!0,a?e(t,n,r,o,i):f.perform(e,null,t,n,r,o,i)}};e.exports=d},function(e,t,n){"use strict";function r(){if(!C){C=!0,g.EventEmitter.injectReactEventListener(v),g.EventPluginHub.injectEventPluginOrder(s),g.EventPluginHub.injectInstanceHandle(y),g.EventPluginHub.injectMount(b),g.EventPluginHub.injectEventPluginsByName({SimpleEventPlugin:k,EnterLeaveEventPlugin:u,ChangeEventPlugin:i,SelectEventPlugin:A,BeforeInputEventPlugin:o}),g.NativeComponent.injectGenericComponentClass(h),g.NativeComponent.injectTextComponentClass(m),g.Class.injectMixin(f),g.DOMProperty.injectDOMPropertyConfig(c),g.DOMProperty.injectDOMPropertyConfig(P),g.EmptyComponent.injectEmptyComponent("noscript"),g.Updates.injectReconcileTransaction(x),g.Updates.injectBatchingStrategy(p),g.RootIndex.injectCreateReactRootIndex(l.canUseDOM?a.createReactRootIndex:w.createReactRootIndex),g.Component.injectEnvironment(d)}}var o=n(264),i=n(266),a=n(267),s=n(269),u=n(270),l=n(6),c=n(273),f=n(275),d=n(64),p=n(120),h=n(279),m=n(119),v=n(287),g=n(288),y=n(30),b=n(8),x=n(292),A=n(298),w=n(299),k=n(300),P=n(297),C=!1;e.exports={inject:r}},function(e,t,n){"use strict";function r(){if(f.current){var e=f.current.getName();if(e)return" Check the render method of `"+e+"`."}return""}function o(e,t){if(e._store&&!e._store.validated&&null==e.key){e._store.validated=!0;i("uniqueKey",e,t)}}function i(e,t,n){var o=r();if(!o){var i="string"==typeof n?n:n.displayName||n.name;i&&(o=" Check the top-level render call using <"+i+">.")}var a=h[e]||(h[e]={});if(a[o])return null;a[o]=!0;var s={parentOrOwner:o,url:" See https://fb.me/react-warning-keys for more information.",childOwner:null};return t&&t._owner&&t._owner!==f.current&&(s.childOwner=" It was passed a child from "+t._owner.getName()+"."),s}function a(e,t){if("object"==typeof e)if(Array.isArray(e))for(var n=0;n/,i={CHECKSUM_ATTR_NAME:"data-react-checksum",addChecksumToMarkup:function(e){var t=r(e);return e.replace(o," "+i.CHECKSUM_ATTR_NAME+'="'+t+'"$&')},canReuseMarkup:function(e,t){var n=t.getAttribute(i.CHECKSUM_ATTR_NAME);n=n&&parseInt(n,10);var o=r(e);return o===n}};e.exports=i},function(e,t,n){"use strict";var r=n(26),o=r({INSERT_MARKUP:null,MOVE_EXISTING:null,REMOVE_NODE:null,SET_MARKUP:null,TEXT_CONTENT:null});e.exports=o},function(e,t,n){"use strict";function r(e){if("function"==typeof e.type)return e.type;var t=e.type,n=f[t];return null==n&&(f[t]=n=l(t)),n}function o(e){return c?void 0:u(!1),new c(e.type,e.props)}function i(e){return new d(e)}function a(e){return e instanceof d}var s=n(4),u=n(1),l=null,c=null,f={},d=null,p={injectGenericComponentClass:function(e){c=e},injectTextComponentClass:function(e){d=e},injectComponentClasses:function(e){s(f,e)}},h={getComponentClassForElement:r,createInternalComponent:o,createInstanceForText:i,isTextComponent:a,injection:p};e.exports=h},function(e,t,n){"use strict";function r(e,t){}var o=(n(3),{isMounted:function(e){return!1},enqueueCallback:function(e,t){},enqueueForceUpdate:function(e){r(e,"forceUpdate")},enqueueReplaceState:function(e,t){r(e,"replaceState")},enqueueSetState:function(e,t){r(e,"setState")},enqueueSetProps:function(e,t){r(e,"setProps")},enqueueReplaceProps:function(e,t){r(e,"replaceProps")}});e.exports=o},function(e,t,n){"use strict";function r(e){function t(t,n,r,o,i,a){if(o=o||w,a=a||r,null==n[r]){var s=b[i];return t?new Error("Required "+s+" `"+a+"` was not specified in "+("`"+o+"`.")):null}return e(n,r,o,i,a)}var n=t.bind(null,!1);return n.isRequired=t.bind(null,!0),n}function o(e){function t(t,n,r,o,i){var a=t[n],s=m(a);if(s!==e){var u=b[o],l=v(a);return new Error("Invalid "+u+" `"+i+"` of type "+("`"+l+"` supplied to `"+r+"`, expected ")+("`"+e+"`."))}return null}return r(t)}function i(){return r(x.thatReturns(null))}function a(e){function t(t,n,r,o,i){var a=t[n];if(!Array.isArray(a)){var s=b[o],u=m(a);return new Error("Invalid "+s+" `"+i+"` of type "+("`"+u+"` supplied to `"+r+"`, expected an array."))}for(var l=0;l>"}var y=n(11),b=n(45),x=n(15),A=n(73),w="<>",k={array:o("array"),bool:o("boolean"),func:o("function"),number:o("number"),object:o("object"),string:o("string"),any:i(),arrayOf:a,element:s(),instanceOf:u,node:d(),objectOf:c,oneOf:l,oneOfType:f,shape:p};e.exports=k},function(e,t){"use strict";var n={injectCreateReactRootIndex:function(e){r.createReactRootIndex=e}},r={createReactRootIndex:null,injection:n};e.exports=r},function(e,t){"use strict";var n={currentScrollLeft:0,currentScrollTop:0,refreshScrollValues:function(e){n.currentScrollLeft=e.x,n.currentScrollTop=e.y}};e.exports=n},function(e,t,n){"use strict";function r(e,t){if(null==t?o(!1):void 0,null==e)return t;var n=Array.isArray(e),r=Array.isArray(t);return n&&r?(e.push.apply(e,t),e):n?(e.push(t),e):r?[e].concat(t):[e,t]}var o=n(1);e.exports=r},function(e,t){"use strict";var n=function(e,t,n){Array.isArray(e)?e.forEach(t,n):e&&t.call(n,e)};e.exports=n},function(e,t,n){"use strict";function r(){return!i&&o.canUseDOM&&(i="textContent"in document.documentElement?"textContent":"innerText"),i}var o=n(6),i=null;e.exports=r},function(e,t){"use strict";function n(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&("input"===t&&r[e.type]||"textarea"===t)}var r={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};e.exports=n},function(e,t,n){"use strict";function r(e){return"function"==typeof e}function o(e,t){return function(n,o){if(o.type!==e)return n;var a=i.isError(o)?"throw":"next";r(t)&&(t.next=t["throw"]=t);var s=t[a];return r(s)?s(n,o):n}}t.__esModule=!0,t["default"]=o;var i=n(211);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){if(e&&e.__esModule)return e;var t={};if(null!=e)for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t["default"]=e,t}Object.defineProperty(t,"__esModule",{value:!0}),t.save=t.load=void 0;var o=n(321),i=n(36),a=r(i);t.load=(0,o.createAction)(a.LOAD),t.save=(0,o.createAction)(a.SAVE)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(139);t["default"]=function(e){return function(t){var n=function(e){return t.dispatch((0,r.load)(e))};return e.load().then(function(e){return n(e),e})}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);tn;n++)t[n]=arguments[n];if(0===t.length)return function(e){return e};var r=function(){var e=t[t.length-1],n=t.slice(0,-1);return{v:function(){return n.reduceRight(function(e,t){return t(e)},e.apply(void 0,arguments))}}}();return"object"==typeof r?r.v:void 0}t.__esModule=!0,t["default"]=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){function r(){g===v&&(g=v.slice())}function i(){return m}function s(e){if("function"!=typeof e)throw new Error("Expected listener to be a function.");var t=!0;return r(),g.push(e),function(){if(t){t=!1,r();var n=g.indexOf(e);g.splice(n,1)}}}function c(e){if(!(0,a["default"])(e))throw new Error("Actions must be plain objects. Use custom middleware for async actions.");if("undefined"==typeof e.type)throw new Error('Actions may not have an undefined "type" property. Have you misspelled a constant?');if(y)throw new Error("Reducers may not dispatch actions.");try{y=!0,m=h(m,e)}finally{y=!1}for(var t=v=g,n=0;np;p++)f[p]=arguments[p];return r=a=i(this,(t=Object.getPrototypeOf(n)).call.apply(t,[this].concat(f))),a.getEditorInstance=function(){return a.refs.editor.getCodeMirror()},a.onChange=function(e){e!==a.props.text&&a.props.onChange(e)},a.componentDidMount=function(){console.log(a.props)},a.onDropAccepted=function(t){var n=t[0],r=a.getEditorInstance(),o=r.getCursor(),i=0!==o.ch,s=void 0,u="!["+n.name+"](Uploading...)";i?(r.replaceSelection("\n"+u+"\n"),s=o.line+3):(r.replaceSelection(u+"\n"),s=o.line+2),r.setCursor(s,0),m.client.post("/v0/user/s3",{kind:n.type,size:n.size,filename:n.name}).then(function(t){var o=new FormData;for(var i in t.form)o.append(i,t.form[i]);n.blob?o.append("file",n.file):o.append("file",n),e(t.upload_url,{method:"post",body:o}).then(function(e){a.props.replaceText(u,"!["+n.name+"]("+t.asset.url+")"),r.setCursor(s,0)})["catch"](function(e){a.props.replaceText(u,""),r.setCursor(s,0)})})},a.render=function(){var e={readOnly:!1,lineNumbers:!1,mode:"gfm",matchBrackets:!0,lineWrapping:!0,viewportMargin:1/0,theme:"atlas",extraKeys:{Enter:"newlineAndIndentContinueMarkdownList"}};return u["default"].createElement("div",null,u["default"].createElement(d["default"],{onDropAccepted:a.onDropAccepted,disableClick:!0,multiple:!1,accept:"image/*",className:h["default"].container},u["default"].createElement(c["default"],{value:a.props.text,onChange:a.onChange,options:e,ref:"editor"})))},s=r,i(a,s)}return a(n,t),n}(u["default"].Component);v.propTypes={text:u["default"].PropTypes.string,onChange:u["default"].PropTypes.func,replaceText:u["default"].PropTypes.func},t["default"]=v}).call(t,n(89))},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(153),i=r(o);t["default"]=i["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;nl;l++)u[l]=arguments[l];return n=r=i(this,(e=Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.state={oauthState:Math.random().toString(36).substring(7)},r.componentDidMount=function(){localStorage.oauthState=r.state.oauthState},r.slackUrl=function(){var e="https://slack.com/oauth/authorize",t={client_id:"30086650419.30130733398",scope:r.props.scopes.join(" "),redirect_uri:"http://localhost:3000/auth/slack/",state:r.state.oauthState},n=Object.keys(t).map(function(e){return e+"="+encodeURIComponent(t[e])}).join("&");return e+"?"+n},a=n,i(r,a)}return a(t,e),s(t,[{key:"render",value:function(){return l["default"].createElement("a",{href:this.slackUrl(),className:f["default"].link},"Authorize /w Slack")}}]),t}(l["default"].Component);d.propTypes={scopes:l["default"].PropTypes.arrayOf(l["default"].PropTypes.string)},d.defaultProps={scopes:["identify"]},t["default"]=d},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(155),i=r(o);t["default"]=i["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=n(2),u=r(s),l=n(234),c=r(l),f=n(225),d=r(f),p=n(344),h=r(p);n(336),n(337);var m=function(e){function t(){var e,n,r,a;o(this,t);for(var s=arguments.length,l=Array(s),f=0;s>f;f++)l[f]=arguments[f];return n=r=i(this,(e=Object.getPrototypeOf(t)).call.apply(e,[this].concat(l))),r.onChange=function(e){e!==r.props.text&&r.props.onChange(e)},r.render=function(){return u["default"].createElement("div",{className:h["default"].container},u["default"].createElement("div",null),u["default"].createElement(c["default"],{options:{toolbar:{buttons:["bold","italic","underline","anchor","unorderedlist","orderedlist","h1","h2","h3","quote"]},placeholder:!1},text:(0,d["default"])(r.props.text),onChange:r.onChange,className:h["default"].editor}))},a=n,i(r,a)}return a(t,e),t}(u["default"].Component);m.propTypes={text:u["default"].PropTypes.string,onChange:u["default"].PropTypes.func},t["default"]=m},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(157),i=r(o);t["default"]=i["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t0?n:s["default"].xor([l.ActiveEditors.MARKDOWN,l.ActiveEditors.TEXT],[t.toggledEditor]);default:return e}},f=function(){var e=arguments.length<=0||void 0===arguments[0]?{visible:!1}:arguments[0],t=arguments[1];switch(t.type){case l.TOGGLE_HISTORY_SIDEBAR:return i({},e,{visible:!e.visible});default:return e}},d="# Welcome to Beautiful Atlas\n\nThis is just a small preview here's what you can do:\n\n- Write markdown or rich text, you choose\n- Dont' worry about saving\n- One document for now\n- More to come\n",p={text:d,revisions:[],unsavedChanges:!1},h=function(){var e=arguments.length<=0||void 0===arguments[0]?p:arguments[0],t=arguments[1],n=s["default"].last(e.revisions);switch(t.type){case l.UPDATE_TEXT:var r=!1;return n&&n.text!==e.text&&(r=!0),i({},e,{unsavedChanges:r,text:t.text});case l.ADD_REVISION:if(n&&n.text===e.text)return e;var a=n?n.id:0;return i({},e,{revisions:[].concat(o(e.revisions),[{id:a+1,text:e.text,created_at:t.createdAt}]),unsavedChanges:!1});case l.REPLACE_TEXT:var u=e.text.replace(t.originalText,t.replacedText);return i({},e,{text:u});default:return e}};t["default"]=(0,u.combineReducers)({activeEditors:c,historySidebar:f,text:h})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){var t=(0,a["default"])(e,{gfm:!0,converters:[s,u]});return t}Object.defineProperty(t,"__esModule",{value:!0}),t.toMarkdown=o;var i=n(352),a=r(i),s={filter:"li",replacement:function(e,t){e=e.replace(/^\s+/,"").replace(/\n/gm,"\n ");var n="- ",r=t.parentNode,o=Array.prototype.indexOf.call(r.children,t)+1;return n=/ol/i.test(r.nodeName)?o+". ":"- ",n+e}},u={filter:["ul","ol"],replacement:function(e,t){for(var n=[],r=0;r1?t-1:0),r=1;t>r;r++)n[r-1]=arguments[r];return function(){for(var t=arguments.length,r=Array(t),o=0;t>o;o++)r[o]=arguments[o];var i={type:e};return n.forEach(function(e,t){i[n[t]]=r[t]}),i}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;nl;l++)u[l]=arguments[l];return n=r=i(this,(e=Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.state={loggedIn:b["default"].loggedIn()},r.componentWillMount=function(){b["default"].onChange=r.updateAuth},r.updateAuth=function(e){r.setState({loggedIn:e})},r.logout=function(){b["default"].logout()},a=n,i(r,a)}return a(t,e),s(t,[{key:"render",value:function(){return l["default"].createElement("div",{className:d["default"].container},l["default"].createElement(m["default"],{activeEditors:this.props.activeEditors,toggleEditors:this.props.toggleEditors,addRevision:this.props.addRevision,unsavedChanges:this.props.unsavedChanges}),l["default"].createElement("div",{className:d["default"].content},l["default"].createElement(g["default"],null)))}}]),t}(u.Component);x.propTypes={children:l["default"].PropTypes.element,activeEditors:l["default"].PropTypes.array.isRequired,toggleEditors:l["default"].PropTypes.func.isRequired,addRevision:l["default"].PropTypes.func.isRequired,unsavedChanges:l["default"].PropTypes.bool.isRequired};var A=function(e){return{activeEditors:e.activeEditors,unsavedChanges:e.text.unsavedChanges}},w=function(e){return{toggleEditors:function(t){e((0,p.toggleEditors)(t))},addRevision:function(){e((0,p.addRevision)())}}};x=(0,c.connect)(A,w)(x),t["default"]=x},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(162),i=r(o);t["default"]=i["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;n1?b["default"].panel:b["default"].fullscreen)+" "+b["default"].markdown},l["default"].createElement(d["default"],{onChange:this.props.editMarkdown,text:this.props.text,replaceText:this.props.replaceText})):null,e.includes("TEXT")?l["default"].createElement("div",{className:(e.length>1?b["default"].panel:b["default"].fullscreen)+" "+b["default"].text},l["default"].createElement(h["default"],{onChange:this.props.editText,text:this.props.text})):null)}}]),t}(u.Component);x.propTypes={editMarkdown:l["default"].PropTypes.func.isRequired,editText:l["default"].PropTypes.func.isRequired,text:l["default"].PropTypes.string,replaceText:l["default"].PropTypes.func.isRequired,activeEditors:l["default"].PropTypes.arrayOf(l["default"].PropTypes.string),showHistorySidebar:l["default"].PropTypes.bool.isRequired};var A=function(e){return{text:e.text.text,editor:e.editor,activeEditors:e.activeEditors,showHistorySidebar:e.historySidebar.visible,revisions:e.text.revisions}},w=function(e){return{editMarkdown:function(t){e((0,v.updateText)(t,"markdown"))},editText:function(t){var n=(0,m.toMarkdown)(t);e((0,v.updateText)(n,"text"))},replaceText:function(t,n){e((0,v.replaceText)(t,n))}}};x=(0,c.connect)(A,w)(x),t["default"]=x},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function i(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function a(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var s=function(){function e(e,t){for(var n=0;nl;l++)u[l]=arguments[l];return n=r=i(this,(e=Object.getPrototypeOf(t)).call.apply(e,[this].concat(u))),r.componentDidMount=function(){var e=r.props.location.query;localStorage.oauthState==e.state&&r.props.slackAuth(e.code)},a=n,i(r,a)}return a(t,e),s(t,[{key:"render",value:function(){return l["default"].createElement("div",null,"Done")}}]),t}(l["default"].Component));d.contextTypes={router:l["default"].PropTypes.object.isRequired};var p=function(e){return{slackAuth:function(t){return e((0,f.slackAuthAsync)(t))}}};t["default"]=(0,c.connect)(null,p)(d)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=n(168),i=r(o);t["default"]=i["default"]},function(e,t){e.exports=function(e){var t={},n=arguments[1];if("string"==typeof n){n={};for(var r=1;r[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/,n=/^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/,r=/[*+-]\s/;e.commands.newlineAndIndentContinueMarkdownList=function(i){if(i.getOption("disableInput"))return e.Pass;for(var o=i.listSelections(),a=[],s=0;s")>=0?p[2]:parseInt(p[3],10)+1+p[4];a[s]="\n"+h+v+m}}i.replaceSelections(a)}})},function(e,t,n){!function(e){e(n(18))}(function(e){"use strict";e.overlayMode=function(t,n,r){return{startState:function(){return{base:e.startState(t),overlay:e.startState(n),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(r){return{base:e.copyState(t,r.base),overlay:e.copyState(n,r.overlay),basePos:r.basePos,baseCur:null,overlayPos:r.overlayPos,overlayCur:null}},token:function(e,i){return(e!=i.streamSeen||Math.min(i.basePos,i.overlayPos)]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;e.defineMode("gfm",function(n,r){function i(e){return e.code=!1,null}var o=0,a={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,n){if(n.combineTokens=null,n.codeBlock)return e.match(/^```+/)?(n.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(n.code=!1),e.sol()&&e.match(/^```+/))return e.skipToEnd(),n.codeBlock=!0,null;if("`"===e.peek()){e.next();var i=e.pos;e.eatWhile("`");var a=1+e.pos-i;return n.code?a===o&&(n.code=!1):(o=a,n.code=!0),null}if(n.code)return e.next(),null;if(e.eatSpace())return n.ateSpace=!0,null;if((e.sol()||n.ateSpace)&&(n.ateSpace=!1,r.gitHubSpice!==!1)){if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return n.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return n.combineTokens=!0,"link"}return e.match(t)&&"]("!=e.string.slice(e.start-2,e.start)&&(0==e.start||/\W/.test(e.string.charAt(e.start-1)))?(n.combineTokens=!0,"link"):(e.next(),null)},blankLine:i},s={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:"```",strikethrough:!0};for(var u in r)s[u]=r[u];return s.name="markdown",e.overlayMode(e.getMode(n,s),a)},"markdown"),e.defineMIME("text/x-gfm","gfm")})},function(e,t,n){!function(e){e(n(18))}(function(e){"use strict";function t(e,t,n){return/^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}e.defineMode("javascript",function(n,r){function i(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}function o(e,t,n){return xe=e,Ae=n,t}function a(e,n){var r=e.next();if('"'==r||"'"==r)return n.tokenize=s(r),n.tokenize(e,n);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return o("number","number");if("."==r&&e.match(".."))return o("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return o(r);if("="==r&&e.eat(">"))return o("=>","operator");if("0"==r&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),o("number","number");if("0"==r&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),o("number","number");if("0"==r&&e.eat(/b/i))return e.eatWhile(/[01]/i),o("number","number");if(/\d/.test(r))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),o("number","number");if("/"==r)return e.eat("*")?(n.tokenize=u,u(e,n)):e.eat("/")?(e.skipToEnd(),o("comment","comment")):t(e,n,1)?(i(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),o("regexp","string-2")):(e.eatWhile(Ne),o("operator","operator",e.current()));if("`"==r)return n.tokenize=l,l(e,n);if("#"==r)return e.skipToEnd(),o("error","error");if(Ne.test(r))return e.eatWhile(Ne),o("operator","operator",e.current());if(Ee.test(r)){e.eatWhile(Ee);var a=e.current(),c=Se.propertyIsEnumerable(a)&&Se[a];return c&&"."!=n.lastType?o(c.type,c.style,a):o("variable","variable",a)}}function s(e){return function(t,n){var r,i=!1;if(Pe&&"@"==t.peek()&&t.match(Me))return n.tokenize=a,o("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=e||i);)i=!i&&"\\"==r;return i||(n.tokenize=a),o("string","string")}}function u(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=a;break}r="*"==n}return o("comment","comment")}function l(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=a;break}r=!r&&"\\"==n}return o("quasi","string-2",e.current())}function c(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(0>n)){for(var r=0,i=!1,o=n-1;o>=0;--o){var a=e.string.charAt(o),s=Oe.indexOf(a);if(s>=0&&3>s){if(!r){++o;break}if(0==--r)break}else if(s>=3&&6>s)++r;else if(Ee.test(a))i=!0;else{if(/["'\/]/.test(a))return;if(i&&!r){++o;break}}}i&&!r&&(t.fatArrowAt=o)}}function f(e,t,n,r,i,o){this.indented=e,this.column=t,this.type=n,this.prev=i,this.info=o,null!=r&&(this.align=r)}function d(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==t)return!0}function p(e,t,n,r,i){var o=e.cc;for(Re.state=e,Re.stream=i,Re.marked=null,Re.cc=o,Re.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var a=o.length?o.pop():Ce?k:w;if(a(n,r)){for(;o.length&&o[o.length-1].lex;)o.pop()();return Re.marked?Re.marked:"variable"==n&&d(e,r)?"variable-2":t}}}function h(){for(var e=arguments.length-1;e>=0;e--)Re.cc.push(arguments[e])}function m(){return h.apply(null,arguments),!0}function v(e){function t(t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}var n=Re.state;if(Re.marked="def",n.context){if(t(n.localVars))return;n.localVars={name:e,next:n.localVars}}else{if(t(n.globalVars))return;r.globalVars&&(n.globalVars={name:e,next:n.globalVars})}}function g(){Re.state.context={prev:Re.state.context,vars:Re.state.localVars},Re.state.localVars=je}function y(){Re.state.localVars=Re.state.context.vars,Re.state.context=Re.state.context.prev}function b(e,t){var n=function(){var n=Re.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var i=n.lexical;i&&")"==i.type&&i.align;i=i.prev)r=i.indented;n.lexical=new f(r,Re.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function x(){var e=Re.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function A(e){function t(n){return n==e?m():";"==e?h():m(t)}return t}function w(e,t){return"var"==e?m(b("vardef",t.length),J,A(";"),x):"keyword a"==e?m(b("form"),k,w,x):"keyword b"==e?m(b("form"),w,x):"{"==e?m(b("}"),V,x):";"==e?m():"if"==e?("else"==Re.state.lexical.info&&Re.state.cc[Re.state.cc.length-1]==x&&Re.state.cc.pop()(),m(b("form"),k,w,x,$)):"function"==e?m(oe):"for"==e?m(b("form"),ee,w,x):"variable"==e?m(b("stat"),z):"switch"==e?m(b("form"),k,b("}","switch"),A("{"),V,x,x):"case"==e?m(k,A(":")):"default"==e?m(A(":")):"catch"==e?m(b("form"),g,A("("),ae,A(")"),w,x,y):"class"==e?m(b("form"),se,x):"export"==e?m(b("stat"),fe,x):"import"==e?m(b("stat"),de,x):"module"==e?m(b("form"),K,b("}"),A("{"),V,x,x):h(b("stat"),k,A(";"),x)}function k(e){return C(e,!1)}function P(e){return C(e,!0)}function C(e,t){if(Re.state.fatArrowAt==Re.stream.start){var n=t?R:L;if("("==e)return m(g,b(")"),X(K,")"),x,A("=>"),n,y);if("variable"==e)return h(g,K,A("=>"),n,y)}var r=t?N:S;return Le.hasOwnProperty(e)?m(r):"function"==e?m(oe,r):"keyword c"==e?m(t?E:T):"("==e?m(b(")"),T,ye,A(")"),x,r):"operator"==e||"spread"==e?m(t?P:k):"["==e?m(b("]"),ve,x,r):"{"==e?U(W,"}",null,r):"quasi"==e?h(M,r):"new"==e?m(j(t)):m()}function T(e){return e.match(/[;\}\)\],]/)?h():h(k)}function E(e){return e.match(/[;\}\)\],]/)?h():h(P)}function S(e,t){return","==e?m(k):N(e,t,!1)}function N(e,t,n){var r=0==n?S:N,i=0==n?k:P;return"=>"==e?m(g,n?R:L,y):"operator"==e?/\+\+|--/.test(t)?m(r):"?"==t?m(k,A(":"),i):m(i):"quasi"==e?h(M,r):";"!=e?"("==e?U(P,")","call",r):"."==e?m(H,r):"["==e?m(b("]"),T,A("]"),x,r):void 0:void 0}function M(e,t){return"quasi"!=e?h():"${"!=t.slice(t.length-2)?m(M):m(k,O)}function O(e){return"}"==e?(Re.marked="string-2",Re.state.tokenize=l,m(M)):void 0}function L(e){return c(Re.stream,Re.state),h("{"==e?w:k)}function R(e){return c(Re.stream,Re.state),h("{"==e?w:P)}function j(e){return function(t){return"."==t?m(e?I:D):h(e?P:k)}}function D(e,t){return"target"==t?(Re.marked="keyword",m(S)):void 0}function I(e,t){return"target"==t?(Re.marked="keyword",m(N)):void 0}function z(e){return":"==e?m(x,w):h(S,A(";"),x)}function H(e){return"variable"==e?(Re.marked="property",m()):void 0}function W(e,t){return"variable"==e||"keyword"==Re.style?(Re.marked="property",m("get"==t||"set"==t?F:q)):"number"==e||"string"==e?(Re.marked=Pe?"property":Re.style+" property",m(q)):"jsonld-keyword"==e?m(q):"modifier"==e?m(W):"["==e?m(k,A("]"),q):"spread"==e?m(k):void 0}function F(e){return"variable"!=e?h(q):(Re.marked="property",m(oe))}function q(e){return":"==e?m(P):"("==e?h(oe):void 0}function X(e,t){function n(r){if(","==r){var i=Re.state.lexical;return"call"==i.info&&(i.pos=(i.pos||0)+1),m(e,n)}return r==t?m():m(A(t))}return function(r){return r==t?m():h(e,n)}}function U(e,t,n){for(var r=3;r!?|~^]/,Me=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Oe="([{}])",Le={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},Re={state:null,column:null,marked:null,cc:null},je={name:"this",next:{name:"arguments"}};return x.lex=!0,{startState:function(e){var t={tokenize:a,lastType:"sof",cc:[],lexical:new f((e||0)-we,0,"block",!1),localVars:r.localVars,context:r.localVars&&{vars:r.localVars},indented:e||0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),c(e,t)),t.tokenize!=u&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==xe?n:(t.lastType="operator"!=xe||"++"!=Ae&&"--"!=Ae?xe:"incdec",p(t,n,xe,Ae,e))},indent:function(t,n){if(t.tokenize==u)return e.Pass;if(t.tokenize!=a)return 0;var i=n&&n.charAt(0),o=t.lexical;if(!/^\s*else\b/.test(n))for(var s=t.cc.length-1;s>=0;--s){var l=t.cc[s];if(l==x)o=o.prev;else if(l!=$)break}"stat"==o.type&&"}"==i&&(o=o.prev),ke&&")"==o.type&&"stat"==o.prev.type&&(o=o.prev);var c=o.type,f=i==c;return"vardef"==c?o.indented+("operator"==t.lastType||","==t.lastType?o.info+1:0):"form"==c&&"{"==i?o.indented:"form"==c?o.indented+we:"stat"==c?o.indented+(be(t,n)?ke||we:0):"switch"!=o.info||f||0==r.doubleIndentSwitch?o.align?o.column+(f?0:1):o.indented+(f?0:we):o.indented+(/^(?:case|default)\b/.test(n)?we:2*we)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Ce?null:"/*",blockCommentEnd:Ce?null:"*/",lineComment:Ce?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Ce?"json":"javascript",jsonldMode:Pe,jsonMode:Ce,expressionAllowed:t,skipExpression:function(e){var t=e.cc[e.cc.length-1];(t==k||t==P)&&e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},function(e,t,n){!function(e){e(n(18),n(167),n(166))}(function(e){"use strict";e.defineMode("markdown",function(t,n){function r(n){if(e.findModeByName){var r=e.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var i=e.getMode(t,n);return"null"==i.name?null:i}function i(e,t,n){return t.f=t.inline=n,n(e,t)}function o(e,t,n){return t.f=t.block=n,n(e,t)}function a(e){return!e||!/\S/.test(e.string)}function s(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,w||e.f!=l||(e.f=h,e.block=u),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine=null,null}function u(e,t){var o=e.sol(),s=t.list!==!1,u=t.indentedCode;t.indentedCode=!1,s&&(t.indentationDiff>=0?(t.indentationDiff<4&&(t.indentation-=t.indentationDiff),t.list=null):t.indentation>0?(t.list=null,t.listDepth=Math.floor(t.indentation/4)):(t.list=!1,t.listDepth=0));var l=null;if(t.indentationDiff>=4)return e.skipToEnd(),u||a(t.prevLine)?(t.indentation-=4,t.indentedCode=!0,C.code):null;if(e.eatSpace())return null;if((l=e.match(O))&&l[1].length<=6)return t.header=l[1].length,n.highlightFormatting&&(t.formatting="header"),t.f=t.inline,d(t);if(!(a(t.prevLine)||t.quote||s||u)&&(l=e.match(L)))return t.header="="==l[0].charAt(0)?1:2,n.highlightFormatting&&(t.formatting="header"),t.f=t.inline,d(t);if(e.eat(">"))return t.quote=o?1:t.quote+1,n.highlightFormatting&&(t.formatting="quote"),e.eatSpace(),d(t);if("["===e.peek())return i(e,t,y);if(e.match(E,!0))return t.hr=!0,C.hr;if((a(t.prevLine)||s)&&(e.match(S,!1)||e.match(N,!1))){var f=null;return e.match(S,!0)?f="ul":(e.match(N,!0),f="ol"),t.indentation=e.column()+e.current().length,t.list=!0,t.listDepth++,n.taskLists&&e.match(M,!1)&&(t.taskList=!0),t.f=t.inline,n.highlightFormatting&&(t.formatting=["list","list-"+f]),d(t)}return n.fencedCodeBlocks&&(l=e.match(j,!0))?(t.fencedChars=l[1],t.localMode=r(l[2]),t.localMode&&(t.localState=t.localMode.startState()),t.f=t.block=c,n.highlightFormatting&&(t.formatting="code-block"),t.code=!0,d(t)):i(e,t,t.inline)}function l(e,t){var n=k.token(e,t.htmlState);return(w&&null===t.htmlState.tagStart&&!t.htmlState.context&&t.htmlState.tokenize.isInText||t.md_inside&&e.current().indexOf(">")>-1)&&(t.f=h,t.block=u,t.htmlState=null),n}function c(e,t){return t.fencedChars&&e.match(t.fencedChars,!1)?(t.localMode=t.localState=null,t.f=t.block=f,null):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),C.code)}function f(e,t){e.match(t.fencedChars),t.block=u,t.f=h,t.fencedChars=null,n.highlightFormatting&&(t.formatting="code-block"),t.code=!0;var r=d(t);return t.code=!1,r}function d(e){var t=[];if(e.formatting){t.push(C.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var r=0;r=e.quote?t.push(C.formatting+"-"+e.formatting[r]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(C.linkHref,"url"):(e.strong&&t.push(C.strong),e.em&&t.push(C.em),e.strikethrough&&t.push(C.strikethrough),e.linkText&&t.push(C.linkText),e.code&&t.push(C.code)),e.header&&t.push(C.header,C.header+"-"+e.header),e.quote&&(t.push(C.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(C.quote+"-"+e.quote):t.push(C.quote+"-"+n.maxBlockquoteDepth)),e.list!==!1){var i=(e.listDepth-1)%3;i?1===i?t.push(C.list2):t.push(C.list3):t.push(C.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function p(e,t){return e.match(R,!0)?d(t):void 0}function h(t,r){var i=r.text(t,r);if("undefined"!=typeof i)return i;if(r.list)return r.list=null,d(r);if(r.taskList){var a="x"!==t.match(M,!0)[1];return a?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,d(r)}if(r.taskOpen=!1,r.taskClosed=!1,r.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"),d(r);var s=t.sol(),u=t.next();if("\\"===u&&(t.next(),n.highlightFormatting)){var c=d(r),f=C.formatting+"-escape";return c?c+" "+f:f}if(r.linkTitle){r.linkTitle=!1;var p=u;"("===u&&(p=")"),p=(p+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var h="^\\s*(?:[^"+p+"\\\\]+|\\\\\\\\|\\\\.)"+p;if(t.match(new RegExp(h),!0))return C.linkHref}if("`"===u){var g=r.formatting;n.highlightFormatting&&(r.formatting="code");var y=d(r),b=t.pos;t.eatWhile("`");var x=1+t.pos-b;return r.code?x===P?(r.code=!1,y):(r.formatting=g,d(r)):(P=x,r.code=!0,d(r))}if(r.code)return d(r);if("!"===u&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return t.match(/\[[^\]]*\]/),r.inline=r.f=v,C.image;if("["===u&&t.match(/.*\](\(.*\)| ?\[.*\])/,!1))return r.linkText=!0,n.highlightFormatting&&(r.formatting="link"),d(r);if("]"===u&&r.linkText&&t.match(/\(.*\)| ?\[.*\]/,!1)){n.highlightFormatting&&(r.formatting="link");var c=d(r);return r.linkText=!1,r.inline=r.f=v,c}if("<"===u&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=m,n.highlightFormatting&&(r.formatting="link");var c=d(r);return c?c+=" ":c="",c+C.linkInline}if("<"===u&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=m,n.highlightFormatting&&(r.formatting="link");var c=d(r);return c?c+=" ":c="",c+C.linkEmail}if("<"===u&&t.match(/^(!--|\w)/,!1)){var A=t.string.indexOf(">",t.pos);if(-1!=A){var w=t.string.substring(t.start,A);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(w)&&(r.md_inside=!0)}return t.backUp(1),r.htmlState=e.startState(k),o(t,r,l)}if("<"===u&&t.match(/^\/\w*?>/))return r.md_inside=!1,"tag";var T=!1;if(!n.underscoresBreakWords&&"_"===u&&"_"!==t.peek()&&t.match(/(\w)/,!1)){var E=t.pos-2;if(E>=0){var S=t.string.charAt(E);"_"!==S&&S.match(/(\w)/,!1)&&(T=!0)}}if("*"===u||"_"===u&&!T)if(s&&" "===t.peek());else{if(r.strong===u&&t.eat(u)){n.highlightFormatting&&(r.formatting="strong");var y=d(r);return r.strong=!1,y}if(!r.strong&&t.eat(u))return r.strong=u,n.highlightFormatting&&(r.formatting="strong"),d(r);if(r.em===u){n.highlightFormatting&&(r.formatting="em");var y=d(r);return r.em=!1,y}if(!r.em)return r.em=u,n.highlightFormatting&&(r.formatting="em"),d(r)}else if(" "===u&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return d(r);t.backUp(1)}if(n.strikethrough)if("~"===u&&t.eatWhile(u)){if(r.strikethrough){n.highlightFormatting&&(r.formatting="strikethrough");var y=d(r);return r.strikethrough=!1,y}if(t.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),d(r)}else if(" "===u&&t.match(/^~~/,!0)){if(" "===t.peek())return d(r);t.backUp(2)}return" "===u&&(t.match(/ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),d(r)}function m(e,t){var r=e.next();if(">"===r){t.f=t.inline=h,n.highlightFormatting&&(t.formatting="link");var i=d(t);return i?i+=" ":i="",i+C.linkInline}return e.match(/^[^>]+/,!0),C.linkInline}function v(e,t){if(e.eatSpace())return null;var r=e.next();return"("===r||"["===r?(t.f=t.inline=g("("===r?")":"]"),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,d(t)):"error"}function g(e){return function(t,r){var i=t.next();if(i===e){r.f=r.inline=h,n.highlightFormatting&&(r.formatting="link-string");var o=d(r);return r.linkHref=!1,o}return t.match(A(e),!0)&&t.backUp(1),r.linkHref=!0,d(r)}}function y(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=b,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,d(t)):i(e,t,h)}function b(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=x,n.highlightFormatting&&(t.formatting="link");var r=d(t);return t.linkText=!1,r}return e.match(/^([^\]\\]|\\.)+/,!0),C.linkText}function x(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=h,C.linkHref+" url")}function A(e){return D[e]||(e=(e+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),D[e]=new RegExp("^(?:[^\\\\]|\\\\.)*?("+e+")")),D[e]}var w=e.modes.hasOwnProperty("xml"),k=e.getMode(t,w?{name:"xml",htmlMode:!0}:"text/plain");void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.underscoresBreakWords&&(n.underscoresBreakWords=!0),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1),void 0===n.tokenTypeOverrides&&(n.tokenTypeOverrides={});var P=0,C={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"tag",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough"};for(var T in C)C.hasOwnProperty(T)&&n.tokenTypeOverrides[T]&&(C[T]=n.tokenTypeOverrides[T]);var E=/^([*\-_])(?:\s*\1){2,}\s*$/,S=/^[*\-+]\s+/,N=/^[0-9]+([.)])\s+/,M=/^\[(x| )\](?=\s)/,O=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,L=/^ *(?:\={1,}|-{1,})\s*$/,R=/^[^#!\[\]*_\\<>` "'(~]+/,j=new RegExp("^("+(n.fencedCodeBlocks===!0?"~~~+|```+":n.fencedCodeBlocks)+")[ \\t]*([\\w+#]*)"),D=[],I={startState:function(){return{f:u,prevLine:null,thisLine:null,block:u,htmlState:null,indentation:0,inline:h,text:p,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,em:!1,strong:!1,header:0,hr:!1,taskList:!1,list:!1,listDepth:0,quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,fencedChars:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(k,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkTitle:t.linkTitle,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,header:t.header,hr:t.hr,taskList:t.taskList,list:t.list,listDepth:t.listDepth,quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedChars:t.fencedChars}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine){var n=t.header||t.hr;if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0)||n){if(s(t),!n)return null;t.prevLine=null}t.prevLine=t.thisLine,t.thisLine=e,t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;var r=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length,i=4*Math.floor((r-t.indentation)/4);i>4&&(i=4);var o=t.indentation+i;if(t.indentationDiff=o-t.indentation,t.indentation=o,r>0)return null}return t.f(e,t)},innerMode:function(e){return e.block==l?{state:e.htmlState,mode:k}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:I}},blankLine:s,getType:d,fold:"markdown"};return I},"xml"),e.defineMIME("text/x-markdown","markdown")})},function(e,t,n){!function(e){e(n(18))}(function(e){"use strict";e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["pgp"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists.txt$/},{name:"CoffeeScript",mime:"text/x-coffeescript",mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy"]},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell",mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET", -mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Jade",mime:"text/x-jade",mode:"jade",ext:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"null",mode:"jinja2"},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps"},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mime:"text/n-triples",mode:"ntriples",ext:["nt"]},{name:"Objective C",mime:"text/x-objectivec",mode:"clike",ext:["m","mm"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mime:"application/x-httpd-php",mode:"php",ext:["php","php3","php4","php5","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["py","pyw"]},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mime:"text/x-sh",mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"MariaDB",mime:"text/x-mariadb",mode:"sql"},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"YAML",mime:"text/x-yaml",mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]}];for(var t=0;t-1&&t.substring(i+1,t.length);return o?e.findModeByExtension(o):void 0},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n")):null:e.match("--")?n(u("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(l(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=u("meta","?>"),"meta"):(T=e.eat("/")?"closeTag":"openTag",t.tokenize=a,"tag bracket");if("&"==r){var i;return i=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),i?"atom":"error"}return e.eatWhile(/[^&<]/),null}function a(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=o,T=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return T="equals",null;if("<"==n){t.tokenize=o,t.state=p,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=s(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function s(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=a;break}return"string"};return t.isInAttribute=!0,t}function u(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=o;break}n.next()}return e}}function l(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=l(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=o;break}return n.tokenize=l(e-1),n.tokenize(t,n)}}return"meta"}}function c(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(k.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function f(e){e.context&&(e.context=e.context.prev)}function d(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!k.contextGrabbers.hasOwnProperty(n)||!k.contextGrabbers[n].hasOwnProperty(t))return;f(e)}}function p(e,t,n){return"openTag"==e?(n.tagStart=t.column(),h):"closeTag"==e?m:p}function h(e,t,n){return"word"==e?(n.tagName=t.current(),E="tag",y):(E="error",h)}function m(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&k.implicitlyClosed.hasOwnProperty(n.context.tagName)&&f(n),n.context&&n.context.tagName==r?(E="tag",v):(E="tag error",g)}return E="error",g}function v(e,t,n){return"endTag"!=e?(E="error",v):(f(n),p)}function g(e,t,n){return E="error",v(e,t,n)}function y(e,t,n){if("word"==e)return E="attribute",b;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,i=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||k.autoSelfClosers.hasOwnProperty(r)?d(n,r):(d(n,r),n.context=new c(n,r,i==n.indented)),p}return E="error",y}function b(e,t,n){return"equals"==e?x:(k.allowMissing||(E="error"),y(e,t,n))}function x(e,t,n){return"string"==e?A:"word"==e&&k.allowUnquoted?(E="string",y):(E="error",y(e,t,n))}function A(e,t,n){return"string"==e?A:y(e,t,n)}var w=r.indentUnit,k={},P=i.htmlMode?t:n;for(var C in P)k[C]=P[C];for(var C in i)k[C]=i[C];var T,E;return o.isInText=!0,{startState:function(e){var t={tokenize:o,state:p,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;T=null;var n=t.tokenize(e,t);return(n||T)&&"comment"!=n&&(E=null,t.state=t.state(T||n,e,t),E&&(n="error"==E?n+" error":E)),n},indent:function(t,n,r){var i=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+w;if(i&&i.noIndent)return e.Pass;if(t.tokenize!=a&&t.tokenize!=o)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return k.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+w*(k.multilineTagIndentFactor||1);if(k.alignCDATA&&/$/,blockCommentStart:"",configuration:k.htmlMode?"html":"xml",helperType:k.htmlMode?"html":"xml",skipAttribute:function(e){e.state==x&&(e.state=y)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})},function(e,t,n){"use strict";function r(e){return!(!e||!l[e.nodeName])}function i(e){return!(!e||!u[e.nodeName])}function o(e,t){if(e.firstChild&&"PRE"!==e.nodeName){"function"!=typeof t&&(t=r);for(var n=null,o=!1,u=null,l=s(u,e);l!==e;){if(3===l.nodeType){var c=l.data.replace(/[ \r\n\t]+/g," ");if(n&&!/ $/.test(n.data)||o||" "!==c[0]||(c=c.substr(1)),!c){l=a(l);continue}l.data=c,n=l}else{if(1!==l.nodeType){l=a(l);continue}t(l)||"BR"===l.nodeName?(n&&(n.data=n.data.replace(/ $/,"")),n=null,o=!1):i(l)&&(n=null,o=!0)}var f=s(u,l);u=l,l=f}n&&(n.data=n.data.replace(/ $/,""),n.data||a(n))}}function a(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function s(e,t){return e&&e.parentNode===t||"PRE"===t.nodeName?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}var u=n(331);Object.keys(u).forEach(function(e){u[e.toUpperCase()]=1});var l={};n(158).forEach(function(e){l[e.toUpperCase()]=1}),e.exports=o},function(e,t,n){t=e.exports=n(12)(),t.push([e.id,"@-webkit-keyframes medium-editor-image-loading{0%{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:scale(1);transform:scale(1)}}@keyframes medium-editor-image-loading{0%{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes medium-editor-pop-upwards{0%{opacity:0;-webkit-transform:matrix(.97,0,0,1,0,12);transform:matrix(.97,0,0,1,0,12)}20%{opacity:.7;-webkit-transform:matrix(.99,0,0,1,0,2);transform:matrix(.99,0,0,1,0,2)}40%{opacity:1;-webkit-transform:matrix(1,0,0,1,0,-1);transform:matrix(1,0,0,1,0,-1)}to{-webkit-transform:matrix(1,0,0,1,0,0);transform:matrix(1,0,0,1,0,0)}}@keyframes medium-editor-pop-upwards{0%{opacity:0;-webkit-transform:matrix(.97,0,0,1,0,12);transform:matrix(.97,0,0,1,0,12)}20%{opacity:.7;-webkit-transform:matrix(.99,0,0,1,0,2);transform:matrix(.99,0,0,1,0,2)}40%{opacity:1;-webkit-transform:matrix(1,0,0,1,0,-1);transform:matrix(1,0,0,1,0,-1)}to{-webkit-transform:matrix(1,0,0,1,0,0);transform:matrix(1,0,0,1,0,0)}}.medium-editor-anchor-preview{font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:16px;left:0;line-height:1.4;max-width:280px;position:absolute;text-align:center;top:0;word-break:break-all;word-wrap:break-word;visibility:hidden;z-index:2000}.medium-editor-anchor-preview a{color:#fff;display:inline-block;margin:5px 5px 10px}.medium-editor-anchor-preview-active{visibility:visible}.medium-editor-dragover{background:#ddd}.medium-editor-image-loading{-webkit-animation:medium-editor-image-loading 1s infinite ease-in-out;animation:medium-editor-image-loading 1s infinite ease-in-out;background-color:#333;border-radius:100%;display:inline-block;height:40px;width:40px}.medium-editor-placeholder{position:relative}.medium-editor-placeholder:after{content:attr(data-placeholder)!important;font-style:italic;left:0;position:absolute;top:0;white-space:pre;padding:inherit;margin:inherit}.medium-toolbar-arrow-over:before,.medium-toolbar-arrow-under:after{border-style:solid;content:'';display:block;height:0;left:50%;margin-left:-8px;position:absolute;width:0}.medium-toolbar-arrow-under:after{border-width:8px 8px 0}.medium-toolbar-arrow-over:before{border-width:0 8px 8px;top:-8px}.medium-editor-toolbar{font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:16px;left:0;position:absolute;top:0;visibility:hidden;z-index:2000}.medium-editor-toolbar ul{margin:0;padding:0}.medium-editor-toolbar li{float:left;list-style:none;margin:0;padding:0}.medium-editor-toolbar li button{box-sizing:border-box;cursor:pointer;display:block;font-size:14px;line-height:1.33;margin:0;padding:15px;text-decoration:none}.medium-editor-toolbar li button:focus{outline:none}.medium-editor-toolbar li .medium-editor-action-underline{text-decoration:underline}.medium-editor-toolbar li .medium-editor-action-pre{font-family:Consolas,Liberation Mono,Menlo,Courier,monospace;font-size:12px;font-weight:100;padding:15px 0}.medium-editor-toolbar-active{visibility:visible}.medium-editor-sticky-toolbar{position:fixed;top:1px}.medium-editor-relative-toolbar{position:relative}.medium-editor-toolbar-active.medium-editor-stalker-toolbar{-webkit-animation:medium-editor-pop-upwards .16s forwards linear;animation:medium-editor-pop-upwards .16s forwards linear}.medium-editor-action-bold{font-weight:bolder}.medium-editor-action-italic{font-style:italic}.medium-editor-toolbar-form{display:none}.medium-editor-toolbar-form a,.medium-editor-toolbar-form input{font-family:Helvetica Neue,Helvetica,Arial,sans-serif}.medium-editor-toolbar-form .medium-editor-toolbar-form-row{line-height:14px;margin-left:5px;padding-bottom:5px}.medium-editor-toolbar-form .medium-editor-toolbar-input,.medium-editor-toolbar-form label{border:none;box-sizing:border-box;font-size:14px;margin:0;padding:6px;width:316px;display:inline-block}.medium-editor-toolbar-form .medium-editor-toolbar-input:focus,.medium-editor-toolbar-form label:focus{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;box-shadow:none;outline:0}.medium-editor-toolbar-form a{display:inline-block;font-size:24px;font-weight:bolder;margin:0 10px;text-decoration:none}.medium-editor-toolbar-actions:after{clear:both;content:\"\";display:table}[data-medium-editor-element] img{max-width:100%}[data-medium-editor-element] sub{vertical-align:sub}[data-medium-editor-element] sup{vertical-align:super}.medium-editor-hidden{display:none}",""])},function(e,t,n){t=e.exports=n(12)(),t.push([e.id,".medium-toolbar-arrow-under:after{border-color:#242424 transparent transparent;top:50px}.medium-toolbar-arrow-over:before{border-color:transparent transparent #242424;top:-8px}.medium-editor-toolbar{background-color:#242424;background:-webkit-linear-gradient(top,#242424,rgba(36,36,36,.75));background:linear-gradient(180deg,#242424,rgba(36,36,36,.75));border:1px solid #000;border-radius:5px;box-shadow:0 0 3px #000}.medium-editor-toolbar li button{background-color:#242424;background:-webkit-linear-gradient(top,#242424,rgba(36,36,36,.89));background:linear-gradient(180deg,#242424,rgba(36,36,36,.89));border:0;border-right:1px solid #000;border-left:1px solid #333;border-left:1px solid hsla(0,0%,100%,.1);box-shadow:0 2px 2px rgba(0,0,0,.3);color:#fff;height:50px;min-width:50px;-webkit-transition:background-color .2s ease-in;transition:background-color .2s ease-in}.medium-editor-toolbar li button:hover{background-color:#000;color:#ff0}.medium-editor-toolbar li .medium-editor-button-first{border-bottom-left-radius:5px;border-top-left-radius:5px}.medium-editor-toolbar li .medium-editor-button-last{border-bottom-right-radius:5px;border-top-right-radius:5px}.medium-editor-toolbar li .medium-editor-button-active{background-color:#000;background:-webkit-linear-gradient(top,#242424,rgba(0,0,0,.89));background:linear-gradient(180deg,#242424,rgba(0,0,0,.89));color:#fff}.medium-editor-toolbar-form{background:#242424;border-radius:5px;color:#999}.medium-editor-toolbar-form .medium-editor-toolbar-input{background:#242424;box-sizing:border-box;color:#ccc;height:50px}.medium-editor-toolbar-form a{color:#fff}.medium-editor-toolbar-anchor-preview{background:#242424;border-radius:5px;color:#fff}.medium-editor-placeholder:after{color:#b3b3b1}",""])},function(e,t,n){t=e.exports=n(12)(),t.push([e.id,"/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}",""])},function(e,t,n){t=e.exports=n(12)(),t.push([e.id,"@import url(https://fonts.googleapis.com/css?family=Cousine:400,700,700italic,400italic);",""]),t.push([e.id,".cm-s-atlas.CodeMirror{background:#fff;color:#202020;font-family:Atlas Typewriter,Cousine,Monaco,monospace;font-weight:300;height:auto}.cm-s-atlas .CodeMirror-line::selection,.cm-s-atlas .CodeMirror-line>span::selection,.cm-s-atlas .CodeMirror-line>span>span::selection,.cm-s-atlas div.CodeMirror-selected{background:#90caf9}.cm-s-atlas .CodeMirror-line::-moz-selection,.cm-s-atlas .CodeMirror-line>span::-moz-selection,.cm-s-atlas .CodeMirror-line>span>span::-moz-selection{background:#e0e0e0}.cm-s-atlas .CodeMirror-gutters{background:#f5f5f5;border-right:0}.cm-s-atlas .CodeMirror-guttermarker{color:#ac4142}.cm-s-atlas .CodeMirror-guttermarker-subtle,.cm-s-atlas .CodeMirror-linenumber{color:#b0b0b0}.cm-s-atlas .CodeMirror-cursor{border-left:2px solid #2196f3}.cm-s-atlas span.cm-quote{font-style:italic}.cm-s-atlas span.cm-comment{color:#8f5536}.cm-s-atlas span.cm-atom,.cm-s-atlas span.cm-number{color:#aa759f}.cm-s-atlas span.cm-attribute,.cm-s-atlas span.cm-property{color:#90a959}.cm-s-atlas span.cm-keyword{color:#ac4142}.cm-s-atlas span.cm-string{color:#f4bf75}.cm-s-atlas span.cm-variable{color:#90a959}.cm-s-atlas span.cm-variable-2{color:#788696}.cm-s-atlas span.cm-def{color:#d28445}.cm-s-atlas span.cm-bracket{color:#202020}.cm-s-atlas span.cm-tag{color:#ac4142}.cm-s-atlas span.cm-link{color:#aa759f}.cm-s-atlas span.cm-error{background:#ac4142;color:#505050}.cm-s-atlas .CodeMirror-activeline-background{background:#dddcdc}.cm-s-atlas .CodeMirror-matchingbracket{text-decoration:underline;color:#fff!important}",""])},function(e,t,n){t=e.exports=n(12)(),t.push([e.id,"@font-face{font-family:Atlas Grotesk;src:url("+n(327)+") format('woff');font-weight:400;font-style:normal}@font-face{font-family:Atlas Grotesk;src:url("+n(328)+") format('woff');font-weight:400;font-style:italic}@font-face{font-family:Atlas Grotesk;src:url("+n(326)+") format('woff');font-weight:700;font-style:normal}@font-face{font-family:Atlas Grotesk;src:url("+n(141)+") format('woff');font-weight:700;font-style:italic}@font-face{font-family:Atlas Grotesk;src:url("+n(141)+") format('woff');font-weight:700;font-style:italic}@font-face{font-family:Atlas Typewriter;src:url("+n(330)+") format('woff');font-weight:400;font-style:normal}@font-face{font-family:Atlas Typewriter;src:url("+n(329)+") format('woff');font-weight:700;font-style:normal}",""])},function(e,t,n){t=e.exports=n(12)(),t.push([e.id,".Header__header___1hCuT{display:flex;width:100%;height:42px;position:fixed;z-index:9999;justify-content:space-between;background-color:#111;color:#fff}.Header__header___1hCuT i{color:#fff;font-family:serif}.Header__header___1hCuT .Header__headerItem___QODyV{width:150px;padding:12px 22px;font-size:13px;font-weight:300;font-family:Atlas Grotesk,Helvetica Neue,sans-serif;text-align:center}.Header__header___1hCuT .Header__headerItem___QODyV:first-child{text-align:left}.Header__header___1hCuT .Header__headerItem___QODyV:last-child{text-align:right}.Header__header___1hCuT .Header__editorToggle___2Bcm9 div{margin-right:12px;cursor:pointer;opacity:.4;color:#fff}.Header__header___1hCuT .Header__editorToggle___2Bcm9 div.Header__active___2vcAt{opacity:1}.Header__header___1hCuT .Header__editorToggle___2Bcm9 div:first-child{margin-top:2px;margin-right:15px}.Header__header___1hCuT .Header__editorToggle___2Bcm9 div:last-child{margin-top:-2px}.Header__header___1hCuT .Header__textIcon___T7vs0{font-family:Times,serif;font-size:20px}",""]),t.locals={header:"Header__header___1hCuT",headerItem:"Header__headerItem___QODyV",editorToggle:"Header__editorToggle___2Bcm9",active:"Header__active___2vcAt",textIcon:"Header__textIcon___T7vs0"}},function(e,t,n){t=e.exports=n(12)(),t.push([e.id,".MarkdownEditor__container___m9ImS{font-weight:400;font-size:1em;line-height:1.5em;margin:0 auto;padding:2em 3em;max-width:50em}@media all and (max-width:2000px) and (min-width:960px){.MarkdownEditor__container___m9ImS{font-size:1.1em}}",""]),t.locals={container:"MarkdownEditor__container___m9ImS"}},function(e,t,n){t=e.exports=n(12)(),t.push([e.id,".TextEditor__container___1wyeS{font-weight:400;font-size:1em;line-height:1.5em;margin:0 auto;padding:2em 3em;max-width:50em}.TextEditor__editor___23Qnn{outline:none;font-family:Atlas Grotesk,Helvetica Neue,sans-serif}@media all and (max-width:2000px) and (min-width:960px){.TextEditor__container___1wyeS{font-size:1.1em}}",""]),t.locals={container:"TextEditor__container___1wyeS",editor:"TextEditor__editor___23Qnn"}},function(e,t,n){t=e.exports=n(12)(),t.push([e.id,".App__container___355Yh{display:flex;flex-flow:column;width:100%;height:100%;background-color:#fff;font-family:-apple-system,Helvetica Neue,Lucida Grande;color:#222}",""]),t.locals={container:"App__container___355Yh"}},function(e,t,n){t=e.exports=n(12)(),t.push([e.id,".Dashboard__container___2SQeY{display:flex;padding-top:48px}.Dashboard__panel___3wTFN{width:50%}.Dashboard__fullscreen___2vN3A{width:100%}.Dashboard__markdown___fMe4o{background-color:#fff}",""]),t.locals={container:"Dashboard__container___2SQeY",panel:"Dashboard__panel___3wTFN",fullscreen:"Dashboard__fullscreen___2vN3A",markdown:"Dashboard__markdown___fMe4o"}},function(e,t,n){function r(e){return null===e||void 0===e}function i(e){return e&&"object"==typeof e&&"number"==typeof e.length?"function"!=typeof e.copy||"function"!=typeof e.slice?!1:e.length>0&&"number"!=typeof e[0]?!1:!0:!1}function o(e,t,n){var o,c;if(r(e)||r(t))return!1;if(e.prototype!==t.prototype)return!1;if(u(e))return u(t)?(e=a.call(e),t=a.call(t),l(e,t,n)):!1;if(i(e)){if(!i(t))return!1;if(e.length!==t.length)return!1;for(o=0;o=0;o--)if(f[o]!=d[o])return!1;for(o=f.length-1;o>=0;o--)if(c=f[o],!l(e[c],t[c],n))return!1;return typeof e==typeof t}var a=Array.prototype.slice,s=n(181),u=n(180),l=e.exports=function(e,t,n){return n||(n={}),e===t?!0:e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:o(e,t,n)}},function(e,t){function n(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function r(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}var i="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();t=e.exports=i?n:r,t.supported=n,t.unsupported=r},function(e,t){function n(e){var t=[];for(var n in e)t.push(n);return t}t=e.exports="function"==typeof Object.keys?Object.keys:n,t.shim=n},function(e,t){"use strict";function n(e){return e.replace(r,function(e,t){return t.toUpperCase()})}var r=/-(.)/g;e.exports=n},function(e,t,n){"use strict";function r(e){return i(e.replace(o,"ms-"))}var i=n(182),o=/^-ms-/;e.exports=r},function(e,t,n){"use strict";function r(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"length"in e&&!("setInterval"in e)&&"number"!=typeof e.nodeType&&(Array.isArray(e)||"callee"in e||"item"in e)}function i(e){return r(e)?Array.isArray(e)?e.slice():o(e):[e]}var o=n(193);e.exports=i},function(e,t,n){"use strict";function r(e){var t=e.match(c);return t&&t[1].toLowerCase()}function i(e,t){var n=l;l?void 0:u(!1);var i=r(e),o=i&&s(i);if(o){n.innerHTML=o[1]+e+o[2];for(var c=o[0];c--;)n=n.lastChild}else n.innerHTML=e;var f=n.getElementsByTagName("script");f.length&&(t?void 0:u(!1),a(f).forEach(t));for(var d=a(n.childNodes);n.lastChild;)n.removeChild(n.lastChild);return d}var o=n(5),a=n(184),s=n(85),u=n(1),l=o.canUseDOM?document.createElement("div"):null,c=/^\s*<(\w+)/;e.exports=i},function(e,t){"use strict";function n(e){return e===window?{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}e.exports=n},function(e,t){"use strict";function n(e){return e.replace(r,"-$1").toLowerCase()}var r=/([A-Z])/g;e.exports=n},function(e,t,n){"use strict";function r(e){return i(e).replace(o,"-ms-")}var i=n(187),o=/^ms-/;e.exports=r},function(e,t){"use strict";function n(e){return!(!e||!("function"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}e.exports=n},function(e,t,n){"use strict";function r(e){return i(e)&&3==e.nodeType}var i=n(189);e.exports=r},function(e,t){"use strict";function n(e,t,n){if(!e)return null;var i={};for(var o in e)r.call(e,o)&&(i[o]=t.call(n,e[o],o,e));return i}var r=Object.prototype.hasOwnProperty;e.exports=n},function(e,t){"use strict";function n(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}e.exports=n},function(e,t,n){"use strict";function r(e){var t=e.length;if(Array.isArray(e)||"object"!=typeof e&&"function"!=typeof e?i(!1):void 0,"number"!=typeof t?i(!1):void 0,0===t||t-1 in e?void 0:i(!1),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(n){}for(var r=Array(t),o=0;t>o;o++)r[o]=e[o];return r}var i=n(1);e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e){return l.indexOf(e)>-1}function o(e){return u["default"](e)&&"undefined"!=typeof e.type&&Object.keys(e).every(i)}function a(e){return e.error===!0}t.__esModule=!0,t.isFSA=o,t.isError=a;var s=n(202),u=r(s),l=["type","payload","error","meta"]},function(e,t){"use strict";var n={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,arguments:!0,arity:!0};e.exports=function(e,t){for(var i=Object.getOwnPropertyNames(t),o=0;o-1?t:e}function c(e,t){t=t||{};var n=t.body;if(c.prototype.isPrototypeOf(e)){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new r(e.headers)),this.method=e.method,this.mode=e.mode,n||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=e;if(this.credentials=t.credentials||this.credentials||"omit",(t.headers||!this.headers)&&(this.headers=new r(t.headers)),this.method=l(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function f(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(i))}}),t}function d(e){var t=new r,n=e.getAllResponseHeaders().trim().split("\n");return n.forEach(function(e){var n=e.trim().split(":"),r=n.shift().trim(),i=n.join(":").trim();t.append(r,i)}),t}function p(e,t){t||(t={}),this.type="default",this.status=t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText,this.headers=t.headers instanceof r?t.headers:new r(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){r.prototype.append=function(e,r){e=t(e),r=n(r);var i=this.map[e];i||(i=[],this.map[e]=i),i.push(r)},r.prototype["delete"]=function(e){delete this.map[t(e)]},r.prototype.get=function(e){var n=this.map[t(e)];return n?n[0]:null},r.prototype.getAll=function(e){return this.map[t(e)]||[]},r.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},r.prototype.set=function(e,r){this.map[t(e)]=[n(r)]},r.prototype.forEach=function(e,t){Object.getOwnPropertyNames(this.map).forEach(function(n){this.map[n].forEach(function(r){e.call(t,r,n,this)},this)},this)};var h={blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e},m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];c.prototype.clone=function(){return new c(this)},u.call(c.prototype),u.call(p.prototype),p.prototype.clone=function(){return new p(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new r(this.headers),url:this.url})},p.error=function(){var e=new p(null,{status:0,statusText:""});return e.type="error",e};var v=[301,302,303,307,308];p.redirect=function(e,t){if(-1===v.indexOf(t))throw new RangeError("Invalid status code");return new p(null,{status:t,headers:{location:e}})},e.Headers=r,e.Request=c,e.Response=p,e.fetch=function(e,t){return new Promise(function(n,r){function i(){return"responseURL"in a?a.responseURL:/^X-Request-URL:/m.test(a.getAllResponseHeaders())?a.getResponseHeader("X-Request-URL"):void 0}var o;o=c.prototype.isPrototypeOf(e)&&!t?e:new c(e,t);var a=new XMLHttpRequest;a.onload=function(){var e=1223===a.status?204:a.status;if(100>e||e>599)return void r(new TypeError("Network request failed"));var t={status:e,statusText:a.statusText,headers:d(a),url:i()},o="response"in a?a.response:a.responseText;n(new p(o,t))},a.onerror=function(){r(new TypeError("Network request failed"))},a.open(o.method,o.url,!0),"include"===o.credentials&&(a.withCredentials=!0),"responseType"in a&&h.blob&&(a.responseType="blob"),o.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),a.send("undefined"==typeof o._bodyInit?null:o._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this),e.exports=t.fetch}).call(t)}).call(t,function(){return this}())},function(e,t){e.exports={name:"BeautifulAtlas",version:"0.0.1",description:"For writing",main:"index.js",scripts:{clean:"rimraf dist","build:webpack":"cross-env NODE_ENV=production webpack --config webpack.config.prod.js --progress --colors",build:"npm run clean && npm run build:webpack",start:"node server.js",lint:"eslint src"},repository:{type:"git",url:"git+ssh://git@github.com/jorilallo/atlas.git"},author:"Jori Lallo",license:"ISC",bugs:{url:"https://github.com/jorilallo/atlas/issues"},homepage:"https://github.com/jorilallo/atlas#readme",dependencies:{express:"^4.13.4",react:"^0.14.7","react-dom":"^0.14.7","body-parser":"^1.15.0"},devDependencies:{"babel-core":"^6.4.5","babel-eslint":"^4.1.8","babel-loader":"^6.2.1","babel-preset-es2015":"^6.3.13","babel-preset-react":"^6.3.13","babel-preset-react-hmre":"^1.0.1","babel-preset-stage-0":"^6.5.0",classnames:"^2.2.3",codemirror:"^5.11.0","cross-env":"^1.0.7","css-loader":"^0.23.1",dotenv:"^2.0.0",eslint:"^1.10.3","eslint-config-airbnb":"^5.0.0","eslint-plugin-react":"^3.16.1","exports-loader":"^0.6.3",fetch:"^1.0.1","file-loader":"^0.8.5",history:"^1.17.0","imports-loader":"^0.6.5","json-loader":"^0.5.4",lodash:"^4.3.0",marked:"^0.3.5","node-sass":"^3.4.2","normalize.css":"^3.0.3",react:"^0.14.7","react-codemirror":"^0.2.5","react-medium-editor":"^1.6.2","react-redux":"^4.4.0","react-router":"^2.0.0",redux:"^3.3.1","redux-storage":"^4.0.0","redux-storage-engine-localstorage":"^1.0.0","sass-loader":"^3.1.2","style-loader":"^0.13.0","to-markdown":"^2.0.1","url-loader":"^0.5.7",webpack:"^1.12.12","webpack-dev-middleware":"^1.5.1","webpack-hot-middleware":"^2.6.4","whatwg-fetch":"^0.11.0"}}},function(e,t){function n(e){return function(t,n,r){for(var i=-1,o=Object(t),a=r(t),s=a.length;s--;){var u=a[e?s:++i];if(n(o[u],u,o)===!1)break}return t}}var r=n();e.exports=r},function(e,t,n){(function(e,n){function r(e){return e&&e.Object===Object?e:null}function i(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(n){}return t}function o(){}function a(e,t){return u(e,t)&&delete e[t]}function s(e,t){if(ne){var n=e[t];return n===D?void 0:n}return Q.call(e,t)?e[t]:void 0}function u(e,t){return ne?void 0!==e[t]:Q.call(e,t)}function l(e,t,n){e[t]=ne&&void 0===n?D:n}function c(e){var t=-1,n=e?e.length:0;for(this.clear();++tn)return!1;var r=e.length-1;return n==r?e.pop():ee.call(e,n,1),!0}function k(e,t){var n=C(e,t);return 0>n?void 0:e[n][1]}function P(e,t){return C(e,t)>-1}function C(e,t){for(var n=e.length;n--;)if(N(e[n][0],t))return n;return-1}function T(e,t,n){var r=C(e,t);0>r?e.push([t,n]):e[r][1]=n}function E(e,t){var n=null==e?void 0:e[t];return R(n)?n:void 0}function S(e){var t=typeof e;return"number"==t||"boolean"==t||"string"==t&&"__proto__"!=e||null==e}function N(e,t){return e===t||e!==e&&t!==t}function M(e){var t=O(e)?_.call(e):"";return t==I||t==z}function O(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function L(e){return!!e&&"object"==typeof e}function R(e){return null==e?!1:M(e)?$.test(Y.call(e)):L(e)&&(i(e)?$:W).test(e)}var j=200,D="__lodash_hash_undefined__",I="[object Function]",z="[object GeneratorFunction]",H=/[\\^$.*+?()[\]{}|]/g,W=/^\[object .+?Constructor\]$/,F={"function":!0,object:!0},q=F[typeof t]&&t&&!t.nodeType?t:void 0,X=F[typeof e]&&e&&!e.nodeType?e:void 0,U=r(q&&X&&"object"==typeof n&&n),V=r(F[typeof self]&&self),B=r(F[typeof window]&&window),Z=r(F[typeof this]&&this),G=U||B!==(Z&&Z.window)&&B||V||Z||Function("return this")(),J=Array.prototype,K=Object.prototype,Y=Function.prototype.toString,Q=K.hasOwnProperty,_=K.toString,$=RegExp("^"+Y.call(Q).replace(H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ee=J.splice,te=E(G,"Map"),ne=E(Object,"create");o.prototype=ne?ne(null):K,c.prototype.clear=f,c.prototype["delete"]=d,c.prototype.get=p,c.prototype.has=h,c.prototype.set=m,v.prototype.clear=g,v.prototype["delete"]=y,v.prototype.get=b,v.prototype.has=x,v.prototype.set=A,e.exports=v}).call(t,n(48)(e),function(){return this}())},function(e,t){function n(e){return!!e&&"object"==typeof e}function r(e,t){var n=null==e?void 0:e[t];return s(n)?n:void 0}function i(e){return"number"==typeof e&&e>-1&&e%1==0&&g>=e}function o(e){return a(e)&&h.call(e)==l}function a(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function s(e){return null==e?!1:o(e)?m.test(d.call(e)):n(e)&&c.test(e)}var u="[object Array]",l="[object Function]",c=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,p=f.hasOwnProperty,h=f.toString,m=RegExp("^"+d.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),v=r(Array,"isArray"),g=9007199254740991,y=v||function(e){return n(e)&&i(e.length)&&h.call(e)==u};e.exports=y},function(e,t){function n(e){var t=r(e)?s.call(e):"";return t==i||t==o}function r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var i="[object Function]",o="[object GeneratorFunction]",a=Object.prototype,s=a.toString;e.exports=n},function(e,t,n){function r(e){return!!e&&"object"==typeof e}function i(e,t){return a(e,t,u)}function o(e){var t;if(!r(e)||d.call(e)!=l||s(e)||!f.call(e,"constructor")&&(t=e.constructor,"function"==typeof t&&!(t instanceof t)))return!1;var n;return i(e,function(e,t){n=t}),void 0===n||f.call(e,n)}var a=n(198),s=n(87),u=n(203),l="[object Object]",c=Object.prototype,f=c.hasOwnProperty,d=c.toString;e.exports=o},function(e,t,n){function r(e,t){return e="number"==typeof e||l.test(e)?+e:-1,t=null==t?d:t,e>-1&&e%1==0&&t>e}function i(e){return"number"==typeof e&&e>-1&&e%1==0&&d>=e}function o(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function a(e){if(null==e)return[];o(e)||(e=Object(e));var t=e.length;t=t&&i(t)&&(u(e)||s(e))&&t||0;for(var n=e.constructor,a=-1,l="function"==typeof n&&n.prototype===e,c=Array(t),d=t>0;++ae?-1:1;return t*c}var n=e%1;return e===e?n?e-n:e:0}function s(e){if(o(e)){var t=i(e.valueOf)?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(h,"");var n=v.test(e);return n||g.test(e)?y(e.slice(2),n?2:8):m.test(e)?f:+e}var u="Expected a function",l=1/0,c=1.7976931348623157e308,f=NaN,d="[object Function]",p="[object GeneratorFunction]",h=/^\s+|\s+$/g,m=/^[-+]0x[0-9a-f]+$/i,v=/^0b[01]+$/i,g=/^0o[0-7]+$/i,y=parseInt,b=Object.prototype,x=b.toString,A=Math.max;e.exports=r},function(e,t){function n(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(n){}return t}e.exports=n},function(e,t){function n(e){return!!e&&"object"==typeof e}e.exports=n},function(e,t,n){(function(t){(function(){function t(e){this.tokens=[],this.tokens.links={},this.options=e||c.defaults,this.rules=f.normal,this.options.gfm&&(this.options.tables?this.rules=f.tables:this.rules=f.gfm)}function n(e,t){if(this.options=t||c.defaults,this.links=e,this.rules=d.normal,this.renderer=this.options.renderer||new r,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=d.breaks:this.rules=d.gfm:this.options.pedantic&&(this.rules=d.pedantic)}function r(e){this.options=e||{}}function i(e){this.tokens=[],this.token=null,this.options=e||c.defaults,this.options.renderer=this.options.renderer||new r,this.renderer=this.options.renderer,this.renderer.options=this.options}function o(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function a(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function s(e,t){return e=e.source,t=t||"",function n(r,i){return r?(i=i.source||i,i=i.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,i),n):new RegExp(e,t)}}function u(){}function l(e){for(var t,n,r=1;rAn error occured:

"+o(d.message+"",!0)+"
";throw d}}var f={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:u,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:u,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:u,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};f.bullet=/(?:[*+-]|\d+\.)/,f.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,f.item=s(f.item,"gm")(/bull/g,f.bullet)(),f.list=s(f.list)(/bull/g,f.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+f.def.source+")")(),f.blockquote=s(f.blockquote)("def",f.def)(),f._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",f.html=s(f.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,f._tag)(),f.paragraph=s(f.paragraph)("hr",f.hr)("heading",f.heading)("lheading",f.lheading)("blockquote",f.blockquote)("tag","<"+f._tag)("def",f.def)(),f.normal=l({},f),f.gfm=l({},f.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),f.gfm.paragraph=s(f.paragraph)("(?!","(?!"+f.gfm.fences.source.replace("\\1","\\2")+"|"+f.list.source.replace("\\1","\\3")+"|")(),f.tables=l({},f.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),t.rules=f,t.lex=function(e,n){var r=new t(n);return r.lex(e)},t.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},t.prototype.token=function(e,t,n){for(var r,i,o,a,s,u,l,c,d,e=e.replace(/^ +$/gm,"");e;)if((o=this.rules.newline.exec(e))&&(e=e.substring(o[0].length),o[0].length>1&&this.tokens.push({type:"space"})),o=this.rules.code.exec(e))e=e.substring(o[0].length),o=o[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?o:o.replace(/\n+$/,"")});else if(o=this.rules.fences.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"code",lang:o[2],text:o[3]||""});else if(o=this.rules.heading.exec(e))e=e.substring(o[0].length),this.tokens.push({type:"heading",depth:o[1].length,text:o[2]});else if(t&&(o=this.rules.nptable.exec(e))){for(e=e.substring(o[0].length),u={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/\n$/,"").split("\n")},c=0;c ?/gm,""),this.token(o,t,!0),this.tokens.push({type:"blockquote_end"});else if(o=this.rules.list.exec(e)){for(e=e.substring(o[0].length),a=o[2],this.tokens.push({type:"list_start",ordered:a.length>1}),o=o[0].match(this.rules.item),r=!1,d=o.length,c=0;d>c;c++)u=o[c],l=u.length,u=u.replace(/^ *([*+-]|\d+\.) +/,""),~u.indexOf("\n ")&&(l-=u.length,u=this.options.pedantic?u.replace(/^ {1,4}/gm,""):u.replace(new RegExp("^ {1,"+l+"}","gm"),"")),this.options.smartLists&&c!==d-1&&(s=f.bullet.exec(o[c+1])[0],a===s||a.length>1&&s.length>1||(e=o.slice(c+1).join("\n")+e,c=d-1)),i=r||/\n\n(?!\s*$)/.test(u),c!==d-1&&(r="\n"===u.charAt(u.length-1),i||(i=r)),this.tokens.push({type:i?"loose_item_start":"list_item_start"}),this.token(u,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(o=this.rules.html.exec(e))e=e.substring(o[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===o[1]||"script"===o[1]||"style"===o[1]),text:o[0]});else if(!n&&t&&(o=this.rules.def.exec(e)))e=e.substring(o[0].length),this.tokens.links[o[1].toLowerCase()]={href:o[2],title:o[3]};else if(t&&(o=this.rules.table.exec(e))){for(e=e.substring(o[0].length),u={type:"table",header:o[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:o[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:o[3].replace(/(?: *\| *)?\n$/,"").split("\n")},c=0;c])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:u,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:u,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,d.link=s(d.link)("inside",d._inside)("href",d._href)(),d.reflink=s(d.reflink)("inside",d._inside)(),d.normal=l({},d),d.pedantic=l({},d.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),d.gfm=l({},d.normal,{escape:s(d.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:s(d.text)("]|","~]|")("|","|https?://|")()}),d.breaks=l({},d.gfm,{br:s(d.br)("{2,}","*")(),text:s(d.gfm.text)("{2,}","*")()}),n.rules=d,n.output=function(e,t,r){var i=new n(t,r);return i.output(e)},n.prototype.output=function(e){for(var t,n,r,i,a="";e;)if(i=this.rules.escape.exec(e))e=e.substring(i[0].length),a+=i[1];else if(i=this.rules.autolink.exec(e))e=e.substring(i[0].length),"@"===i[2]?(n=":"===i[1].charAt(6)?this.mangle(i[1].substring(7)):this.mangle(i[1]),r=this.mangle("mailto:")+n):(n=o(i[1]),r=n),a+=this.renderer.link(r,null,n);else if(this.inLink||!(i=this.rules.url.exec(e))){if(i=this.rules.tag.exec(e))!this.inLink&&/^/i.test(i[0])&&(this.inLink=!1),e=e.substring(i[0].length),a+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(i[0]):o(i[0]):i[0];else if(i=this.rules.link.exec(e))e=e.substring(i[0].length),this.inLink=!0,a+=this.outputLink(i,{href:i[2],title:i[3]}),this.inLink=!1;else if((i=this.rules.reflink.exec(e))||(i=this.rules.nolink.exec(e))){if(e=e.substring(i[0].length),t=(i[2]||i[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){a+=i[0].charAt(0),e=i[0].substring(1)+e;continue}this.inLink=!0,a+=this.outputLink(i,t),this.inLink=!1}else if(i=this.rules.strong.exec(e))e=e.substring(i[0].length),a+=this.renderer.strong(this.output(i[2]||i[1]));else if(i=this.rules.em.exec(e))e=e.substring(i[0].length),a+=this.renderer.em(this.output(i[2]||i[1]));else if(i=this.rules.code.exec(e))e=e.substring(i[0].length),a+=this.renderer.codespan(o(i[2],!0));else if(i=this.rules.br.exec(e))e=e.substring(i[0].length),a+=this.renderer.br();else if(i=this.rules.del.exec(e))e=e.substring(i[0].length),a+=this.renderer.del(this.output(i[1]));else if(i=this.rules.text.exec(e))e=e.substring(i[0].length),a+=this.renderer.text(o(this.smartypants(i[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(i[0].length),n=o(i[1]),r=n,a+=this.renderer.link(r,null,n);return a},n.prototype.outputLink=function(e,t){var n=o(t.href),r=t.title?o(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,o(e[1]))},n.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},n.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,i=0;r>i;i++)t=e.charCodeAt(i),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},r.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
'+(n?e:o(e,!0))+"\n
\n":"
"+(n?e:o(e,!0))+"\n
"},r.prototype.blockquote=function(e){return"
\n"+e+"
\n"},r.prototype.html=function(e){return e},r.prototype.heading=function(e,t,n){return"'+e+"\n"},r.prototype.hr=function(){return this.options.xhtml?"
\n":"
\n"},r.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},r.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},r.prototype.paragraph=function(e){return"

    "+e+"

    \n"},r.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},r.prototype.tablerow=function(e){return"\n"+e+"\n"},r.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"\n"},r.prototype.strong=function(e){return""+e+""},r.prototype.em=function(e){return""+e+""},r.prototype.codespan=function(e){return""+e+""},r.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},r.prototype.del=function(e){return""+e+""},r.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(a(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(i){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var o='
    "},r.prototype.image=function(e,t,n){var r=''+n+'":">"},r.prototype.text=function(e){return e},i.parse=function(e,t,n){var r=new i(t,n);return r.parse(e)},i.prototype.parse=function(e){this.inline=new n(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},i.prototype.next=function(){return this.token=this.tokens.pop()},i.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},i.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},i.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,i,o="",a="";for(n="",e=0;et;t++)if(t in this&&this[t]===e)return t;return-1},s=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},u=function(e,t){if(""===t)throw new s("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(t))throw new s("INVALID_CHARACTER_ERR","String contains an invalid character");return a.call(e,t)},l=function(e){for(var t=o.call(e.getAttribute("class")||""),n=t?t.split(/\s+/):[],r=0,i=n.length;i>r;r++)this.push(n[r]);this._updateClassName=function(){e.setAttribute("class",this.toString())}},c=l[n]=[],f=function(){return new l(this)};if(s[n]=Error[n],c.item=function(e){return this[e]||null},c.contains=function(e){return e+="",-1!==u(this,e)},c.add=function(){var e,t=arguments,n=0,r=t.length,i=!1;do e=t[n]+"",-1===u(this,e)&&(this.push(e),i=!0);while(++nu;u++)i+=String.fromCharCode(o[u]);n.push(i)}else if("Blob"===t(e)||"File"===t(e)){if(!a)throw new s("NOT_READABLE_ERR");var c=new a;n.push(c.readAsBinaryString(e))}else e instanceof r?"base64"===e.encoding&&m?n.push(m(e.data)):"URI"===e.encoding?n.push(decodeURIComponent(e.data)):"raw"===e.encoding&&n.push(e.data):("string"!=typeof e&&(e+=""),n.push(unescape(encodeURIComponent(e))))},i.getBlob=function(e){return arguments.length||(e=null),new r(this.data.join(""),e,"raw")},i.toString=function(){return"[object BlobBuilder]"},o.slice=function(e,t,n){var i=arguments.length;return 3>i&&(n=null),new r(this.data.slice(e,i>1?t:this.data.length),n,this.encoding)},o.toString=function(){return"[object Blob]"},o.close=function(){this.size=0,delete this.data},n}(e);e.Blob=function(e,t){var r=t?t.type||"":"",i=new n;if(e)for(var o=0,a=e.length;a>o;o++)Uint8Array&&e[o]instanceof Uint8Array?i.append(e[o].buffer):i.append(e[o]);var s=i.getBlob(r);return!s.slice&&s.webkitSlice&&(s.slice=s.webkitSlice),s};var r=Object.getPrototypeOf||function(e){return e.__proto__};e.Blob.prototype=r(new e.Blob)}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content||this),function(t,n){"use strict";e.exports=n}(this,function(){"use strict";function e(e,t){return this.init(e,t)}return e.extensions={},function(t){function n(e,t){var n,r=Array.prototype.slice.call(arguments,2);t=t||{};for(var i=0;i-1,isMac:t.navigator.platform.toUpperCase().indexOf("MAC")>=0,keyCode:{BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,DELETE:46,K:75,M:77},isMetaCtrlKey:function(e){return s.isMac&&e.metaKey||!s.isMac&&e.ctrlKey?!0:!1},isKey:function(e,t){var n=s.getKeyCode(e);return!1===Array.isArray(t)?n===t:-1===t.indexOf(n)?!1:!0},getKeyCode:function(e){var t=e.which;return null===t&&(t=null!==e.charCode?e.charCode:e.keyCode),t},blockContainerElementNames:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","li","ol","address","article","aside","audio","canvas","dd","dl","dt","fieldset","figcaption","figure","footer","form","header","hgroup","main","nav","noscript","output","section","video","table","thead","tbody","tfoot","tr","th","td"],emptyElementNames:["br","col","colgroup","hr","img","input","source","wbr"],extend:function(){var e=[!0].concat(Array.prototype.slice.call(arguments));return n.apply(this,e)},defaults:function(){var e=[!1].concat(Array.prototype.slice.call(arguments));return n.apply(this,e)},createLink:function(e,t,n,r){var i=e.createElement("a");return s.moveTextRangeIntoElement(t[0],t[t.length-1],i),i.setAttribute("href",n),r&&i.setAttribute("target",r),i},findOrCreateMatchingTextNodes:function(e,t,n){for(var r=e.createTreeWalker(t,NodeFilter.SHOW_ALL,null,!1),i=[],o=0,a=!1,u=null,l=null;null!==(u=r.nextNode());)if(!(u.nodeType>3))if(3===u.nodeType){if(!a&&n.startn.end+1)throw new Error("PerformLinking overshot the target!");a&&i.push(l||u),o+=u.nodeValue.length,null!==l&&(o+=l.nodeValue.length,r.nextNode()),l=null}else"img"===u.tagName.toLowerCase()&&(!a&&n.start<=o&&(a=!0),a&&i.push(u));return i},splitStartNodeIfNeeded:function(e,t,n){return t!==n?e.splitText(t-n):null},splitEndNodeIfNeeded:function(e,t,n,r){var i,o;i=r+(t||e).nodeValue.length+(t?e.nodeValue.length:0)-1,o=(t||e).nodeValue.length-(i+1-n),i>=n&&r!==i&&0!==o&&(t||e).splitText(o)},splitByBlockElements:function(t){if(3!==t.nodeType&&1!==t.nodeType)return[];var n=[],r=e.util.blockContainerElementNames.join(",");if(3===t.nodeType||0===t.querySelectorAll(r).length)return[t];for(var i=0;i0)break;r=o.nextNode()}return r},findPreviousSibling:function(e){if(!e||s.isMediumEditorElement(e))return!1;for(var t=e.previousSibling;!t&&!s.isMediumEditorElement(e.parentNode);)e=e.parentNode,t=e.previousSibling;return t},isDescendant:function(e,t,n){if(!e||!t)return!1;if(e===t)return!!n;if(1!==e.nodeType)return!1;if(r||3!==t.nodeType)return e.contains(t);for(var i=t.parentNode;null!==i;){if(i===e)return!0;i=i.parentNode}return!1},isElement:function(e){return!(!e||1!==e.nodeType)},throttle:function(e,t){var n,r,i,o=50,a=null,s=0,u=function(){s=Date.now(),a=null,i=e.apply(n,r),a||(n=r=null)};return t||0===t||(t=o),function(){var o=Date.now(),l=t-(o-s);return n=this,r=arguments,0>=l||l>t?(a&&(clearTimeout(a),a=null),s=o,i=e.apply(n,r),a||(n=r=null)):a||(a=setTimeout(u,l)),i}},traverseUp:function(e,t){if(!e)return!1;do{if(1===e.nodeType){if(t(e))return e;if(s.isMediumEditorElement(e))return!1}e=e.parentNode}while(e);return!1},htmlEntities:function(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},insertHTMLCommand:function(t,n){var r,i,o,a,u,l,c;if(!e.util.isEdge&&t.queryCommandSupported("insertHTML"))try{return t.execCommand("insertHTML",!1,n)}catch(f){}if(r=t.getSelection(),r.rangeCount){if(i=r.getRangeAt(0),c=i.commonAncestorContainer,s.isMediumEditorElement(c)&&!c.firstChild)i.selectNode(c.appendChild(t.createTextNode("")));else if(3===c.nodeType&&0===i.startOffset&&i.endOffset===c.nodeValue.length||3!==c.nodeType&&c.innerHTML===i.toString()){for(;!s.isMediumEditorElement(c)&&c.parentNode&&1===c.parentNode.childNodes.length&&!s.isMediumEditorElement(c.parentNode);)c=c.parentNode;i.selectNode(c)}for(i.deleteContents(),o=t.createElement("div"),o.innerHTML=n,a=t.createDocumentFragment();o.firstChild;)u=o.firstChild,l=a.appendChild(u);i.insertNode(a),l&&(i=i.cloneRange(),i.setStartAfter(l),i.collapse(!0),r.removeAllRanges(),r.addRange(i))}},execFormatBlock:function(t,n){var r,i=s.getTopBlockContainer(e.selection.getSelectionStart(t));if("blockquote"===n){if(i&&(r=Array.prototype.slice.call(i.childNodes),r.some(function(e){return s.isBlockContainer(e)})))return t.execCommand("outdent",!1,null);if(s.isIE)return t.execCommand("indent",!1,n)}if(i&&n===i.nodeName.toLowerCase()&&(n="p"),s.isIE&&(n="<"+n+">"),i&&"blockquote"===i.nodeName.toLowerCase()){if(s.isIE&&"

    "===n)return t.execCommand("outdent",!1,n);if((s.isFF||s.isEdge)&&"p"===n)return r=Array.prototype.slice.call(i.childNodes),r.some(function(e){return!s.isBlockContainer(e)})&&t.execCommand("formatBlock",!1,n),t.execCommand("outdent",!1,n)}return t.execCommand("formatBlock",!1,n)},setTargetBlank:function(e,t){var n,r=t||!1;if("a"===e.nodeName.toLowerCase())e.target="_blank";else for(e=e.getElementsByTagName("a"),n=0;nr?(i=i.parentNode,n-=1):(o=o.parentNode,r-=1);for(;i!==o;)i=i.parentNode,o=o.parentNode;return i},isElementAtBeginningOfBlock:function(e){for(var t,n;!s.isBlockContainer(e)&&!s.isMediumEditorElement(e);){for(n=e;n=n.previousSibling;)if(t=3===n.nodeType?n.nodeValue:n.textContent,t.length>0)return!1;e=e.parentNode}return!0},isMediumEditorElement:function(e){return e&&e.getAttribute&&!!e.getAttribute("data-medium-editor-element")},getContainerEditorElement:function(e){return s.traverseUp(e,function(e){return s.isMediumEditorElement(e)})},isBlockContainer:function(e){return e&&3!==e.nodeType&&-1!==s.blockContainerElementNames.indexOf(e.nodeName.toLowerCase())},getClosestBlockContainer:function(e){return s.traverseUp(e,function(e){return s.isBlockContainer(e)||s.isMediumEditorElement(e)})},getTopBlockContainer:function(e){var t=s.isBlockContainer(e)?e:!1;return s.traverseUp(e,function(e){return s.isBlockContainer(e)&&(t=e),!t&&s.isMediumEditorElement(e)?(t=e,!0):!1}),t},getFirstSelectableLeafNode:function(e){for(;e&&e.firstChild;)e=e.firstChild;if(e=s.traverseUp(e,function(e){return-1===s.emptyElementNames.indexOf(e.nodeName.toLowerCase())}),"table"===e.nodeName.toLowerCase()){var t=e.querySelector("th, td");t&&(e=t)}return e},getFirstTextNode:function(e){return s.warn("getFirstTextNode is deprecated and will be removed in version 6.0.0"),s._getFirstTextNode(e)},_getFirstTextNode:function(e){if(3===e.nodeType)return e;for(var t=0;t0){var i,o=r.getRangeAt(0),a=o.cloneRange();a.selectNodeContents(e),a.setEnd(o.startContainer,o.startOffset),i=a.toString().length,n={start:i,end:i+o.toString().length},this.doesRangeStartWithImages(o,t)&&(n.startsWithImage=!0);var s=this.getTrailingImageCount(e,n,o.endContainer,o.endOffset);if(s&&(n.trailingImageCount=s),0!==i){var u=this.getIndexRelativeToAdjacentEmptyBlocks(t,e,o.startContainer,o.startOffset);-1!==u&&(n.emptyBlocksIndex=u)}}return n},importSelection:function(e,t,n,r){if(e&&t){var i=n.createRange();i.setStart(t,0),i.collapse(!0);var o,a=t,s=[],u=0,l=!1,c=!1,f=0,d=!1,p=!1,h=null;for((r||e.startsWithImage||"undefined"!=typeof e.emptyBlocksIndex)&&(p=!0);!d&&a;)if(a.nodeType>3)a=s.pop();else{if(3!==a.nodeType||c){if(e.trailingImageCount&&c&&("img"===a.nodeName.toLowerCase()&&f++,f===e.trailingImageCount)){for(var m=0;a.parentNode.childNodes[m]!==a;)m++;i.setEnd(a.parentNode,m+1),d=!0}if(!d&&1===a.nodeType)for(var v=a.childNodes.length-1;v>=0;)s.push(a.childNodes[v]),v-=1}else o=u+a.length,!l&&e.start>=u&&e.start<=o&&(p||e.start=u&&e.end<=o&&(e.trailingImageCount?c=!0:(i.setEnd(a,e.end-u),d=!0)),u=o;d||(a=s.pop())}!l&&h&&(i.setStart(h,h.length),i.setEnd(h,h.length)),"undefined"!=typeof e.emptyBlocksIndex&&(i=this.importSelectionMoveCursorPastBlocks(n,t,e.emptyBlocksIndex,i)),r&&(i=this.importSelectionMoveCursorPastAnchor(e,i));var g=n.getSelection();g.removeAllRanges(),g.addRange(i)}},importSelectionMoveCursorPastAnchor:function(t,n){var r=function(e){return"a"===e.nodeName.toLowerCase()};if(t.start===t.end&&3===n.startContainer.nodeType&&n.startOffset===n.startContainer.nodeValue.length&&e.util.traverseUp(n.startContainer,r)){for(var i=n.startContainer,o=n.startContainer.parentNode;null!==o&&"a"!==o.nodeName.toLowerCase();)o.childNodes[o.childNodes.length-1]!==i?o=null:(i=o,o=o.parentNode);if(null!==o&&"a"===o.nodeName.toLowerCase()){for(var a=null,s=0;null===a&&s0)break}else a===u.currentNode&&(s=u.currentNode);return s||(s=a),o.setStart(e.util.getFirstSelectableLeafNode(s),0),o},getIndexRelativeToAdjacentEmptyBlocks:function(n,r,i,o){if(i.textContent.length>0&&o>0)return-1;var a=i;if(3!==a.nodeType&&(a=i.childNodes[o]),a){if(!e.util.isElementAtBeginningOfBlock(a))return-1;var s=e.util.findPreviousSibling(a);if(!s)return-1;if(s.nodeValue)return-1}for(var u=e.util.getClosestBlockContainer(i),l=n.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,t,!1),c=0;l.nextNode();){var f=""===l.currentNode.textContent;if((f||c>0)&&(c+=1),l.currentNode===u)return c;f||(c=0)}return c},doesRangeStartWithImages:function(e,t){if(0!==e.startOffset||1!==e.startContainer.nodeType)return!1;if("img"===e.startContainer.nodeName.toLowerCase())return!0;var n=e.startContainer.querySelector("img");if(!n)return!1;for(var r=t.createTreeWalker(e.startContainer,NodeFilter.SHOW_ALL,null,!1);r.nextNode();){var i=r.currentNode;if(i===n)break;if(i.nodeValue)return!1}return!0},getTrailingImageCount:function(e,t,n,r){if(0===r||1!==n.nodeType)return 0;if("img"!==n.nodeName.toLowerCase()&&!n.querySelector("img"))return 0;for(var i=n.childNodes[r-1];i.hasChildNodes();)i=i.lastChild;for(var o,a=e,s=[],u=0,l=!1,c=!1,f=!1,d=0;!f&&a;)if(a.nodeType>3)a=s.pop();else{if(3!==a.nodeType||c){if("img"===a.nodeName.toLowerCase()&&d++,a===i)f=!0;else if(1===a.nodeType)for(var p=a.childNodes.length-1;p>=0;)s.push(a.childNodes[p]),p-=1}else d=0,o=u+a.length,!l&&t.start>=u&&t.start<=o&&(l=!0),l&&t.end>=u&&t.end<=o&&(c=!0),u=o;f||(a=s.pop())}return d},selectionContainsContent:function(e){var t=e.getSelection();if(!t||t.isCollapsed||!t.rangeCount)return!1;if(""!==t.toString().trim())return!0;var n=this.getSelectedParentElement(t.getRangeAt(0));return n&&("img"===n.nodeName.toLowerCase()||1===n.nodeType&&n.querySelector("img"))?!0:!1},selectionInContentEditableFalse:function(e){var t,n=this.findMatchingSelectionParent(function(e){var n=e&&e.getAttribute("contenteditable");return"true"===n&&(t=!0),"#text"!==e.nodeName&&"false"===n},e);return!t&&n},getSelectionHtml:function(e){var t,n,r,i="",o=e.getSelection();if(o.rangeCount){for(r=e.createElement("div"),t=0,n=o.rangeCount;n>t;t+=1)r.appendChild(o.getRangeAt(t).cloneContents());i=r.innerHTML}return i},getCaretOffsets:function(e,t){var n,r;return t||(t=window.getSelection().getRangeAt(0)),n=t.cloneRange(),r=t.cloneRange(),n.selectNodeContents(e),n.setEnd(t.endContainer,t.endOffset),r.selectNodeContents(e),r.setStart(t.endContainer,t.endOffset),{left:n.toString().length,right:r.toString().length}},rangeSelectsSingleNode:function(e){var t=e.startContainer;return t===e.endContainer&&t.hasChildNodes()&&e.endOffset===e.startOffset+1},getSelectedParentElement:function(e){return e?this.rangeSelectsSingleNode(e)&&3!==e.startContainer.childNodes[e.startOffset].nodeType?e.startContainer.childNodes[e.startOffset]:3===e.startContainer.nodeType?e.startContainer.parentNode:e.startContainer:null},getSelectedElements:function(e){var t,n,r,i=e.getSelection();if(!i.rangeCount||i.isCollapsed||!i.getRangeAt(0).commonAncestorContainer)return[];if(t=i.getRangeAt(0),3===t.commonAncestorContainer.nodeType){for(n=[],r=t.commonAncestorContainer;r.parentNode&&1===r.parentNode.childNodes.length;)n.push(r.parentNode),r=r.parentNode;return n}return[].filter.call(t.commonAncestorContainer.getElementsByTagName("*"),function(e){return"function"==typeof i.containsNode?i.containsNode(e,!0):!0})},selectNode:function(e,t){var n=t.createRange(),r=t.getSelection();n.selectNodeContents(e),r.removeAllRanges(),r.addRange(n)},select:function(e,t,n,r,i){e.getSelection().removeAllRanges();var o=e.createRange();return o.setStart(t,n),r?o.setEnd(r,i):o.collapse(!0),e.getSelection().addRange(o),o},moveCursor:function(e,t,n){this.select(e,t,n)},getSelectionRange:function(e){var t=e.getSelection();return 0===t.rangeCount?null:t.getRangeAt(0)},getSelectionStart:function(e){var t=e.getSelection().anchorNode,n=t&&3===t.nodeType?t.parentNode:t;return n}};e.selection=n}(),function(){var t=function(e){this.base=e,this.options=this.base.options,this.events=[],this.disabledEvents={},this.customEvents={},this.listeners={}};t.prototype={InputEventOnContenteditableSupported:!e.util.isIE&&!e.util.isEdge,attachDOMEvent:function(e,t,n,r){e.addEventListener(t,n,r),this.events.push([e,t,n,r])},detachDOMEvent:function(e,t,n,r){var i,o=this.indexOfListener(e,t,n,r);-1!==o&&(i=this.events.splice(o,1)[0],i[0].removeEventListener(i[1],i[2],i[3]))},indexOfListener:function(e,t,n,r){var i,o,a;for(i=0,o=this.events.length;o>i;i+=1)if(a=this.events[i],a[0]===e&&a[1]===t&&a[2]===n&&a[3]===r)return i;return-1},detachAllDOMEvents:function(){for(var e=this.events.pop();e;)e[0].removeEventListener(e[1],e[2],e[3]),e=this.events.pop()},enableCustomEvent:function(e){void 0!==this.disabledEvents[e]&&delete this.disabledEvents[e]},disableCustomEvent:function(e){this.disabledEvents[e]=!0},attachCustomEvent:function(e,t){this.setupListener(e),this.customEvents[e]||(this.customEvents[e]=[]),this.customEvents[e].push(t)},detachCustomEvent:function(e,t){var n=this.indexOfCustomListener(e,t);-1!==n&&this.customEvents[e].splice(n,1)},indexOfCustomListener:function(e,t){return this.customEvents[e]&&this.customEvents[e].length?this.customEvents[e].indexOf(t):-1},detachAllCustomEvents:function(){this.customEvents={}},triggerCustomEvent:function(e,t,n){this.customEvents[e]&&!this.disabledEvents[e]&&this.customEvents[e].forEach(function(e){e(t,n)})},destroy:function(){this.detachAllDOMEvents(),this.detachAllCustomEvents(),this.detachExecCommand(),this.base.elements&&this.base.elements.forEach(function(e){e.removeAttribute("data-medium-focused")})},attachToExecCommand:function(){this.execCommandListener||(this.execCommandListener=function(e){this.handleDocumentExecCommand(e)}.bind(this),this.wrapExecCommand(),this.options.ownerDocument.execCommand.listeners.push(this.execCommandListener))},detachExecCommand:function(){var e=this.options.ownerDocument;if(this.execCommandListener&&e.execCommand.listeners){var t=e.execCommand.listeners.indexOf(this.execCommandListener);-1!==t&&e.execCommand.listeners.splice(t,1),e.execCommand.listeners.length||this.unwrapExecCommand()}},wrapExecCommand:function(){var e=this.options.ownerDocument;if(!e.execCommand.listeners){var t=function(t,n,r){var i=e.execCommand.orig.apply(this,arguments);if(!e.execCommand.listeners)return i;var o=Array.prototype.slice.call(arguments);return e.execCommand.listeners.forEach(function(e){e({command:t,value:r,args:o,result:i})}),i};t.orig=e.execCommand,t.listeners=[],e.execCommand=t}},unwrapExecCommand:function(){var e=this.options.ownerDocument;e.execCommand.orig&&(e.execCommand=e.execCommand.orig)},setupListener:function(e){if(!this.listeners[e]){switch(e){case"externalInteraction":this.attachDOMEvent(this.options.ownerDocument.body,"mousedown",this.handleBodyMousedown.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"click",this.handleBodyClick.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"focus",this.handleBodyFocus.bind(this),!0);break;case"blur":this.setupListener("externalInteraction");break;case"focus":this.setupListener("externalInteraction");break;case"editableInput":this.contentCache=[],this.base.elements.forEach(function(e){this.contentCache[e.getAttribute("medium-editor-index")]=e.innerHTML,this.InputEventOnContenteditableSupported&&this.attachDOMEvent(e,"input",this.handleInput.bind(this))}.bind(this)),this.InputEventOnContenteditableSupported||(this.setupListener("editableKeypress"),this.keypressUpdateInput=!0,this.attachDOMEvent(document,"selectionchange",this.handleDocumentSelectionChange.bind(this)),this.attachToExecCommand());break;case"editableClick":this.attachToEachElement("click",this.handleClick);break;case"editableBlur":this.attachToEachElement("blur",this.handleBlur);break;case"editableKeypress":this.attachToEachElement("keypress",this.handleKeypress);break;case"editableKeyup":this.attachToEachElement("keyup",this.handleKeyup);break;case"editableKeydown":this.attachToEachElement("keydown",this.handleKeydown);break;case"editableKeydownSpace":this.setupListener("editableKeydown");break;case"editableKeydownEnter":this.setupListener("editableKeydown");break;case"editableKeydownTab":this.setupListener("editableKeydown");break;case"editableKeydownDelete":this.setupListener("editableKeydown");break;case"editableMouseover":this.attachToEachElement("mouseover",this.handleMouseover);break;case"editableDrag":this.attachToEachElement("dragover",this.handleDragging),this.attachToEachElement("dragleave",this.handleDragging);break;case"editableDrop":this.attachToEachElement("drop",this.handleDrop);break;case"editablePaste":this.attachToEachElement("paste",this.handlePaste)}this.listeners[e]=!0}},attachToEachElement:function(e,t){this.base.elements.forEach(function(n){this.attachDOMEvent(n,e,t.bind(this))},this)},focusElement:function(e){e.focus(),this.updateFocus(e,{target:e,type:"focus"})},updateFocus:function(t,n){var r,i=this.base.getExtensionByName("toolbar"),o=i?i.getToolbarElement():null,a=this.base.getExtensionByName("anchor-preview"),s=a&&a.getPreviewElement?a.getPreviewElement():null,u=this.base.getFocusedElement();u&&"click"===n.type&&this.lastMousedownTarget&&(e.util.isDescendant(u,this.lastMousedownTarget,!0)||e.util.isDescendant(o,this.lastMousedownTarget,!0)||e.util.isDescendant(s,this.lastMousedownTarget,!0))&&(r=u),r||this.base.elements.some(function(n){return!r&&e.util.isDescendant(n,t,!0)&&(r=n),!!r},this);var l=!e.util.isDescendant(u,t,!0)&&!e.util.isDescendant(o,t,!0)&&!e.util.isDescendant(s,t,!0);r!==u&&(u&&l&&(u.removeAttribute("data-medium-focused"),this.triggerCustomEvent("blur",n,u)),r&&(r.setAttribute("data-medium-focused",!0),this.triggerCustomEvent("focus",n,r))),l&&this.triggerCustomEvent("externalInteraction",n)},updateInput:function(e,t){if(this.contentCache){var n=e.getAttribute("medium-editor-index");e.innerHTML!==this.contentCache[n]&&this.triggerCustomEvent("editableInput",t,e),this.contentCache[n]=e.innerHTML}},handleDocumentSelectionChange:function(t){if(t.currentTarget&&t.currentTarget.activeElement){var n,r=t.currentTarget.activeElement;this.base.elements.some(function(t){return e.util.isDescendant(t,r,!0)?(n=t,!0):!1},this),n&&this.updateInput(n,{target:r,currentTarget:n})}},handleDocumentExecCommand:function(){var e=this.base.getFocusedElement();e&&this.updateInput(e,{target:e,currentTarget:e})},handleBodyClick:function(e){this.updateFocus(e.target,e)},handleBodyFocus:function(e){this.updateFocus(e.target,e)},handleBodyMousedown:function(e){this.lastMousedownTarget=e.target},handleInput:function(e){this.updateInput(e.currentTarget,e)},handleClick:function(e){this.triggerCustomEvent("editableClick",e,e.currentTarget)},handleBlur:function(e){this.triggerCustomEvent("editableBlur",e,e.currentTarget)},handleKeypress:function(e){if(this.triggerCustomEvent("editableKeypress",e,e.currentTarget),this.keypressUpdateInput){var t={target:e.target,currentTarget:e.currentTarget};setTimeout(function(){this.updateInput(t.currentTarget,t)}.bind(this),0)}},handleKeyup:function(e){this.triggerCustomEvent("editableKeyup",e,e.currentTarget)},handleMouseover:function(e){this.triggerCustomEvent("editableMouseover",e,e.currentTarget)},handleDragging:function(e){this.triggerCustomEvent("editableDrag",e,e.currentTarget)},handleDrop:function(e){this.triggerCustomEvent("editableDrop",e,e.currentTarget)},handlePaste:function(e){this.triggerCustomEvent("editablePaste",e,e.currentTarget)},handleKeydown:function(t){return this.triggerCustomEvent("editableKeydown",t,t.currentTarget),e.util.isKey(t,e.util.keyCode.SPACE)?this.triggerCustomEvent("editableKeydownSpace",t,t.currentTarget):e.util.isKey(t,e.util.keyCode.ENTER)||t.ctrlKey&&e.util.isKey(t,e.util.keyCode.M)?this.triggerCustomEvent("editableKeydownEnter",t,t.currentTarget):e.util.isKey(t,e.util.keyCode.TAB)?this.triggerCustomEvent("editableKeydownTab",t,t.currentTarget):e.util.isKey(t,[e.util.keyCode.DELETE,e.util.keyCode.BACKSPACE])?this.triggerCustomEvent("editableKeydownDelete",t,t.currentTarget):void 0}},e.Events=t}(),function(){var t=e.Extension.extend({action:void 0,aria:void 0,tagNames:void 0,style:void 0,useQueryState:void 0,contentDefault:void 0,contentFA:void 0,classList:void 0,attrs:void 0,constructor:function(n){t.isBuiltInButton(n)?e.Extension.call(this,this.defaults[n]):e.Extension.call(this,n)},init:function(){e.Extension.prototype.init.apply(this,arguments),this.button=this.createButton(),this.on(this.button,"click",this.handleClick.bind(this))},getButton:function(){return this.button},getAction:function(){return"function"==typeof this.action?this.action(this.base.options):this.action},getAria:function(){return"function"==typeof this.aria?this.aria(this.base.options):this.aria},getTagNames:function(){return"function"==typeof this.tagNames?this.tagNames(this.base.options):this.tagNames},createButton:function(){var e=this.document.createElement("button"),t=this.contentDefault,n=this.getAria(),r=this.getEditorOption("buttonLabels");return e.classList.add("medium-editor-action"),e.classList.add("medium-editor-action-"+this.name),this.classList&&this.classList.forEach(function(t){e.classList.add(t)}),e.setAttribute("data-action",this.getAction()),n&&(e.setAttribute("title",n),e.setAttribute("aria-label",n)),this.attrs&&Object.keys(this.attrs).forEach(function(t){e.setAttribute(t,this.attrs[t])},this),"fontawesome"===r&&this.contentFA&&(t=this.contentFA),e.innerHTML=t,e},handleClick:function(e){e.preventDefault(),e.stopPropagation();var t=this.getAction();t&&this.execAction(t)},isActive:function(){return this.button.classList.contains(this.getEditorOption("activeButtonClass"))},setInactive:function(){this.button.classList.remove(this.getEditorOption("activeButtonClass")),delete this.knownState},setActive:function(){this.button.classList.add(this.getEditorOption("activeButtonClass")),delete this.knownState},queryCommandState:function(){var e=null;return this.useQueryState&&(e=this.base.queryCommandState(this.getAction())),e},isAlreadyApplied:function(e){var t,n,r=!1,i=this.getTagNames();return this.knownState===!1||this.knownState===!0?this.knownState:(i&&i.length>0&&(r=-1!==i.indexOf(e.nodeName.toLowerCase())),!r&&this.style&&(t=this.style.value.split("|"),n=this.window.getComputedStyle(e,null).getPropertyValue(this.style.prop),t.forEach(function(e){this.knownState||(r=-1!==n.indexOf(e),(r||"text-decoration"!==this.style.prop)&&(this.knownState=r)); -},this)),r)}});t.isBuiltInButton=function(t){return"string"==typeof t&&e.extensions.button.prototype.defaults.hasOwnProperty(t)},e.extensions.button=t}(),function(){e.extensions.button.prototype.defaults={bold:{name:"bold",action:"bold",aria:"bold",tagNames:["b","strong"],style:{prop:"font-weight",value:"700|bold"},useQueryState:!0,contentDefault:"B",contentFA:''},italic:{name:"italic",action:"italic",aria:"italic",tagNames:["i","em"],style:{prop:"font-style",value:"italic"},useQueryState:!0,contentDefault:"I",contentFA:''},underline:{name:"underline",action:"underline",aria:"underline",tagNames:["u"],style:{prop:"text-decoration",value:"underline"},useQueryState:!0,contentDefault:"U",contentFA:''},strikethrough:{name:"strikethrough",action:"strikethrough",aria:"strike through",tagNames:["strike"],style:{prop:"text-decoration",value:"line-through"},useQueryState:!0,contentDefault:"A",contentFA:''},superscript:{name:"superscript",action:"superscript",aria:"superscript",tagNames:["sup"],contentDefault:"x1",contentFA:''},subscript:{name:"subscript",action:"subscript",aria:"subscript",tagNames:["sub"],contentDefault:"x1",contentFA:''},image:{name:"image",action:"image",aria:"image",tagNames:["img"],contentDefault:"image",contentFA:''},orderedlist:{name:"orderedlist",action:"insertorderedlist",aria:"ordered list",tagNames:["ol"],useQueryState:!0,contentDefault:"1.",contentFA:''},unorderedlist:{name:"unorderedlist",action:"insertunorderedlist",aria:"unordered list",tagNames:["ul"],useQueryState:!0,contentDefault:"",contentFA:''},indent:{name:"indent",action:"indent",aria:"indent",tagNames:[],contentDefault:"",contentFA:''},outdent:{name:"outdent",action:"outdent",aria:"outdent",tagNames:[],contentDefault:"",contentFA:''},justifyCenter:{name:"justifyCenter",action:"justifyCenter",aria:"center justify",tagNames:[],style:{prop:"text-align",value:"center"},contentDefault:"C",contentFA:''},justifyFull:{name:"justifyFull",action:"justifyFull",aria:"full justify",tagNames:[],style:{prop:"text-align",value:"justify"},contentDefault:"J",contentFA:''},justifyLeft:{name:"justifyLeft",action:"justifyLeft",aria:"left justify",tagNames:[],style:{prop:"text-align",value:"left"},contentDefault:"L",contentFA:''},justifyRight:{name:"justifyRight",action:"justifyRight",aria:"right justify",tagNames:[],style:{prop:"text-align",value:"right"},contentDefault:"R",contentFA:''},removeFormat:{name:"removeFormat",aria:"remove formatting",action:"removeFormat",contentDefault:"X",contentFA:''},quote:{name:"quote",action:"append-blockquote",aria:"blockquote",tagNames:["blockquote"],contentDefault:"",contentFA:''},pre:{name:"pre",action:"append-pre",aria:"preformatted text",tagNames:["pre"],contentDefault:"0101",contentFA:''},h1:{name:"h1",action:"append-h1",aria:"header type one",tagNames:["h1"],contentDefault:"H1",contentFA:'1'},h2:{name:"h2",action:"append-h2",aria:"header type two",tagNames:["h2"],contentDefault:"H2",contentFA:'2'},h3:{name:"h3",action:"append-h3",aria:"header type three",tagNames:["h3"],contentDefault:"H3",contentFA:'3'},h4:{name:"h4",action:"append-h4",aria:"header type four",tagNames:["h4"],contentDefault:"H4",contentFA:'4'},h5:{name:"h5",action:"append-h5",aria:"header type five",tagNames:["h5"],contentDefault:"H5",contentFA:'5'},h6:{name:"h6",action:"append-h6",aria:"header type six",tagNames:["h6"],contentDefault:"H6",contentFA:'6'}}}(),function(){var t=e.extensions.button.extend({init:function(){e.extensions.button.prototype.init.apply(this,arguments)},formSaveLabel:"✓",formCloseLabel:"×",hasForm:!0,getForm:function(){},isDisplayed:function(){},hideForm:function(){},showToolbarDefaultActions:function(){var e=this.base.getExtensionByName("toolbar");e&&e.showToolbarDefaultActions()},hideToolbarDefaultActions:function(){var e=this.base.getExtensionByName("toolbar");e&&e.hideToolbarDefaultActions()},setToolbarPosition:function(){var e=this.base.getExtensionByName("toolbar");e&&e.setToolbarPosition()}});e.extensions.form=t}(),function(){var t=e.extensions.form.extend({customClassOption:null,customClassOptionText:"Button",linkValidation:!1,placeholderText:"Paste or type a link",targetCheckbox:!1,targetCheckboxText:"Open in new window",name:"anchor",action:"createLink",aria:"link",tagNames:["a"],contentDefault:"#",contentFA:'',init:function(){e.extensions.form.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this))},handleClick:function(t){t.preventDefault(),t.stopPropagation();var n=e.selection.getSelectionRange(this.document);return"a"===n.startContainer.nodeName.toLowerCase()||"a"===n.endContainer.nodeName.toLowerCase()||e.util.getClosestTag(e.selection.getSelectedParentElement(n),"a")?this.execAction("unlink"):(this.isDisplayed()||this.showForm(),!1)},handleKeydown:function(t){e.util.isKey(t,e.util.keyCode.K)&&e.util.isMetaCtrlKey(t)&&!t.shiftKey&&this.handleClick(t)},getForm:function(){return this.form||(this.form=this.createForm()),this.form},getTemplate:function(){var e=[''];return e.push('',"fontawesome"===this.getEditorOption("buttonLabels")?'':this.formSaveLabel,""),e.push('',"fontawesome"===this.getEditorOption("buttonLabels")?'':this.formCloseLabel,""),this.targetCheckbox&&e.push('

    ','',"","
    "),this.customClassOption&&e.push('
    ','',"","
    "),e.join("")},isDisplayed:function(){return"block"===this.getForm().style.display},hideForm:function(){this.getForm().style.display="none",this.getInput().value=""},showForm:function(e){var t=this.getInput(),n=this.getAnchorTargetCheckbox(),r=this.getAnchorButtonCheckbox();if(e=e||{url:""},"string"==typeof e&&(e={url:e}),this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),t.value=e.url,t.focus(),n&&(n.checked="_blank"===e.target),r){var i=e.buttonClass?e.buttonClass.split(" "):[];r.checked=-1!==i.indexOf(this.customClassOption)}},destroy:function(){return this.form?(this.form.parentNode&&this.form.parentNode.removeChild(this.form),void delete this.form):!1},getFormOpts:function(){var e=this.getAnchorTargetCheckbox(),t=this.getAnchorButtonCheckbox(),n={url:this.getInput().value.trim()};return this.linkValidation&&(n.url=this.checkLinkFormat(n.url)),n.target="_self",e&&e.checked&&(n.target="_blank"),t&&t.checked&&(n.buttonClass=this.customClassOption),n},doFormSave:function(){var e=this.getFormOpts();this.completeFormSave(e)},completeFormSave:function(e){this.base.restoreSelection(),this.execAction(this.action,e),this.base.checkSelection()},checkLinkFormat:function(e){var t=/^([a-z]+:)?\/\/|^(mailto|tel|maps):/i,n=/^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/;return n.test(e)?"tel:"+e:(t.test(e)?"":"http://")+e},doFormCancel:function(){this.base.restoreSelection(),this.base.checkSelection()},attachFormEvents:function(e){var t=e.querySelector(".medium-editor-toolbar-close"),n=e.querySelector(".medium-editor-toolbar-save"),r=e.querySelector(".medium-editor-toolbar-input");this.on(e,"click",this.handleFormClick.bind(this)),this.on(r,"keyup",this.handleTextboxKeyup.bind(this)),this.on(t,"click",this.handleCloseClick.bind(this)),this.on(n,"click",this.handleSaveClick.bind(this),!0)},createForm:function(){var e=this.document,t=e.createElement("div");return t.className="medium-editor-toolbar-form",t.id="medium-editor-toolbar-form-anchor-"+this.getEditorId(),t.innerHTML=this.getTemplate(),this.attachFormEvents(t),t},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},getAnchorTargetCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-target")},getAnchorButtonCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-button")},handleTextboxKeyup:function(t){return t.keyCode===e.util.keyCode.ENTER?(t.preventDefault(),void this.doFormSave()):void(t.keyCode===e.util.keyCode.ESCAPE&&(t.preventDefault(),this.doFormCancel()))},handleFormClick:function(e){e.stopPropagation()},handleSaveClick:function(e){e.preventDefault(),this.doFormSave()},handleCloseClick:function(e){e.preventDefault(),this.doFormCancel()}});e.extensions.anchor=t}(),function(){var t=e.Extension.extend({name:"anchor-preview",hideDelay:500,previewValueSelector:"a",showWhenToolbarIsVisible:!1,init:function(){this.anchorPreview=this.createPreview(),this.getEditorOption("elementsContainer").appendChild(this.anchorPreview),this.attachToEditables()},getPreviewElement:function(){return this.anchorPreview},createPreview:function(){var e=this.document.createElement("div");return e.id="medium-editor-anchor-preview-"+this.getEditorId(),e.className="medium-editor-anchor-preview",e.innerHTML=this.getTemplate(),this.on(e,"click",this.handleClick.bind(this)),e},getTemplate:function(){return'
    '},destroy:function(){this.anchorPreview&&(this.anchorPreview.parentNode&&this.anchorPreview.parentNode.removeChild(this.anchorPreview),delete this.anchorPreview)},hidePreview:function(){this.anchorPreview.classList.remove("medium-editor-anchor-preview-active"),this.activeAnchor=null},showPreview:function(e){return this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||e.getAttribute("data-disable-preview")?!0:(this.previewValueSelector&&(this.anchorPreview.querySelector(this.previewValueSelector).textContent=e.attributes.href.value,this.anchorPreview.querySelector(this.previewValueSelector).href=e.attributes.href.value),this.anchorPreview.classList.add("medium-toolbar-arrow-over"),this.anchorPreview.classList.remove("medium-toolbar-arrow-under"),this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||this.anchorPreview.classList.add("medium-editor-anchor-preview-active"),this.activeAnchor=e,this.positionPreview(),this.attachPreviewHandlers(),this)},positionPreview:function(e){e=e||this.activeAnchor;var t,n,r=this.anchorPreview.offsetHeight,i=e.getBoundingClientRect(),o=(i.left+i.right)/2,a=this.diffLeft,s=this.diffTop;t=this.anchorPreview.offsetWidth/2;var u=this.base.getExtensionByName("toolbar");u&&(a=u.diffLeft,s=u.diffTop),n=a-t,this.anchorPreview.style.top=Math.round(r+i.bottom-s+this.window.pageYOffset-this.anchorPreview.offsetHeight)+"px",this.anchorPreview.style.right="initial",t>o?(this.anchorPreview.style.left=n+t+"px",this.anchorPreview.style.right="initial"):this.window.innerWidth-othis.hideDelay&&this.detachPreviewHandlers()},detachPreviewHandlers:function(){clearInterval(this.intervalTimer),this.instanceHandlePreviewMouseover&&(this.off(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.activeAnchor&&(this.off(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout))),this.hidePreview(),this.hovering=this.instanceHandlePreviewMouseover=this.instanceHandlePreviewMouseout=null},attachPreviewHandlers:function(){this.lastOver=(new Date).getTime(),this.hovering=!0,this.instanceHandlePreviewMouseover=this.handlePreviewMouseover.bind(this),this.instanceHandlePreviewMouseout=this.handlePreviewMouseout.bind(this),this.intervalTimer=setInterval(this.updatePreview.bind(this),200),this.on(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.on(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout)}});e.extensions.anchorPreview=t}(),function(){function t(t){return!e.util.getClosestTag(t,"a")}var n,r,i,o;n=[" "," ","\n","\r"," "," "," "," "," ","\u2028","\u2029"],r="com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw",i="(((?:(https?://|ftps?://|nntp://)|www\\d{0,3}[.]|[a-z0-9.\\-]+[.]("+r+")\\/)\\S+(?:[^\\s`!\\[\\]{};:'\".,?«»“”‘’])))|(([a-z0-9\\-]+\\.)?[a-z0-9\\-]+\\.("+r+"))",o=new RegExp("^("+r+")$","i");var a=e.Extension.extend({init:function(){e.Extension.prototype.init.apply(this,arguments),this.disableEventHandling=!1,this.subscribe("editableKeypress",this.onKeypress.bind(this)),this.subscribe("editableBlur",this.onBlur.bind(this)),this.document.execCommand("AutoUrlDetect",!1,!1)},destroy:function(){this.document.queryCommandSupported("AutoUrlDetect")&&this.document.execCommand("AutoUrlDetect",!1,!0)},onBlur:function(e,t){this.performLinking(t)},onKeypress:function(t){this.disableEventHandling||e.util.isKey(t,[e.util.keyCode.SPACE,e.util.keyCode.ENTER])&&(clearTimeout(this.performLinkingTimeout),this.performLinkingTimeout=setTimeout(function(){try{var e=this.base.exportSelection();this.performLinking(t.target)&&this.base.importSelection(e,!0)}catch(n){window.console&&window.console.error("Failed to perform linking",n),this.disableEventHandling=!0}}.bind(this),0))},performLinking:function(t){var n=e.util.splitByBlockElements(t),r=!1;0===n.length&&(n=[t]);for(var i=0;i0&&null!==a;)i=n.currentNode,o=i.nodeValue,o.length>t?(a=i.splitText(o.length-t),t=0):(a=n.previousNode(),t-=o.length);return a},performLinkingWithinElement:function(t){for(var n=this.findLinkableText(t),r=!1,i=0;i1;)i.appendChild(r.childNodes[1])}});e.extensions.autoLink=a}(),function(){function t(t){var r=e.util.getContainerEditorElement(t),i=Array.prototype.slice.call(r.parentElement.querySelectorAll("."+n));i.forEach(function(e){e.classList.remove(n)})}var n="medium-editor-dragover",r=e.Extension.extend({name:"fileDragging",allowedTypes:["image"],init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(e){e.preventDefault(),e.dataTransfer.dropEffect="copy";var r=e.target.classList?e.target:e.target.parentElement;t(r),"dragover"===e.type&&r.classList.add(n)},handleDrop:function(e){e.preventDefault(),e.stopPropagation(),e.dataTransfer.files&&Array.prototype.slice.call(e.dataTransfer.files).forEach(function(e){this.isAllowedFile(e)&&e.type.match("image")&&this.insertImageFile(e)},this),t(e.target)},isAllowedFile:function(e){return this.allowedTypes.some(function(t){return!!e.type.match(t)})},insertImageFile:function(t){var n=new FileReader;n.readAsDataURL(t);var r="medium-img-"+ +new Date;e.util.insertHTMLCommand(this.document,''),n.onload=function(){var e=this.document.getElementById(r);e&&(e.removeAttribute("id"),e.removeAttribute("class"),e.src=n.result)}.bind(this)}});e.extensions.fileDragging=r}(),function(){var t=e.Extension.extend({name:"keyboard-commands",commands:[{command:"bold",key:"B",meta:!0,shift:!1,alt:!1},{command:"italic",key:"I",meta:!0,shift:!1,alt:!1},{command:"underline",key:"U",meta:!0,shift:!1,alt:!1}],init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.keys={},this.commands.forEach(function(e){var t=e.key.charCodeAt(0);this.keys[t]||(this.keys[t]=[]),this.keys[t].push(e)},this)},handleKeydown:function(t){var n=e.util.getKeyCode(t);if(this.keys[n]){var r=e.util.isMetaCtrlKey(t),i=!!t.shiftKey,o=!!t.altKey;this.keys[n].forEach(function(e){e.meta!==r||e.shift!==i||e.alt!==o&&void 0!==e.alt||(t.preventDefault(),t.stopPropagation(),!1!==e.command&&this.execAction(e.command))},this)}}});e.extensions.keyboardCommands=t}(),function(){var t=e.extensions.form.extend({name:"fontname",action:"fontName",aria:"change font name",contentDefault:"±",contentFA:'',fonts:["","Arial","Verdana","Times New Roman"],init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(e){if(e.preventDefault(),e.stopPropagation(),!this.isDisplayed()){var t=this.document.queryCommandValue("fontName")+"";this.showForm(t)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return"block"===this.getForm().style.display},hideForm:function(){this.getForm().style.display="none",this.getSelect().value=""},showForm:function(e){var t=this.getSelect();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),t.value=e||"",t.focus()},destroy:function(){return this.form?(this.form.parentNode&&this.form.parentNode.removeChild(this.form),void delete this.form):!1},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontName(),this.base.checkSelection()},createForm:function(){var e,t=this.document,n=t.createElement("div"),r=t.createElement("select"),i=t.createElement("a"),o=t.createElement("a");n.className="medium-editor-toolbar-form",n.id="medium-editor-toolbar-form-fontname-"+this.getEditorId(),this.on(n,"click",this.handleFormClick.bind(this));for(var a=0;a
    ':"✓",n.appendChild(o),this.on(o,"click",this.handleSaveClick.bind(this),!0),i.setAttribute("href","#"),i.className="medium-editor-toobar-close",i.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'':"×",n.appendChild(i),this.on(i,"click",this.handleCloseClick.bind(this)),n},getSelect:function(){return this.getForm().querySelector("select.medium-editor-toolbar-select")},clearFontName:function(){e.selection.getSelectedElements(this.document).forEach(function(e){"font"===e.nodeName.toLowerCase()&&e.hasAttribute("face")&&e.removeAttribute("face")})},handleFontChange:function(){var e=this.getSelect().value;""===e?this.clearFontName():this.execAction("fontName",{name:e})},handleFormClick:function(e){e.stopPropagation()},handleSaveClick:function(e){e.preventDefault(),this.doFormSave()},handleCloseClick:function(e){e.preventDefault(),this.doFormCancel()}});e.extensions.fontName=t}(),function(){var t=e.extensions.form.extend({name:"fontsize",action:"fontSize",aria:"increase/decrease font size",contentDefault:"±",contentFA:'',init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(e){if(e.preventDefault(),e.stopPropagation(),!this.isDisplayed()){var t=this.document.queryCommandValue("fontSize")+"";this.showForm(t)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return"block"===this.getForm().style.display},hideForm:function(){this.getForm().style.display="none",this.getInput().value=""},showForm:function(e){var t=this.getInput();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),t.value=e||"",t.focus()},destroy:function(){return this.form?(this.form.parentNode&&this.form.parentNode.removeChild(this.form),void delete this.form):!1},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontSize(),this.base.checkSelection()},createForm:function(){var e=this.document,t=e.createElement("div"),n=e.createElement("input"),r=e.createElement("a"),i=e.createElement("a");return t.className="medium-editor-toolbar-form",t.id="medium-editor-toolbar-form-fontsize-"+this.getEditorId(),this.on(t,"click",this.handleFormClick.bind(this)),n.setAttribute("type","range"),n.setAttribute("min","1"),n.setAttribute("max","7"),n.className="medium-editor-toolbar-input",t.appendChild(n),this.on(n,"change",this.handleSliderChange.bind(this)),i.setAttribute("href","#"),i.className="medium-editor-toobar-save",i.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'':"✓",t.appendChild(i),this.on(i,"click",this.handleSaveClick.bind(this),!0),r.setAttribute("href","#"),r.className="medium-editor-toobar-close",r.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'':"×",t.appendChild(r),this.on(r,"click",this.handleCloseClick.bind(this)),t},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},clearFontSize:function(){e.selection.getSelectedElements(this.document).forEach(function(e){"font"===e.nodeName.toLowerCase()&&e.hasAttribute("size")&&e.removeAttribute("size")})},handleSliderChange:function(){var e=this.getInput().value;"4"===e?this.clearFontSize():this.execAction("fontSize",{size:e})},handleFormClick:function(e){e.stopPropagation()},handleSaveClick:function(e){e.preventDefault(),this.doFormSave()},handleCloseClick:function(e){e.preventDefault(),this.doFormCancel()}});e.extensions.fontSize=t}(),function(){function t(){return[[new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi),""],[new RegExp(/<\/b>(]*>)?$/gi),""],[new RegExp(/\s+<\/span>/g)," "],[new RegExp(/
    /g),"
    "],[new RegExp(/]*(font-style:italic;font-weight:bold|font-weight:bold;font-style:italic)[^>]*>/gi),''],[new RegExp(/]*font-style:italic[^>]*>/gi),''],[new RegExp(/]*font-weight:bold[^>]*>/gi),''],[new RegExp(/<(\/?)(i|b|a)>/gi),"<$1$2>"],[new RegExp(/<a(?:(?!href).)+href=(?:"|”|“|"|“|”)(((?!"|”|“|"|“|”).)*)(?:"|”|“|"|“|”)(?:(?!>).)*>/gi),''],[new RegExp(/<\/p>\n+/gi),"

    "],[new RegExp(/\n+

    /gi),""],["",""],["",""]]}var n=e.Extension.extend({forcePlainText:!0,cleanPastedHTML:!1,preCleanReplacements:[],cleanReplacements:[],cleanAttrs:["class","style","dir"],cleanTags:["meta"],init:function(){e.Extension.prototype.init.apply(this,arguments),(this.forcePlainText||this.cleanPastedHTML)&&this.subscribe("editablePaste",this.handlePaste.bind(this))},handlePaste:function(t,n){var r,i,o,a,s="",u="text/html",l="text/plain";if(this.window.clipboardData&&void 0===t.clipboardData&&(t.clipboardData=this.window.clipboardData,u="Text",l="Text"),t.clipboardData&&t.clipboardData.getData&&!t.defaultPrevented){if(t.preventDefault(),o=t.clipboardData.getData(u),a=t.clipboardData.getData(l),this.cleanPastedHTML&&o)return this.cleanPaste(o);if(this.getEditorOption("disableReturn")||n.getAttribute("data-disable-return"))s=e.util.htmlEntities(a);else if(r=a.split(/[\r\n]+/g),r.length>1)for(i=0;i"+e.util.htmlEntities(r[i])+"

    ");else s=e.util.htmlEntities(r[0]);e.util.insertHTMLCommand(this.document,s)}},cleanPaste:function(e){var n,r,i,o,a=/"+e.split("

    ").join("

    ")+"

    ",r=i.querySelectorAll("a,p,div,br"),n=0;n"+r.innerHTML+"
    ":i.innerHTML=r.innerHTML,r.parentNode.replaceChild(i,r);for(o=t.querySelectorAll("span"),n=0;n0&&(r[0].classList.add(this.firstButtonClass),r[r.length-1].classList.add(this.lastButtonClass)),s},destroy:function(){this.toolbar&&(this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),delete this.toolbar)},getToolbarElement:function(){return this.toolbar||(this.toolbar=this.createToolbar()),this.toolbar},getToolbarActionsElement:function(){return this.getToolbarElement().querySelector(".medium-editor-toolbar-actions")},initThrottledMethods:function(){this.throttledPositionToolbar=e.util.throttle(function(){this.base.isActive&&this.positionToolbarIfShown()}.bind(this))},attachEventHandlers:function(){this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableClick",this.handleEditableClick.bind(this)),this.subscribe("editableKeyup",this.handleEditableKeyup.bind(this)),this.on(this.document.documentElement,"mouseup",this.handleDocumentMouseup.bind(this)),this["static"]&&this.sticky&&this.on(this.window,"scroll",this.handleWindowScroll.bind(this),!0),this.on(this.window,"resize",this.handleWindowResize.bind(this))},handleWindowScroll:function(){this.positionToolbarIfShown()},handleWindowResize:function(){this.throttledPositionToolbar()},handleDocumentMouseup:function(t){return t&&t.target&&e.util.isDescendant(this.getToolbarElement(),t.target)?!1:void this.checkState()},handleEditableClick:function(){setTimeout(function(){this.checkState()}.bind(this),0)},handleEditableKeyup:function(){this.checkState()},handleBlur:function(){clearTimeout(this.hideTimeout),clearTimeout(this.delayShowTimeout),this.hideTimeout=setTimeout(function(){this.hideToolbar()}.bind(this),1)},handleFocus:function(){this.checkState()},isDisplayed:function(){return this.getToolbarElement().classList.contains("medium-editor-toolbar-active")},showToolbar:function(){clearTimeout(this.hideTimeout),this.isDisplayed()||(this.getToolbarElement().classList.add("medium-editor-toolbar-active"),this.trigger("showToolbar",{},this.base.getFocusedElement()))},hideToolbar:function(){this.isDisplayed()&&(this.getToolbarElement().classList.remove("medium-editor-toolbar-active"),this.trigger("hideToolbar",{},this.base.getFocusedElement()))},isToolbarDefaultActionsDisplayed:function(){return"block"===this.getToolbarActionsElement().style.display},hideToolbarDefaultActions:function(){this.isToolbarDefaultActionsDisplayed()&&(this.getToolbarActionsElement().style.display="none")},showToolbarDefaultActions:function(){this.hideExtensionForms(),this.isToolbarDefaultActionsDisplayed()||(this.getToolbarActionsElement().style.display="block"),this.delayShowTimeout=this.base.delay(function(){this.showToolbar()}.bind(this))},hideExtensionForms:function(){this.forEachExtension(function(e){e.hasForm&&e.isDisplayed()&&e.hideForm()})},multipleBlockElementsSelected:function(){var t=/<[^\/>][^>]*><\/[^>]+>/gim,n=new RegExp("<("+e.util.blockContainerElementNames.join("|")+")[^>]*>","g"),r=e.selection.getSelectionHtml(this.document).replace(t,""),i=r.match(n);return!!i&&i.length>1},modifySelection:function(){var t=this.window.getSelection(),n=t.getRangeAt(0);if(this.standardizeSelectionStart&&n.startContainer.nodeValue&&n.startOffset===n.startContainer.nodeValue.length){var r=e.util.findAdjacentTextNodeWithContent(e.selection.getSelectionElement(this.window),n.startContainer,this.document);if(r){for(var i=0;0===r.nodeValue.substr(i,1).trim().length;)i+=1;n=e.selection.select(this.document,r,i,n.endContainer,n.endOffset)}}},checkState:function(){if(!this.base.preventSelectionUpdates){if(!this.base.getFocusedElement()||e.selection.selectionInContentEditableFalse(this.window))return this.hideToolbar();var t=e.selection.getSelectionElement(this.window);return!t||-1===this.getEditorElements().indexOf(t)||t.getAttribute("data-disable-toolbar")?this.hideToolbar():this.updateOnEmptySelection&&this["static"]?this.showAndUpdateToolbar():!e.selection.selectionContainsContent(this.document)||this.allowMultiParagraphSelection===!1&&this.multipleBlockElementsSelected()?this.hideToolbar():void this.showAndUpdateToolbar()}},showAndUpdateToolbar:function(){this.modifySelection(),this.setToolbarButtonStates(),this.trigger("positionToolbar",{},this.base.getFocusedElement()),this.showToolbarDefaultActions(),this.setToolbarPosition()},setToolbarButtonStates:function(){this.forEachExtension(function(e){"function"==typeof e.isActive&&"function"==typeof e.setInactive&&e.setInactive()}),this.checkActiveButtons()},checkActiveButtons:function(){var t,n=[],r=null,i=e.selection.getSelectionRange(this.document),o=function(e){"function"==typeof e.checkState?e.checkState(t):"function"==typeof e.isActive&&"function"==typeof e.isAlreadyApplied&&"function"==typeof e.setActive&&!e.isActive()&&e.isAlreadyApplied(t)&&e.setActive()};if(i&&(this.forEachExtension(function(e){return"function"==typeof e.queryCommandState&&(r=e.queryCommandState(),null!==r)?void(r&&"function"==typeof e.setActive&&e.setActive()):void n.push(e)}),t=e.selection.getSelectedParentElement(i),this.getEditorElements().some(function(n){return e.util.isDescendant(n,t,!0)})))for(;t&&(n.forEach(o),!e.util.isMediumEditorElement(t));)t=t.parentNode},positionToolbarIfShown:function(){this.isDisplayed()&&this.setToolbarPosition()},setToolbarPosition:function(){var e,t=this.base.getFocusedElement(),n=this.window.getSelection();return t?(this["static"]&&!this.relativeContainer?(this.showToolbar(),this.positionStaticToolbar(t)):n.isCollapsed||(this.showToolbar(),this.relativeContainer||this.positionToolbar(n)),e=this.base.getExtensionByName("anchor-preview"),void(e&&"function"==typeof e.hidePreview&&e.hidePreview())):this},positionStaticToolbar:function(e){this.getToolbarElement().style.left="0";var t,n=this.document.documentElement&&this.document.documentElement.scrollTop||this.document.body.scrollTop,r=this.window.innerWidth,i=this.getToolbarElement(),o=e.getBoundingClientRect(),a=o.top+n,s=o.left+o.width/2,u=i.offsetHeight,l=i.offsetWidth,c=l/2;switch(this.sticky?n>a+e.offsetHeight-u-this.stickyTopOffset?(i.style.top=a+e.offsetHeight-u+"px",i.classList.remove("medium-editor-sticky-toolbar")):n>a-u-this.stickyTopOffset?(i.classList.add("medium-editor-sticky-toolbar"),i.style.top=this.stickyTopOffset+"px"):(i.classList.remove("medium-editor-sticky-toolbar"),i.style.top=a-u+"px"):i.style.top=a-u+"px",this.align){case"left":t=o.left;break;case"right":t=o.right-l;break;case"center":t=s-c}0>t?t=0:t+l>r&&(t=r-Math.ceil(l)-1),i.style.left=t+"px"},positionToolbar:function(e){this.getToolbarElement().style.left="0",this.getToolbarElement().style.right="initial";var t=e.getRangeAt(0),n=t.getBoundingClientRect();(!n||0===n.height&&0===n.width&&t.startContainer===t.endContainer)&&(n=1===t.startContainer.nodeType&&t.startContainer.querySelector("img")?t.startContainer.querySelector("img").getBoundingClientRect():t.startContainer.getBoundingClientRect());var r=this.window.innerWidth,i=(n.left+n.right)/2,o=this.getToolbarElement(),a=o.offsetHeight,s=o.offsetWidth,u=s/2,l=50,c=this.diffLeft-u;n.topi?(o.style.left=c+u+"px",o.style.right="initial"):u>r-i?(o.style.left="auto",o.style.right=0):(o.style.left=c+i+"px",o.style.right="initial")}});e.extensions.toolbar=t}(),function(){var t=e.Extension.extend({init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(e){var t="medium-editor-dragover";e.preventDefault(),e.dataTransfer.dropEffect="copy","dragover"===e.type?e.target.classList.add(t):"dragleave"===e.type&&e.target.classList.remove(t)},handleDrop:function(t){var n,r="medium-editor-dragover";t.preventDefault(),t.stopPropagation(),t.dataTransfer.files&&(n=Array.prototype.slice.call(t.dataTransfer.files,0),n.some(function(t){if(t.type.match("image")){var n,r;n=new FileReader,n.readAsDataURL(t),r="medium-img-"+ +new Date,e.util.insertHTMLCommand(this.document,''),n.onload=function(){var e=this.document.getElementById(r);e&&(e.removeAttribute("id"),e.removeAttribute("class"),e.src=n.result)}.bind(this)}}.bind(this))),t.target.classList.remove(r)}});e.extensions.imageDragging=t}(),function(){function t(t){var n=e.selection.getSelectionStart(this.options.ownerDocument),r=n.textContent,i=e.selection.getCaretOffsets(n);(void 0===r[i.left-1]||""===r[i.left-1].trim())&&t.preventDefault()}function n(t,n){if(this.options.disableReturn||n.getAttribute("data-disable-return"))t.preventDefault();else if(this.options.disableDoubleReturn||n.getAttribute("data-disable-double-return")){var r=e.selection.getSelectionStart(this.options.ownerDocument);(r&&""===r.textContent.trim()&&"li"!==r.nodeName.toLowerCase()||r.previousElementSibling&&"br"!==r.previousElementSibling.nodeName.toLowerCase()&&""===r.previousElementSibling.textContent.trim())&&t.preventDefault()}}function r(t){var n=e.selection.getSelectionStart(this.options.ownerDocument),r=n&&n.nodeName.toLowerCase();"pre"===r&&(t.preventDefault(),e.util.insertHTMLCommand(this.options.ownerDocument," ")),e.util.isListItem(n)&&(t.preventDefault(),t.shiftKey?this.options.ownerDocument.execCommand("outdent",!1,null):this.options.ownerDocument.execCommand("indent",!1,null))}function i(t){var n,r=e.selection.getSelectionStart(this.options.ownerDocument),i=r.nodeName.toLowerCase(),o=/^(\s+|)?$/i,a=/h\d/i;e.util.isKey(t,[e.util.keyCode.BACKSPACE,e.util.keyCode.ENTER])&&r.previousElementSibling&&a.test(i)&&0===e.selection.getCaretOffsets(r).left?e.util.isKey(t,e.util.keyCode.BACKSPACE)&&o.test(r.previousElementSibling.innerHTML)?(r.previousElementSibling.parentNode.removeChild(r.previousElementSibling),t.preventDefault()):!this.options.disableDoubleReturn&&e.util.isKey(t,e.util.keyCode.ENTER)&&(n=this.options.ownerDocument.createElement("p"),n.innerHTML="
    ",r.previousElementSibling.parentNode.insertBefore(n,r),t.preventDefault()):e.util.isKey(t,e.util.keyCode.DELETE)&&r.nextElementSibling&&r.previousElementSibling&&!a.test(i)&&o.test(r.innerHTML)&&a.test(r.nextElementSibling.nodeName.toLowerCase())?(e.selection.moveCursor(this.options.ownerDocument,r.nextElementSibling),r.previousElementSibling.parentNode.removeChild(r),t.preventDefault()):e.util.isKey(t,e.util.keyCode.BACKSPACE)&&"li"===i&&o.test(r.innerHTML)&&!r.previousElementSibling&&!r.parentElement.previousElementSibling&&r.nextElementSibling&&"li"===r.nextElementSibling.nodeName.toLowerCase()?(n=this.options.ownerDocument.createElement("p"),n.innerHTML="
    ",r.parentElement.parentElement.insertBefore(n,r.parentElement),e.selection.moveCursor(this.options.ownerDocument,n),r.parentElement.removeChild(r),t.preventDefault()):e.util.isKey(t,e.util.keyCode.BACKSPACE)&&e.util.getClosestTag(r,"blockquote")!==!1&&0===e.selection.getCaretOffsets(r).left&&(t.preventDefault(),e.util.execFormatBlock(this.options.ownerDocument,"p"))}function o(t){var n,r=e.selection.getSelectionStart(this.options.ownerDocument);r&&(e.util.isMediumEditorElement(r)&&0===r.children.length&&this.options.ownerDocument.execCommand("formatBlock",!1,"p"),e.util.isKey(t,e.util.keyCode.ENTER)&&!e.util.isListItem(r)&&(n=r.nodeName.toLowerCase(),"a"===n?this.options.ownerDocument.execCommand("unlink",!1,null):t.shiftKey||t.ctrlKey||/h\d/.test(n)||this.options.ownerDocument.execCommand("formatBlock",!1,"p")))}function a(e){e._mediumEditors||(e._mediumEditors=[null]),this.id||(this.id=e._mediumEditors.length),e._mediumEditors[this.id]=this}function s(e){e._mediumEditors&&e._mediumEditors[this.id]&&(e._mediumEditors[this.id]=null)}function u(t){t||(t=[]),"string"==typeof t&&(t=this.options.ownerDocument.querySelectorAll(t)),e.util.isElement(t)&&(t=[t]);var n=Array.prototype.slice.apply(t);this.elements=[],n.forEach(function(e,t){"textarea"===e.nodeName.toLowerCase()?this.elements.push(y.call(this,e,t)):this.elements.push(e)},this)}function l(e,t){return Object.keys(t).forEach(function(n){void 0===e[n]&&(e[n]=t[n])}),e}function c(e,t,n){var r={window:n.options.contentWindow,document:n.options.ownerDocument,base:n};return e=l(e,r),"function"==typeof e.init&&e.init(),e.name||(e.name=t),e}function f(){return this.elements.every(function(e){return!!e.getAttribute("data-disable-toolbar")})?!1:this.options.toolbar!==!1}function d(){return f.call(this)?this.options.anchorPreview!==!1:!1}function p(){return this.options.placeholder!==!1}function h(){return this.options.autoLink!==!1}function m(){return this.options.imageDragging!==!1}function v(){return this.options.keyboardCommands!==!1}function g(){return!this.options.extensions.imageDragging}function y(e,t){for(var n=this.options.ownerDocument.createElement("div"),r=Date.now(),i="medium-editor-"+r+"-"+t,o=e.attributes;this.options.ownerDocument.getElementById(i);)r++,i="medium-editor-"+r+"-"+t;n.className=e.className,n.id=i,n.innerHTML=e.value,e.setAttribute("medium-editor-textarea-id",i);for(var a=0,s=o.length;s>a;a++)n.hasAttribute(o[a].nodeName)||n.setAttribute(o[a].nodeName,o[a].nodeValue);return e.classList.add("medium-editor-hidden"),e.parentNode.insertBefore(n,e),n}function b(){var e=!1;this.elements.forEach(function(t,n){this.options.disableEditing||t.getAttribute("data-disable-editing")||(t.setAttribute("contentEditable",!0),t.setAttribute("spellcheck",this.options.spellcheck)),t.setAttribute("data-medium-editor-element",!0),t.setAttribute("role","textbox"),t.setAttribute("aria-multiline",!0),t.setAttribute("medium-editor-index",n),t.hasAttribute("medium-editor-textarea-id")&&(e=!0)},this),e&&this.subscribe("editableInput",function(e,t){var n=t.parentNode.querySelector('textarea[medium-editor-textarea-id="'+t.getAttribute("medium-editor-textarea-id")+'"]');n&&(n.value=this.serialize()[t.id].value)}.bind(this))}function x(){var e;if(this.subscribe("editableKeydownTab",r.bind(this)),this.subscribe("editableKeydownDelete",i.bind(this)),this.subscribe("editableKeydownEnter",i.bind(this)),this.options.disableExtraSpaces&&this.subscribe("editableKeydownSpace",t.bind(this)),this.options.disableReturn||this.options.disableDoubleReturn)this.subscribe("editableKeydownEnter",n.bind(this));else for(e=0;e=0&&(r=e.selection.exportSelection(t,this.options.ownerDocument)),null!==r&&0!==n&&(r.editableElementIndex=n),r},saveSelection:function(){this.selectionState=this.exportSelection()},importSelection:function(t,n){if(t){var r=this.elements[t.editableElementIndex||0];e.selection.importSelection(t,r,this.options.ownerDocument,n)}},restoreSelection:function(){this.importSelection(this.selectionState)},createLink:function(t){var n=e.selection.getSelectionElement(this.options.contentWindow),r={};if(-1!==this.elements.indexOf(n)){try{if(this.events.disableCustomEvent("editableInput"),t.url&&t.url.trim().length>0){var i=this.options.contentWindow.getSelection();if(i){var o,a,s,u,l=i.getRangeAt(0),c=l.commonAncestorContainer;if(3===l.endContainer.nodeType&&3!==l.startContainer.nodeType&&0===l.startOffset&&l.startContainer.firstChild===l.endContainer&&(c=l.endContainer),a=e.util.getClosestBlockContainer(l.startContainer),s=e.util.getClosestBlockContainer(l.endContainer),3!==c.nodeType&&0!==c.textContent.length&&a===s){var f=a||n,d=this.options.ownerDocument.createDocumentFragment();this.execAction("unlink"),o=this.exportSelection(),d.appendChild(f.cloneNode(!0)),n===f?e.selection.select(this.options.ownerDocument,f.firstChild,0,f.lastChild,3===f.lastChild.nodeType?f.lastChild.nodeValue.length:f.lastChild.childNodes.length):e.selection.select(this.options.ownerDocument,f,0,f,f.childNodes.length);var p=this.exportSelection();u=e.util.findOrCreateMatchingTextNodes(this.options.ownerDocument,d,{start:o.start-p.start,end:o.end-p.start,editableElementIndex:o.editableElementIndex}),0===u.length&&(d=this.options.ownerDocument.createDocumentFragment(),d.appendChild(c.cloneNode(!0)),u=[d.firstChild.firstChild,d.firstChild.lastChild]),e.util.createLink(this.options.ownerDocument,u,t.url.trim());var h=(d.firstChild.innerHTML.match(/^\s+/)||[""])[0].length;e.util.insertHTMLCommand(this.options.ownerDocument,d.firstChild.innerHTML.replace(/^\s+/,"")),o.start-=h,o.end-=h,this.importSelection(o)}else this.options.ownerDocument.execCommand("createLink",!1,t.url);(this.options.targetBlank||"_blank"===t.target)&&e.util.setTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),t.url),t.buttonClass&&e.util.addClassToAnchors(e.selection.getSelectionStart(this.options.ownerDocument),t.buttonClass)}}if(this.options.targetBlank||"_blank"===t.target||t.buttonClass){r=this.options.ownerDocument.createEvent("HTMLEvents"),r.initEvent("input",!0,!0,this.options.contentWindow);for(var m=0;m1?t[1]:"";return{major:parseInt(n[0],10),minor:parseInt(n[1],10),revision:parseInt(n[2],10),preRelease:r,toString:function(){return[n[0],n[1],n[2]].join(".")+(r?"-"+r:"")}}},e.version=e.parseVersionString.call(this,{version:"5.14.2"}.version),e}())},function(e,t){"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var r=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;e.exports=Object.assign||function(e,t){for(var o,a,s=n(e),u=1;u, "+('or explicitly pass "store" as a prop to "'+a.constructor.displayName+'".'));var s=a.store.getState();return a.state={storeState:s},a.clearCache(),a}return a(n,t),n.prototype.shouldComponentUpdate=function(){return!S||this.haveOwnPropsChanged||this.hasStoreStateChanged},n.prototype.computeStateProps=function(e,t){if(!this.finalMapStateToProps)return this.configureFinalMapState(e,t);var n=e.getState(),r=this.doStatePropsDependOnOwnProps?this.finalMapStateToProps(n,t):this.finalMapStateToProps(n);return u(r)},n.prototype.configureFinalMapState=function(e,t){var n=h(e.getState(),t),r="function"==typeof n;return this.finalMapStateToProps=r?n:h,this.doStatePropsDependOnOwnProps=1!==this.finalMapStateToProps.length,r?this.computeStateProps(e,t):u(n)},n.prototype.computeDispatchProps=function(e,t){if(!this.finalMapDispatchToProps)return this.configureFinalMapDispatch(e,t);var n=e.dispatch,r=this.doDispatchPropsDependOnOwnProps?this.finalMapDispatchToProps(n,t):this.finalMapDispatchToProps(n);return u(r,!0)},n.prototype.configureFinalMapDispatch=function(e,t){var n=v(e.dispatch,t),r="function"==typeof n;return this.finalMapDispatchToProps=r?n:v,this.doDispatchPropsDependOnOwnProps=1!==this.finalMapDispatchToProps.length,r?this.computeDispatchProps(e,t):u(n,!0)},n.prototype.updateStatePropsIfNeeded=function(){var e=this.computeStateProps(this.store,this.props);return this.stateProps&&(0,m["default"])(e,this.stateProps)?!1:(this.stateProps=e,!0)},n.prototype.updateDispatchPropsIfNeeded=function(){var e=this.computeDispatchProps(this.store,this.props);return this.dispatchProps&&(0,m["default"])(e,this.dispatchProps)?!1:(this.dispatchProps=e,!0)},n.prototype.updateMergedPropsIfNeeded=function(){var e=r(this.stateProps,this.dispatchProps,this.props);return this.mergedProps&&x&&(0,m["default"])(e,this.mergedProps)?!1:(this.mergedProps=e,!0)},n.prototype.isSubscribed=function(){return"function"==typeof this.unsubscribe},n.prototype.trySubscribe=function(){d&&!this.unsubscribe&&(this.unsubscribe=this.store.subscribe(this.handleChange.bind(this)),this.handleChange())},n.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},n.prototype.componentDidMount=function(){this.trySubscribe()},n.prototype.componentWillReceiveProps=function(e){S&&(0,m["default"])(e,this.props)||(this.haveOwnPropsChanged=!0)},n.prototype.componentWillUnmount=function(){this.tryUnsubscribe(),this.clearCache()},n.prototype.clearCache=function(){this.dispatchProps=null,this.stateProps=null,this.mergedProps=null,this.haveOwnPropsChanged=!0,this.hasStoreStateChanged=!0,this.renderedElement=null,this.finalMapDispatchToProps=null,this.finalMapStateToProps=null},n.prototype.handleChange=function(){if(this.unsubscribe){var e=this.state.storeState,t=this.store.getState();S&&e===t||(this.hasStoreStateChanged=!0,this.setState({storeState:t}))}},n.prototype.getWrappedInstance=function(){return(0,k["default"])(M,"To access the wrapped instance, you need to specify { withRef: true } as the fourth argument of the connect() call."),this.refs.wrappedInstance},n.prototype.render=function(){var t=this.haveOwnPropsChanged,n=this.hasStoreStateChanged,r=this.renderedElement;this.haveOwnPropsChanged=!1,this.hasStoreStateChanged=!1;var i=!0,o=!0;S&&r&&(i=n||t&&this.doStatePropsDependOnOwnProps,o=t&&this.doDispatchPropsDependOnOwnProps);var a=!1,s=!1;i&&(a=this.updateStatePropsIfNeeded()),o&&(s=this.updateDispatchPropsIfNeeded());var u=!0;return u=a||s||t?this.updateMergedPropsIfNeeded():!1,!u&&r?r:(M?this.renderedElement=(0,f.createElement)(e,c({},this.mergedProps,{ref:"wrappedInstance"})):this.renderedElement=(0,f.createElement)(e,this.mergedProps),this.renderedElement)},n}(f.Component);return t.displayName="Connect("+s(e)+")",t.WrappedComponent=e,t.contextTypes={store:p["default"]},t.propTypes={store:p["default"]},(0,A["default"])(t,e)}}var c=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e){return!e||!e.__v2_compatible__}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;tt;++t)e[t].onLeave&&e[t].onLeave.call(e[t])}t.__esModule=!0,t.runEnterHooks=a,t.runLeaveHooks=s;var u=n(52),l=n(6);r(l)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var i=n(238),o=r(i),a=n(96),s=r(a);t["default"]=s["default"](o["default"]),e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t,n){if(!e.path)return!1;var r=o.getParamNames(e.path);return r.some(function(e){return t.params[e]!==n.params[e]})}function i(e,t){var n=e&&e.routes,i=t.routes,o=void 0,a=void 0;return n?(o=n.filter(function(n){return-1===i.indexOf(n)||r(n,e,t)}),o.reverse(),a=i.filter(function(e){return-1===n.indexOf(e)||-1!==o.indexOf(e)})):(o=[],a=i),{leaveRoutes:o,enterRoutes:a}}t.__esModule=!0;var o=n(27);t["default"]=i,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t,n){t.component||t.components?n(null,t.component||t.components):t.getComponent?t.getComponent(e,n):t.getComponents?t.getComponents(e,n):n()}function i(e,t){o.mapAsync(e.routes,function(t,n,i){r(e.location,t,i)},t)}t.__esModule=!0;var o=n(52);t["default"]=i,e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){var n={};if(!e.path)return n;var r=i.getParamNames(e.path);for(var o in t)t.hasOwnProperty(o)&&-1!==r.indexOf(o)&&(n[o]=t[o]);return n}t.__esModule=!0;var i=n(27);t["default"]=r,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var i=n(102),o=r(i),a=n(96),s=r(a);t["default"]=s["default"](o["default"]),e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t){if(e==t)return!0;if(null==e||null==t)return!1;if(Array.isArray(e))return Array.isArray(t)&&e.length===t.length&&e.every(function(e,n){return r(e,t[n])});if("object"==typeof e){for(var n in e)if(e.hasOwnProperty(n))if(void 0===e[n]){if(void 0!==t[n])return!1}else{if(!t.hasOwnProperty(n))return!1;if(!r(e[n],t[n]))return!1}return!0}return String(e)===String(t)}function i(e,t,n){return e.every(function(e,r){return String(t[r])===String(n[e])})}function o(e,t,n){for(var r=e,o=[],a=[],s=0,u=t.length;u>s;++s){var c=t[s],f=c.path||"";if("/"===f.charAt(0)&&(r=e,o=[],a=[]),null!==r){var d=l.matchPattern(f,r);r=d.remainingPathname,o=[].concat(o,d.paramNames),a=[].concat(a,d.paramValues)}if(""===r&&c.path&&i(o,a,n))return s}return null}function a(e,t,n,r){var i=o(e,t,n);return null===i?!1:r?t.slice(i+1).every(function(e){return!e.path}):!0}function s(e,t){return null==t?null==e:null==e?!0:r(e,t)}function u(e,t,n,r,i){var o=e.pathname,u=e.query;return null==n?!1:a(o,r,i,t)?s(u,n.query):!1}t.__esModule=!0,t["default"]=u;var l=n(27);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e,t){var n=e.history,r=e.routes,o=e.location,s=i(e,["history","routes","location"]);n||o?void 0:u["default"](!1),n=n?n:c["default"](s);var l=d["default"](n,p.createRoutes(r)),f=void 0;o?o=n.createLocation(o):f=n.listen(function(e){o=e});var m=h.createRouterObject(n,l);n=h.createRoutingHistory(n,l),l.match(o,function(e,r,i){t(e,r,i&&a({},i,{history:n,router:m,matchContext:{history:n,transitionManager:l,router:m}})),f&&f()})}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function o(e){return function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=t.routes,r=i(t,["routes"]),o=u["default"](e)(r),s=c["default"](o,n);return a({},o,s)}}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;to?t.call(this,o++,i,r):r.apply(this,arguments))}var o=0,a=!1;i()}t.__esModule=!0,t.loopAsync=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(){function e(e){e=e||window.history.state||{};var t=f.getWindowPath(),n=e,r=n.key,i=void 0;r?i=d.readState(r):(i=null,r=b.createKey(),g&&window.history.replaceState(o({},e,{key:r}),null,t));var a=l.parsePath(t);return b.createLocation(o({},a,{state:i}),void 0,r)}function t(t){function n(t){void 0!==t.state&&r(e(t.state))}var r=t.transitionTo;return f.addEventListener(window,"popstate",n),function(){f.removeEventListener(window,"popstate",n)}}function n(e){var t=e.basename,n=e.pathname,r=e.search,i=e.hash,o=e.state,a=e.action,s=e.key;if(a!==u.POP){d.saveState(s,o);var l=(t||"")+n+r+i,c={key:s};if(a===u.PUSH){if(y)return window.location.href=l,!1;window.history.pushState(c,null,l)}else{if(y)return window.location.replace(l),!1;window.history.replaceState(c,null,l)}}}function r(e){1===++x&&(A=t(b));var n=b.listenBefore(e);return function(){n(),0===--x&&A()}}function i(e){1===++x&&(A=t(b));var n=b.listen(e);return function(){n(),0===--x&&A()}}function a(e){1===++x&&(A=t(b)),b.registerTransitionHook(e)}function p(e){b.unregisterTransitionHook(e),0===--x&&A()}var m=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];c.canUseDOM?void 0:s["default"](!1);var v=m.forceRefresh,g=f.supportsHistory(),y=!g||v,b=h["default"](o({},m,{getCurrentLocation:e,finishTransition:n,saveState:d.saveState})),x=0,A=void 0;return o({},b,{listenBefore:r,listen:i,registerTransitionHook:a,unregisterTransitionHook:p})}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;t=0&&t=0&&v8&&11>=k),T=32,E=String.fromCharCode(T),S=p.topLevelTypes,N={beforeInput:{phasedRegistrationNames:{bubbled:b({onBeforeInput:null}),captured:b({onBeforeInputCapture:null})},dependencies:[S.topCompositionEnd,S.topKeyPress,S.topTextInput,S.topPaste]},compositionEnd:{phasedRegistrationNames:{bubbled:b({onCompositionEnd:null}),captured:b({onCompositionEndCapture:null})},dependencies:[S.topBlur,S.topCompositionEnd,S.topKeyDown,S.topKeyPress,S.topKeyUp,S.topMouseDown]},compositionStart:{phasedRegistrationNames:{bubbled:b({onCompositionStart:null}),captured:b({onCompositionStartCapture:null})},dependencies:[S.topBlur,S.topCompositionStart,S.topKeyDown,S.topKeyPress,S.topKeyUp,S.topMouseDown]},compositionUpdate:{phasedRegistrationNames:{bubbled:b({onCompositionUpdate:null}),captured:b({onCompositionUpdateCapture:null})},dependencies:[S.topBlur,S.topCompositionUpdate,S.topKeyDown,S.topKeyPress,S.topKeyUp,S.topMouseDown]}},M=!1,O=null,L={eventTypes:N,extractEvents:function(e,t,n,r,i){return[l(e,t,n,r,i),d(e,t,n,r,i)]}};e.exports=L},function(e,t,n){"use strict";var r=n(105),i=n(5),o=n(10),a=(n(183),n(288)),s=n(188),u=n(192),l=(n(2),u(function(e){return s(e)})),c=!1,f="cssFloat";if(i.canUseDOM){var d=document.createElement("div").style;try{d.font=""}catch(p){c=!0}void 0===document.documentElement.style.cssFloat&&(f="styleFloat")}var h={createMarkupForStyles:function(e){var t="";for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];null!=r&&(t+=l(n)+":",t+=a(n,r)+";")}return t||null},setValueForStyles:function(e,t){var n=e.style;for(var i in t)if(t.hasOwnProperty(i)){var o=a(i,t[i]);if("float"===i&&(i=f),o)n[i]=o;else{var s=c&&r.shorthandPropertyExpansions[i];if(s)for(var u in s)n[u]="";else n[i]=""}}}};o.measureMethods(h,"CSSPropertyOperations",{setValueForStyles:"setValueForStyles"}),e.exports=h},function(e,t,n){"use strict";function r(e){var t=e.nodeName&&e.nodeName.toLowerCase();return"select"===t||"input"===t&&"file"===e.type}function i(e){var t=k.getPooled(N.change,O,e,P(e));x.accumulateTwoPhaseDispatches(t),w.batchedUpdates(o,t)}function o(e){b.enqueueEvents(e),b.processEventQueue(!1)}function a(e,t){M=e,O=t,M.attachEvent("onchange",i)}function s(){M&&(M.detachEvent("onchange",i),M=null,O=null)}function u(e,t,n){return e===S.topChange?n:void 0}function l(e,t,n){e===S.topFocus?(s(),a(t,n)):e===S.topBlur&&s()}function c(e,t){M=e,O=t,L=e.value,R=Object.getOwnPropertyDescriptor(e.constructor.prototype,"value"),Object.defineProperty(M,"value",I),M.attachEvent("onpropertychange",d)}function f(){M&&(delete M.value,M.detachEvent("onpropertychange",d),M=null,O=null,L=null,R=null)}function d(e){if("value"===e.propertyName){var t=e.srcElement.value;t!==L&&(L=t,i(e))}}function p(e,t,n){return e===S.topInput?n:void 0}function h(e,t,n){e===S.topFocus?(f(),c(t,n)):e===S.topBlur&&f()}function m(e,t,n){return e!==S.topSelectionChange&&e!==S.topKeyUp&&e!==S.topKeyDown||!M||M.value===L?void 0:(L=M.value,O)}function v(e){return e.nodeName&&"input"===e.nodeName.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}function g(e,t,n){return e===S.topClick?n:void 0}var y=n(16),b=n(32),x=n(33),A=n(5),w=n(11),k=n(25),P=n(69),C=n(72),T=n(132),E=n(19),S=y.topLevelTypes,N={change:{phasedRegistrationNames:{bubbled:E({onChange:null}),captured:E({onChangeCapture:null})},dependencies:[S.topBlur,S.topChange,S.topClick,S.topFocus,S.topInput,S.topKeyDown,S.topKeyUp,S.topSelectionChange]}},M=null,O=null,L=null,R=null,j=!1;A.canUseDOM&&(j=C("change")&&(!("documentMode"in document)||document.documentMode>8));var D=!1;A.canUseDOM&&(D=C("input")&&(!("documentMode"in document)||document.documentMode>9));var I={get:function(){return R.get.call(this)},set:function(e){L=""+e,R.set.call(this,e)}},z={eventTypes:N,extractEvents:function(e,t,n,i,o){var a,s;if(r(t)?j?a=u:s=l:T(t)?D?a=p:(a=m,s=h):v(t)&&(a=g),a){var c=a(e,t,n);if(c){var f=k.getPooled(N.change,c,i,o);return f.type="change",x.accumulateTwoPhaseDispatches(f),f}}s&&s(e,t,n)}};e.exports=z},function(e,t){"use strict";var n=0,r={createReactRootIndex:function(){return n++}};e.exports=r},function(e,t,n){"use strict";function r(e){return e.substring(1,e.indexOf(" "))}var i=n(5),o=n(185),a=n(13),s=n(85),u=n(1),l=/^(<[^ \/>]+)/,c="data-danger-index",f={dangerouslyRenderMarkup:function(e){i.canUseDOM?void 0:u(!1);for(var t,n={},f=0;fe&&n[e]===i[e];e++);var a=r-e;for(t=1;a>=t&&n[r-t]===i[o-t];t++);var s=t>1?1-t:void 0;return this._fallbackText=i.slice(e,s),this._fallbackText}}),i.addPoolingTo(r),e.exports=r},function(e,t,n){"use strict";var r,i=n(29),o=n(5),a=i.injection.MUST_USE_ATTRIBUTE,s=i.injection.MUST_USE_PROPERTY,u=i.injection.HAS_BOOLEAN_VALUE,l=i.injection.HAS_SIDE_EFFECTS,c=i.injection.HAS_NUMERIC_VALUE,f=i.injection.HAS_POSITIVE_NUMERIC_VALUE,d=i.injection.HAS_OVERLOADED_BOOLEAN_VALUE;if(o.canUseDOM){var p=document.implementation;r=p&&p.hasFeature&&p.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}var h={isCustomAttribute:RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),Properties:{accept:null,acceptCharset:null,accessKey:null,action:null,allowFullScreen:a|u,allowTransparency:a,alt:null,async:u,autoComplete:null,autoPlay:u,capture:a|u,cellPadding:null,cellSpacing:null,charSet:a,challenge:a,checked:s|u,classID:a,className:r?a:s,cols:a|f,colSpan:null,content:null,contentEditable:null,contextMenu:a,controls:s|u,coords:null,crossOrigin:null,data:null,dateTime:a,"default":u,defer:u,dir:null,disabled:a|u,download:d,draggable:null,encType:null,form:a,formAction:a,formEncType:a,formMethod:a,formNoValidate:u,formTarget:a,frameBorder:a,headers:null,height:a,hidden:a|u,high:null,href:null,hrefLang:null,htmlFor:null,httpEquiv:null,icon:null,id:s,inputMode:a,integrity:null,is:a,keyParams:a,keyType:a,kind:null,label:null,lang:null,list:a,loop:s|u,low:null,manifest:a,marginHeight:null,marginWidth:null,max:null,maxLength:a,media:a,mediaGroup:null,method:null,min:null,minLength:a,multiple:s|u,muted:s|u,name:null,nonce:a,noValidate:u,open:u,optimum:null,pattern:null,placeholder:null,poster:null,preload:null,radioGroup:null,readOnly:s|u,rel:null,required:u,reversed:u,role:a,rows:a|f,rowSpan:null,sandbox:null,scope:null,scoped:u,scrolling:null,seamless:a|u,selected:s|u,shape:null,size:a|f,sizes:a,span:f,spellCheck:null,src:null,srcDoc:s,srcLang:null,srcSet:a,start:c,step:null,style:null,summary:null,tabIndex:null,target:null,title:null,type:null,useMap:null,value:s|l,width:a,wmode:a,wrap:null,about:a,datatype:a,inlist:a,prefix:a,property:a,resource:a,"typeof":a,vocab:a,autoCapitalize:a,autoCorrect:a,autoSave:null,color:null,itemProp:a,itemScope:a|u,itemType:a,itemID:a,itemRef:a,results:null,security:a,unselectable:a},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{autoComplete:"autocomplete",autoFocus:"autofocus",autoPlay:"autoplay",autoSave:"autosave",encType:"encoding",hrefLang:"hreflang",radioGroup:"radiogroup",spellCheck:"spellcheck",srcDoc:"srcdoc",srcSet:"srcset"}};e.exports=h},function(e,t,n){"use strict";var r=n(111),i=n(262),o=n(267),a=n(3),s=n(289),u={};a(u,o),a(u,{findDOMNode:s("findDOMNode","ReactDOM","react-dom",r,r.findDOMNode),render:s("render","ReactDOM","react-dom",r,r.render),unmountComponentAtNode:s("unmountComponentAtNode","ReactDOM","react-dom",r,r.unmountComponentAtNode),renderToString:s("renderToString","ReactDOMServer","react-dom/server",i,i.renderToString),renderToStaticMarkup:s("renderToStaticMarkup","ReactDOMServer","react-dom/server",i,i.renderToStaticMarkup)}),u.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=r,u.__SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=i,e.exports=u},function(e,t,n){"use strict";var r=(n(34),n(66)),i=(n(2),"_getDOMNodeDidWarn"),o={getDOMNode:function(){return this.constructor[i]=!0,r(this)}};e.exports=o},function(e,t,n){"use strict";function r(e,t,n){var r=void 0===e[n];null!=t&&r&&(e[n]=o(t,null))}var i=n(24),o=n(71),a=n(74),s=n(75),u=(n(2),{instantiateChildren:function(e,t,n){if(null==e)return null;var i={};return s(e,r,i),i},updateChildren:function(e,t,n,r){if(!t&&!e)return null;var s;for(s in t)if(t.hasOwnProperty(s)){var u=e&&e[s],l=u&&u._currentElement,c=t[s];if(null!=u&&a(l,c))i.receiveComponent(u,c,n,r),t[s]=u;else{u&&i.unmountComponent(u,s);var f=o(c,null);t[s]=f}}for(s in e)!e.hasOwnProperty(s)||t&&t.hasOwnProperty(s)||i.unmountComponent(e[s]);return t},unmountChildren:function(e){for(var t in e)if(e.hasOwnProperty(t)){var n=e[t];i.unmountComponent(n)}}});e.exports=u},function(e,t,n){"use strict";function r(e){var t=e._currentElement._owner||null;if(t){var n=t.getName();if(n)return" Check the render method of `"+n+"`."}return""}function i(e){}var o=n(62),a=n(17),s=n(9),u=n(34),l=n(10),c=n(42),f=(n(41),n(24)),d=n(64),p=n(3),h=n(31),m=n(1),v=n(74);n(2);i.prototype.render=function(){var e=u.get(this)._currentElement.type;return e(this.props,this.context,this.updater)};var g=1,y={construct:function(e){this._currentElement=e,this._rootNodeID=null,this._instance=null,this._pendingElement=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._renderedComponent=null,this._context=null,this._mountOrder=0,this._topLevelWrapper=null,this._pendingCallbacks=null},mountComponent:function(e,t,n){this._context=n,this._mountOrder=g++,this._rootNodeID=e;var r,o,a=this._processProps(this._currentElement.props),l=this._processContext(n),c=this._currentElement.type,p="prototype"in c;p&&(r=new c(a,l,d)),(!p||null===r||r===!1||s.isValidElement(r))&&(o=r,r=new i(c)),r.props=a,r.context=l,r.refs=h,r.updater=d,this._instance=r,u.set(r,this);var v=r.state;void 0===v&&(r.state=v=null),"object"!=typeof v||Array.isArray(v)?m(!1):void 0,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,r.componentWillMount&&(r.componentWillMount(),this._pendingStateQueue&&(r.state=this._processPendingState(r.props,r.context))),void 0===o&&(o=this._renderValidatedComponent()),this._renderedComponent=this._instantiateReactComponent(o);var y=f.mountComponent(this._renderedComponent,e,t,this._processChildContext(n));return r.componentDidMount&&t.getReactMountReady().enqueue(r.componentDidMount,r),y},unmountComponent:function(){var e=this._instance;e.componentWillUnmount&&e.componentWillUnmount(),f.unmountComponent(this._renderedComponent),this._renderedComponent=null,this._instance=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._pendingCallbacks=null,this._pendingElement=null,this._context=null,this._rootNodeID=null,this._topLevelWrapper=null,u.remove(e)},_maskContext:function(e){var t=null,n=this._currentElement.type,r=n.contextTypes;if(!r)return h;t={};for(var i in r)t[i]=e[i];return t},_processContext:function(e){var t=this._maskContext(e);return t},_processChildContext:function(e){var t=this._currentElement.type,n=this._instance,r=n.getChildContext&&n.getChildContext();if(r){"object"!=typeof t.childContextTypes?m(!1):void 0;for(var i in r)i in t.childContextTypes?void 0:m(!1);return p({},e,r)}return e},_processProps:function(e){return e},_checkPropTypes:function(e,t,n){var i=this.getName();for(var o in e)if(e.hasOwnProperty(o)){var a;try{"function"!=typeof e[o]?m(!1):void 0,a=e[o](t,o,i,n)}catch(s){a=s}if(a instanceof Error){r(this);n===c.prop}}},receiveComponent:function(e,t,n){var r=this._currentElement,i=this._context;this._pendingElement=null,this.updateComponent(t,r,e,i,n)},performUpdateIfNecessary:function(e){null!=this._pendingElement&&f.receiveComponent(this,this._pendingElement||this._currentElement,e,this._context),(null!==this._pendingStateQueue||this._pendingForceUpdate)&&this.updateComponent(e,this._currentElement,this._currentElement,this._context,this._context)},updateComponent:function(e,t,n,r,i){var o,a=this._instance,s=this._context===i?a.context:this._processContext(i);t===n?o=n.props:(o=this._processProps(n.props),a.componentWillReceiveProps&&a.componentWillReceiveProps(o,s));var u=this._processPendingState(o,s),l=this._pendingForceUpdate||!a.shouldComponentUpdate||a.shouldComponentUpdate(o,u,s);l?(this._pendingForceUpdate=!1,this._performComponentUpdate(n,o,u,s,e,i)):(this._currentElement=n,this._context=i,a.props=o,a.state=u,a.context=s)},_processPendingState:function(e,t){var n=this._instance,r=this._pendingStateQueue,i=this._pendingReplaceState;if(this._pendingReplaceState=!1,this._pendingStateQueue=null,!r)return n.state;if(i&&1===r.length)return r[0];for(var o=p({},i?r[0]:n.state),a=i?1:0;a=0||null!=t.is}function v(e){h(e),this._tag=e.toLowerCase(),this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._rootNodeID=null,this._wrapperState=null,this._topLevelWrapper=null,this._nodeWithLegacyProperties=null}var g=n(241),y=n(243),b=n(29),x=n(59),A=n(16),w=n(40),k=n(61),P=n(256),C=n(259),T=n(260),E=n(113),S=n(263),N=n(7),M=n(268),O=n(10),L=n(64),R=n(3),j=n(45),D=n(46),I=n(1),z=(n(72),n(19)),H=n(47),W=n(73),F=(n(86),n(76),n(2),w.deleteListener),q=w.listenTo,X=w.registrationNameModules,U={string:!0,number:!0},V=z({children:null}),B=z({style:null}),Z=z({__html:null}),G=1,J={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"},K={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Y={listing:!0,pre:!0,textarea:!0},Q=(R({menuitem:!0},K),/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/),_={},$={}.hasOwnProperty;v.displayName="ReactDOMComponent",v.Mixin={construct:function(e){this._currentElement=e},mountComponent:function(e,t,n){this._rootNodeID=e;var r=this._currentElement.props;switch(this._tag){case"iframe":case"img":case"form":case"video":case"audio":this._wrapperState={listeners:null},t.getReactMountReady().enqueue(f,this);break;case"button":r=P.getNativeProps(this,r,n);break;case"input":C.mountWrapper(this,r,n),r=C.getNativeProps(this,r,n);break;case"option":T.mountWrapper(this,r,n),r=T.getNativeProps(this,r,n);break;case"select":E.mountWrapper(this,r,n),r=E.getNativeProps(this,r,n),n=E.processChildContext(this,r,n);break;case"textarea":S.mountWrapper(this,r,n),r=S.getNativeProps(this,r,n)}u(this,r);var i;if(t.useCreateElement){var o=n[N.ownerDocumentContextKey],a=o.createElement(this._currentElement.type);x.setAttributeForID(a,this._rootNodeID),N.getID(a),this._updateDOMProperties({},r,t,a),this._createInitialChildren(t,r,n,a),i=a}else{var s=this._createOpenTagMarkupAndPutListeners(t,r),l=this._createContentMarkup(t,r,n);i=!l&&K[this._tag]?s+"/>":s+">"+l+""}switch(this._tag){case"input":t.getReactMountReady().enqueue(d,this);case"button":case"select":case"textarea":r.autoFocus&&t.getReactMountReady().enqueue(g.focusDOMComponent,this)}return i},_createOpenTagMarkupAndPutListeners:function(e,t){var n="<"+this._currentElement.type;for(var r in t)if(t.hasOwnProperty(r)){var i=t[r];if(null!=i)if(X.hasOwnProperty(r))i&&l(this._rootNodeID,r,i,e);else{r===B&&(i&&(i=this._previousStyleCopy=R({},t.style)),i=y.createMarkupForStyles(i));var o=null;null!=this._tag&&m(this._tag,t)?r!==V&&(o=x.createMarkupForCustomAttribute(r,i)):o=x.createMarkupForProperty(r,i),o&&(n+=" "+o)}}if(e.renderToStaticMarkup)return n;var a=x.createMarkupForID(this._rootNodeID);return n+" "+a},_createContentMarkup:function(e,t,n){var r="",i=t.dangerouslySetInnerHTML;if(null!=i)null!=i.__html&&(r=i.__html);else{var o=U[typeof t.children]?t.children:null,a=null!=o?null:t.children;if(null!=o)r=D(o);else if(null!=a){var s=this.mountChildren(a,e,n);r=s.join("")}}return Y[this._tag]&&"\n"===r.charAt(0)?"\n"+r:r},_createInitialChildren:function(e,t,n,r){var i=t.dangerouslySetInnerHTML;if(null!=i)null!=i.__html&&H(r,i.__html);else{var o=U[typeof t.children]?t.children:null,a=null!=o?null:t.children;if(null!=o)W(r,o);else if(null!=a)for(var s=this.mountChildren(a,e,n),u=0;ut.end?(n=t.end,r=t.start):(n=t.start,r=t.end),i.moveToElementText(e),i.moveStart("character",n),i.setEndPoint("EndToStart",i),i.moveEnd("character",r-n),i.select()}function s(e,t){if(window.getSelection){var n=window.getSelection(),r=e[c()].length,i=Math.min(t.start,r),o="undefined"==typeof t.end?i:Math.min(t.end,r);if(!n.extend&&i>o){var a=o;o=i,i=a}var s=l(e,i),u=l(e,o);if(s&&u){var f=document.createRange();f.setStart(s.node,s.offset),n.removeAllRanges(),i>o?(n.addRange(f),n.extend(u.node,u.offset)):(f.setEnd(u.node,u.offset),n.addRange(f))}}}var u=n(5),l=n(292),c=n(131),f=u.canUseDOM&&"selection"in document&&!("getSelection"in window),d={getOffsets:f?i:o,setOffsets:f?a:s};e.exports=d},function(e,t,n){"use strict";var r=n(116),i=n(273),o=n(65);r.inject();var a={renderToString:i.renderToString,renderToStaticMarkup:i.renderToStaticMarkup,version:o};e.exports=a},function(e,t,n){"use strict";function r(){this._rootNodeID&&c.updateWrapper(this)}function i(e){var t=this._currentElement.props,n=o.executeOnChange(t,e);return s.asap(r,this),n}var o=n(60),a=n(63),s=n(11),u=n(3),l=n(1),c=(n(2),{getNativeProps:function(e,t,n){null!=t.dangerouslySetInnerHTML?l(!1):void 0;var r=u({},t,{defaultValue:void 0,value:void 0,children:e._wrapperState.initialValue,onChange:e._wrapperState.onChange});return r},mountWrapper:function(e,t){var n=t.defaultValue,r=t.children;null!=r&&(null!=n?l(!1):void 0,Array.isArray(r)&&(r.length<=1?void 0:l(!1),r=r[0]),n=""+r),null==n&&(n="");var a=o.getValue(t);e._wrapperState={initialValue:""+(null!=a?a:n),onChange:i.bind(e)}},updateWrapper:function(e){var t=e._currentElement.props,n=o.getValue(t);null!=n&&a.updatePropertyByID(e._rootNodeID,"value",""+n)}});e.exports=c},function(e,t,n){"use strict";function r(e){i.enqueueEvents(e),i.processEventQueue(!1)}var i=n(32),o={handleTopLevel:function(e,t,n,o,a){var s=i.extractEvents(e,t,n,o,a);r(s)}};e.exports=o},function(e,t,n){"use strict";function r(e){var t=d.getID(e),n=f.getReactRootIDFromNodeID(t),r=d.findReactContainerForID(n),i=d.getFirstReactDOM(r);return i}function i(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}function o(e){a(e)}function a(e){for(var t=d.getFirstReactDOM(m(e.nativeEvent))||window,n=t;n;)e.ancestors.push(n),n=r(n);for(var i=0;ii;){for(;ii;i++)n+=t+=e.charCodeAt(i);return t%=r,n%=r,t|n<<16}var r=65521;e.exports=n},function(e,t,n){"use strict";function r(e,t){var n=null==t||"boolean"==typeof t||""===t;if(n)return"";var r=isNaN(t);return r||0===t||o.hasOwnProperty(e)&&o[e]?""+t:("string"==typeof t&&(t=t.trim()),t+"px")}var i=n(105),o=i.isUnitlessNumber;e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r,i){return i}n(3),n(2);e.exports=r},function(e,t,n){"use strict";function r(e,t,n){var r=e,i=void 0===r[n];i&&null!=t&&(r[n]=t)}function i(e){if(null==e)return e;var t={};return o(e,r,t),t}var o=n(75);n(2);e.exports=i},function(e,t,n){"use strict";function r(e){if(e.key){var t=o[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=i(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?a[e.keyCode]||"Unidentified":""}var i=n(67),o={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},a={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};e.exports=r},function(e,t){"use strict";function n(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function r(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function i(e,t){for(var i=n(e),o=0,a=0;i;){if(3===i.nodeType){if(a=o+i.textContent.length,t>=o&&a>=t)return{node:i,offset:t-o};o=a}i=n(r(i))}}e.exports=i},function(e,t,n){"use strict";function r(e){return i.isValidElement(e)?void 0:o(!1),e}var i=n(9),o=n(1);e.exports=r},function(e,t,n){"use strict";function r(e){return'"'+i(e)+'"'}var i=n(46);e.exports=r},function(e,t,n){"use strict";var r=n(7);e.exports=r.renderSubtreeIntoContainer},function(e,t){"use strict";function n(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return function(e,n){return t.reduce(function(e,t){return t(e,n)},e)}}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t){"use strict";function n(e){return e}function r(e,t,r){var i="function"==typeof t?t:n;return function(){for(var t=arguments.length,n=Array(t),o=0;t>o;o++)n[o]=arguments[o];var a={type:e,payload:i.apply(void 0,n)};return 1===n.length&&n[0]instanceof Error&&(a.error=!0),"function"==typeof r&&(a.meta=r.apply(void 0,n)),a}}t.__esModule=!0,t["default"]=r,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function i(e,t){var n=u["default"](e).map(function(t){return a["default"](t,e[t])});return"undefined"!=typeof t?function(e,r){return void 0===e&&(e=t),c["default"].apply(void 0,n)(e,r)}:c["default"].apply(void 0,n)}t.__esModule=!0,t["default"]=i;var o=n(133),a=r(o),s=n(300),u=r(s),l=n(296),c=r(l);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var i=n(297),o=r(i),a=n(133),s=r(a),u=n(298),l=r(u);t.createAction=o["default"],t.handleAction=s["default"],t.handleActions=l["default"]},function(e,t){"use strict";function n(e){if("undefined"!=typeof Reflect&&"function"==typeof Reflect.ownKeys)return Reflect.ownKeys(e);var t=Object.getOwnPropertyNames(e);return"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e))),t}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e){return{load:function(){var t=localStorage.getItem(e);return Promise.resolve(JSON.parse(t)||{})},save:function(t){var n=JSON.stringify(t);return localStorage.setItem(e,n),Promise.resolve()}}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;t-1&&e%1==0&&t>e}function f(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function d(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function p(){}function h(e,t){return v(e,t)&&delete e[t]}function m(e,t){if(Et){var n=e[t];return n===we?void 0:n}return dt.call(e,t)?e[t]:void 0}function v(e,t){return Et?void 0!==e[t]:dt.call(e,t)}function g(e,t,n){e[t]=Et&&void 0===n?we:n}function y(e){var t=-1,n=e?e.length:0;for(this.clear();++tn)return!1;var r=e.length-1;return n==r?e.pop():wt.call(e,n,1),!0}function O(e,t){var n=R(e,t);return 0>n?void 0:e[n][1]}function L(e,t){return R(e,t)>-1}function R(e,t){for(var n=e.length;n--;)if(le(e[n][0],t))return n;return-1}function j(e,t,n){var r=R(e,t);0>r?e.push([t,n]):e[r][1]=n}function D(e,t,n){var r=e[t];dt.call(e,t)&&le(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function I(e,t){return e&&Q(t,be(t),e)}function z(e,t,n,r,i,a,s){var u;if(r&&(u=a?r(e,i,a,s):r(e)),void 0!==u)return u;if(!me(e))return e;var c=It(e);if(c){if(u=re(e),!t)return Y(e,u)}else{var f=ne(e),d=f==Ne||f==Me;if(zt(e))return U(e,t);if(f==Re||f==Pe||d&&!a){if(l(e))return a?e:{};if(u=ie(d?{}:e),!t)return u=I(u,e),n?$(e,u):u}else{if(!$e[f])return a?e:{};u=oe(e,f,t)}}s||(s=new P);var p=s.get(e);return p?p:(s.set(e,u),(c?o:W)(e,function(i,o){D(u,o,z(i,t,n,r,o,e,s))}),n&&!c?$(e,u):u)}function H(e){return me(e)?xt(e):{}}function W(e,t){return e&&Rt(e,t,be)}function F(e,t){return dt.call(e,t)||"object"==typeof e&&t in e&&null===yt(e)}function q(e){return kt(Object(e))}function X(e){return function(t){return null==t?void 0:t[e]}}function U(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}function V(e){var t=new e.constructor(e.byteLength);return new gt(t).set(new gt(e)),t}function B(e){return a(f(e),r,new e.constructor)}function Z(e){var t=new e.constructor(e.source,Ye.exec(e));return t.lastIndex=e.lastIndex,t}function G(e){return a(d(e),i,new e.constructor)}function J(e){return Lt?Object(Lt.call(e)):{}}function K(e,t){var n=t?V(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function Y(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n-1&&e%1==0&&ke>=e}function me(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function ve(e){return!!e&&"object"==typeof e}function ge(e){return null==e?!1:pe(e)?ht.test(ft.call(e)):ve(e)&&(l(e)?ht:Qe).test(e)}function ye(e){return"string"==typeof e||!It(e)&&ve(e)&&pt.call(e)==Ie}function be(e){var t=ue(e);if(!t&&!fe(e))return q(e);var n=ae(e),r=!!n,i=n||[],o=i.length;for(var a in e)!F(e,a)||r&&("length"==a||c(a,o))||t&&"constructor"==a||i.push(a);return i}function xe(e){return function(){return e}}var Ae=200,we="__lodash_hash_undefined__",ke=9007199254740991,Pe="[object Arguments]",Ce="[object Array]",Te="[object Boolean]",Ee="[object Date]",Se="[object Error]",Ne="[object Function]",Me="[object GeneratorFunction]",Oe="[object Map]",Le="[object Number]",Re="[object Object]",je="[object RegExp]",De="[object Set]",Ie="[object String]",ze="[object Symbol]",He="[object WeakMap]",We="[object ArrayBuffer]",Fe="[object Float32Array]",qe="[object Float64Array]",Xe="[object Int8Array]",Ue="[object Int16Array]",Ve="[object Int32Array]",Be="[object Uint8Array]",Ze="[object Uint8ClampedArray]",Ge="[object Uint16Array]",Je="[object Uint32Array]",Ke=/[\\^$.*+?()[\]{}|]/g,Ye=/\w*$/,Qe=/^\[object .+?Constructor\]$/,_e=/^(?:0|[1-9]\d*)$/,$e={};$e[Pe]=$e[Ce]=$e[We]=$e[Te]=$e[Ee]=$e[Fe]=$e[qe]=$e[Xe]=$e[Ue]=$e[Ve]=$e[Oe]=$e[Le]=$e[Re]=$e[je]=$e[De]=$e[Ie]=$e[ze]=$e[Be]=$e[Ze]=$e[Ge]=$e[Je]=!0,$e[Se]=$e[Ne]=$e[He]=!1;var et={"function":!0,object:!0},tt=et[typeof t]&&t&&!t.nodeType?t:void 0,nt=et[typeof e]&&e&&!e.nodeType?e:void 0,rt=nt&&nt.exports===tt?tt:void 0,it=u(tt&&nt&&"object"==typeof n&&n),ot=u(et[typeof self]&&self),at=u(et[typeof window]&&window),st=u(et[typeof this]&&this),ut=it||at!==(st&&st.window)&&at||ot||st||Function("return this")(),lt=Array.prototype,ct=Object.prototype,ft=Function.prototype.toString,dt=ct.hasOwnProperty,pt=ct.toString,ht=RegExp("^"+ft.call(dt).replace(Ke,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),mt=rt?ut.Buffer:void 0,vt=ut.Symbol,gt=ut.Uint8Array,yt=Object.getPrototypeOf,bt=Object.getOwnPropertySymbols,xt=Object.create,At=ct.propertyIsEnumerable,wt=lt.splice,kt=Object.keys,Pt=te(ut,"Map"),Ct=te(ut,"Set"),Tt=te(ut,"WeakMap"),Et=te(Object,"create"),St=Pt?ft.call(Pt):"",Nt=Ct?ft.call(Ct):"",Mt=Tt?ft.call(Tt):"",Ot=vt?vt.prototype:void 0,Lt=Ot?Ot.valueOf:void 0,Rt=ee(),jt=X("length"),Dt=bt||function(){return[]};(Pt&&ne(new Pt)!=Oe||Ct&&ne(new Ct)!=De||Tt&&ne(new Tt)!=He)&&(ne=function(e){var t=pt.call(e),n=t==Re?e.constructor:null,r="function"==typeof n?ft.call(n):"";if(r)switch(r){case St:return Oe;case Nt:return De;case Mt:return He}return t});var It=Array.isArray,zt=mt?function(e){return e instanceof mt}:xe(!1);p.prototype=Et?Et(null):ct,y.prototype.clear=b,y.prototype["delete"]=x,y.prototype.get=A,y.prototype.has=w,y.prototype.set=k,P.prototype.clear=C,P.prototype["delete"]=T,P.prototype.get=E,P.prototype.has=S,P.prototype.set=N, -e.exports=z}).call(t,n(48)(e),function(){return this}())},function(e,t){var n=Array.isArray;e.exports=n},function(e,t){function n(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(n){}return t}function r(e){return!!e&&"object"==typeof e}function i(e){if(!r(e)||l.call(e)!=o||n(e))return!1;var t=c(e);if(null===t)return!0;var i=t.constructor;return"function"==typeof i&&i instanceof i&&s.call(i)==u}var o="[object Object]",a=Object.prototype,s=Function.prototype.toString,u=s.call(Object),l=a.toString,c=Object.getPrototypeOf;e.exports=i},function(e,t,n){(function(e,n){function r(e,t){for(var n=-1,r=Array(e);++n-1&&e%1==0&&t>e}function a(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function s(e){e=null==e?e:Object(e);var t=[];for(var n in e)t.push(n);return t}function u(e){return function(t){return null==t?void 0:t[e]}}function l(e){var t=e?e.length:void 0;return m(t)&&(q(e)||y(e)||f(e))?r(t,String):null}function c(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||j;return e===n}function f(e){return p(e)&&D.call(e,"callee")&&(!W.call(e,"callee")||I.call(e)==A)}function d(e){return null!=e&&m(F(e))&&!h(e)}function p(e){return g(e)&&d(e)}function h(e){var t=v(e)?I.call(e):"";return t==w||t==k}function m(e){return"number"==typeof e&&e>-1&&e%1==0&&x>=e}function v(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){return!!e&&"object"==typeof e}function y(e){return"string"==typeof e||!q(e)&&g(e)&&I.call(e)==P}function b(e){for(var t=-1,n=c(e),r=s(e),i=r.length,a=l(e),u=!!a,f=a||[],d=f.length;++t-1&&e%1==0&&t>e}function o(e,t,n){(void 0!==n&&!m(e[t],n)||"number"==typeof t&&void 0===n&&!(t in e))&&(e[t]=n)}function a(e,t,n){var r=e[t];ie.call(e,t)&&m(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function s(e,t,n,i,a){if(e!==t){var l=ue(t)||k(t)?void 0:S(t);r(l||t,function(r,c){if(l&&(c=r,r=t[c]),A(r))a||(a=new C),u(e,t,c,n,s,i,a);else{var f=i?i(e[c],r,c+"",e,t,a):void 0;void 0===f&&(f=r),o(e,c,f)}})}}function u(e,t,n,r,i,a,s){var u=e[n],l=t[n],f=s.get(l);if(f)return void o(e,n,f);var d=a?a(u,l,n+"",e,t,s):void 0,p=void 0===d;p&&(d=l,ue(l)||k(l)?ue(u)?d=u:y(u)?d=c(u):(p=!1,d=T(l,!a)):E(l)||v(l)?v(u)?d=P(u):!A(u)||r&&b(u)?(p=!1,d=T(l,!a)):d=u:p=!1),s.set(l,d),p&&i(d,l,r,a,s),s["delete"](l),o(e,n,d)}function l(e){return function(t){return null==t?void 0:t[e]}}function c(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n1?n[i-1]:void 0,a=i>2?n[2]:void 0;for(o="function"==typeof o?(i--,o):void 0,a&&h(n[0],n[1],a)&&(o=3>i?void 0:o,i=1),t=Object(t);++r-1&&e%1==0&&M>=e}function A(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function w(e){return!!e&&"object"==typeof e}function k(e){return w(e)&&x(e.length)&&!!ne[oe.call(e)]}function P(e){return f(e,S(e))}var C=n(199),T=n(303),E=n(305),S=n(306),N=n(204),M=9007199254740991,O="[object Arguments]",L="[object Array]",R="[object Boolean]",j="[object Date]",D="[object Error]",I="[object Function]",z="[object GeneratorFunction]",H="[object Map]",W="[object Number]",F="[object Object]",q="[object RegExp]",X="[object Set]",U="[object String]",V="[object WeakMap]",B="[object ArrayBuffer]",Z="[object Float32Array]",G="[object Float64Array]",J="[object Int8Array]",K="[object Int16Array]",Y="[object Int32Array]",Q="[object Uint8Array]",_="[object Uint8ClampedArray]",$="[object Uint16Array]",ee="[object Uint32Array]",te=/^(?:0|[1-9]\d*)$/,ne={};ne[Z]=ne[G]=ne[J]=ne[K]=ne[Y]=ne[Q]=ne[_]=ne[$]=ne[ee]=!0,ne[O]=ne[L]=ne[B]=ne[R]=ne[j]=ne[D]=ne[I]=ne[H]=ne[W]=ne[F]=ne[q]=ne[X]=ne[U]=ne[V]=!1;var re=Object.prototype,ie=re.hasOwnProperty,oe=re.toString,ae=re.propertyIsEnumerable,se=l("length"),ue=Array.isArray,le=p(function(e,t,n){s(e,t,n)});e.exports=le},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var i=Object.assign||function(e){for(var t=1;tn;n++)t[n]=arguments[n];return function(e){return function(n,r,i){var a=e(n,r,i),u=a.dispatch,l=[],c={getState:a.getState,dispatch:function(e){return u(e)}};return l=t.map(function(e){return e(c)}),u=s["default"].apply(void 0,l)(a.dispatch),o({},a,{dispatch:u})}}}var o=Object.assign||function(e){for(var t=1;t-1?t.documentElement.innerHTML=e:t.body.innerHTML=e,t},e}function u(e){var t=(new C).parseFromString(e,"text/html");return A(t,i),t}function l(e){for(var t,n,r,i=[e],o=[];i.length>0;)for(t=i.shift(),o.push(t),n=t.childNodes,r=0;r<",">"+t+"<")}function d(e,t){if("string"==typeof t)return t===e.nodeName.toLowerCase();if(Array.isArray(t))return-1!==t.indexOf(e.nodeName.toLowerCase());if("function"==typeof t)return t.call(v,e);throw new TypeError("`filter` needs to be a string, array, or function")}function p(e,t){var n,r,o;return"left"===e?(n=t.previousSibling,r=/ $/):(n=t.nextSibling,r=/^ /),n&&(3===n.nodeType?o=r.test(n.nodeValue):1!==n.nodeType||i(n)||(o=r.test(n.textContent))),o}function h(e){var t="",n="";if(!i(e)){var r=/^[ \r\n\t]/.test(e.innerHTML),o=/[ \r\n\t]$/.test(e.innerHTML);r&&!p("left",e)&&(t=" "),o&&!p("right",e)&&(n=" ")}return{leading:t,trailing:n}}function m(e){var t,n=c(e);if(!o(e)&&!/A/.test(e.nodeName)&&/^\s*$/i.test(n))return void(e._replacement="");for(var i=0;i=0;o--)m(i[o]);return n=c(r),n.replace(/^[\t\r\n]+|[\t\r\n\s]+$/g,"").replace(/\n\s+\n/g,"\n\n").replace(/\n{3,}/g,"\n\n")},v.isBlock=i,v.isVoid=o,v.trim=r,v.outer=f,e.exports=v},function(e,t){"use strict";function n(e,t){var n=Array.prototype.indexOf.call(t.parentNode.childNodes,t),r=" ";return 0===n&&(r="| "),r+e+" |"}var r=/highlight highlight-(\S+) lang-(\S+)/;e.exports=[{filter:"br",replacement:function(){return"\n"}},{filter:["del","s","strike"],replacement:function(e){return"~~"+e+"~~"}},{filter:function(e){return"checkbox"===e.type&&"LI"===e.parentNode.nodeName},replacement:function(e,t){return(t.checked?"[x]":"[ ]")+" "}},{filter:["th","td"],replacement:function(e,t){return n(e,t)}},{filter:"tr",replacement:function(e,t){var r="",i={left:":--",right:"--:",center:":-:"};if("THEAD"===t.parentNode.nodeName)for(var o=0;oi;i++)r+="#";return"\n\n"+r+" "+e+"\n\n"}},{filter:"hr",replacement:function(){return"\n\n* * *\n\n"}},{filter:["em","i"],replacement:function(e){return"_"+e+"_"}},{filter:["strong","b"],replacement:function(e){return"**"+e+"**"}},{filter:function(e){var t=e.previousSibling||e.nextSibling,n="PRE"===e.parentNode.nodeName&&!t;return"CODE"===e.nodeName&&!n},replacement:function(e){return"`"+e+"`"}},{filter:function(e){return"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t){var n=t.title?' "'+t.title+'"':"";return"["+e+"]("+t.getAttribute("href")+n+")"}},{filter:"img",replacement:function(e,t){var n=t.alt||"",r=t.getAttribute("src")||"",i=t.title||"",o=i?' "'+i+'"':"";return r?"!["+n+"]("+r+o+")":""}},{filter:function(e){return"PRE"===e.nodeName&&"CODE"===e.firstChild.nodeName},replacement:function(e,t){return"\n\n "+t.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},{filter:"blockquote",replacement:function(e){return e=this.trim(e),e=e.replace(/\n{3,}/g,"\n\n"),e=e.replace(/^/gm,"> "),"\n\n"+e+"\n\n"}},{filter:"li",replacement:function(e,t){e=e.replace(/^\s+/,"").replace(/\n/gm,"\n ");var n="* ",r=t.parentNode,i=Array.prototype.indexOf.call(r.children,t)+1;return n=/ol/i.test(r.nodeName)?i+". ":"* ",n+e}},{filter:["ul","ol"],replacement:function(e,t){for(var n=[],r=0;r[> ]*|[*+-]\s|(\d+)([.)]))(\s*)/,n=/^(\s*)(>[> ]*|[*+-]|(\d+)[.)])(\s*)$/,r=/[*+-]\s/;e.commands.newlineAndIndentContinueMarkdownList=function(o){if(o.getOption("disableInput"))return e.Pass;for(var i=o.listSelections(),a=[],s=0;s")>=0?p[2]:parseInt(p[3],10)+1+p[4];a[s]="\n"+h+v+m}}o.replaceSelections(a)}})},function(e,t,n){!function(e){e(n(18))}(function(e){"use strict";e.overlayMode=function(t,n,r){return{startState:function(){return{base:e.startState(t),overlay:e.startState(n),basePos:0,baseCur:null,overlayPos:0,overlayCur:null,streamSeen:null}},copyState:function(r){return{base:e.copyState(t,r.base),overlay:e.copyState(n,r.overlay),basePos:r.basePos,baseCur:null,overlayPos:r.overlayPos,overlayCur:null}},token:function(e,o){return(e!=o.streamSeen||Math.min(o.basePos,o.overlayPos)]|\([^\s()<>]*\))+(?:\([^\s()<>]*\)|[^\s`*!()\[\]{};:'".,<>?«»“”‘’]))/i;e.defineMode("gfm",function(n,r){function o(e){return e.code=!1,null}var i=0,a={startState:function(){return{code:!1,codeBlock:!1,ateSpace:!1}},copyState:function(e){return{code:e.code,codeBlock:e.codeBlock,ateSpace:e.ateSpace}},token:function(e,n){if(n.combineTokens=null,n.codeBlock)return e.match(/^```+/)?(n.codeBlock=!1,null):(e.skipToEnd(),null);if(e.sol()&&(n.code=!1),e.sol()&&e.match(/^```+/))return e.skipToEnd(),n.codeBlock=!0,null;if("`"===e.peek()){e.next();var o=e.pos;e.eatWhile("`");var a=1+e.pos-o;return n.code?a===i&&(n.code=!1):(i=a,n.code=!0),null}if(n.code)return e.next(),null;if(e.eatSpace())return n.ateSpace=!0,null;if((e.sol()||n.ateSpace)&&(n.ateSpace=!1,r.gitHubSpice!==!1)){if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+@)?(?:[a-f0-9]{7,40}\b)/))return n.combineTokens=!0,"link";if(e.match(/^(?:[a-zA-Z0-9\-_]+\/)?(?:[a-zA-Z0-9\-_]+)?#[0-9]+\b/))return n.combineTokens=!0,"link"}return e.match(t)&&"]("!=e.string.slice(e.start-2,e.start)&&(0==e.start||/\W/.test(e.string.charAt(e.start-1)))?(n.combineTokens=!0,"link"):(e.next(),null)},blankLine:o},s={underscoresBreakWords:!1,taskLists:!0,fencedCodeBlocks:"```",strikethrough:!0};for(var u in r)s[u]=r[u];return s.name="markdown",e.overlayMode(e.getMode(n,s),a)},"markdown"),e.defineMIME("text/x-gfm","gfm")})},function(e,t,n){!function(e){e(n(18))}(function(e){"use strict";function t(e,t,n){return/^(?:operator|sof|keyword c|case|new|[\[{}\(,;:]|=>)$/.test(t.lastType)||"quasi"==t.lastType&&/\{\s*$/.test(e.string.slice(0,e.pos-(n||0)))}e.defineMode("javascript",function(n,r){function o(e){for(var t,n=!1,r=!1;null!=(t=e.next());){if(!n){if("/"==t&&!r)return;"["==t?r=!0:r&&"]"==t&&(r=!1)}n=!n&&"\\"==t}}function i(e,t,n){return xe=e,Ae=n,t}function a(e,n){var r=e.next();if('"'==r||"'"==r)return n.tokenize=s(r),n.tokenize(e,n);if("."==r&&e.match(/^\d+(?:[eE][+\-]?\d+)?/))return i("number","number");if("."==r&&e.match(".."))return i("spread","meta");if(/[\[\]{}\(\),;\:\.]/.test(r))return i(r);if("="==r&&e.eat(">"))return i("=>","operator");if("0"==r&&e.eat(/x/i))return e.eatWhile(/[\da-f]/i),i("number","number");if("0"==r&&e.eat(/o/i))return e.eatWhile(/[0-7]/i),i("number","number");if("0"==r&&e.eat(/b/i))return e.eatWhile(/[01]/i),i("number","number");if(/\d/.test(r))return e.match(/^\d*(?:\.\d*)?(?:[eE][+\-]?\d+)?/),i("number","number");if("/"==r)return e.eat("*")?(n.tokenize=u,u(e,n)):e.eat("/")?(e.skipToEnd(),i("comment","comment")):t(e,n,1)?(o(e),e.match(/^\b(([gimyu])(?![gimyu]*\2))+\b/),i("regexp","string-2")):(e.eatWhile(Me),i("operator","operator",e.current()));if("`"==r)return n.tokenize=l,l(e,n);if("#"==r)return e.skipToEnd(),i("error","error");if(Me.test(r))return e.eatWhile(Me),i("operator","operator",e.current());if(Ee.test(r)){e.eatWhile(Ee);var a=e.current(),c=Ne.propertyIsEnumerable(a)&&Ne[a];return c&&"."!=n.lastType?i(c.type,c.style,a):i("variable","variable",a)}}function s(e){return function(t,n){var r,o=!1;if(Pe&&"@"==t.peek()&&t.match(Se))return n.tokenize=a,i("jsonld-keyword","meta");for(;null!=(r=t.next())&&(r!=e||o);)o=!o&&"\\"==r;return o||(n.tokenize=a),i("string","string")}}function u(e,t){for(var n,r=!1;n=e.next();){if("/"==n&&r){t.tokenize=a;break}r="*"==n}return i("comment","comment")}function l(e,t){for(var n,r=!1;null!=(n=e.next());){if(!r&&("`"==n||"$"==n&&e.eat("{"))){t.tokenize=a;break}r=!r&&"\\"==n}return i("quasi","string-2",e.current())}function c(e,t){t.fatArrowAt&&(t.fatArrowAt=null);var n=e.string.indexOf("=>",e.start);if(!(0>n)){for(var r=0,o=!1,i=n-1;i>=0;--i){var a=e.string.charAt(i),s=Oe.indexOf(a);if(s>=0&&3>s){if(!r){++i;break}if(0==--r)break}else if(s>=3&&6>s)++r;else if(Ee.test(a))o=!0;else{if(/["'\/]/.test(a))return;if(o&&!r){++i;break}}}o&&!r&&(t.fatArrowAt=i)}}function f(e,t,n,r,o,i){this.indented=e,this.column=t,this.type=n,this.prev=o,this.info=i,null!=r&&(this.align=r)}function d(e,t){for(var n=e.localVars;n;n=n.next)if(n.name==t)return!0;for(var r=e.context;r;r=r.prev)for(var n=r.vars;n;n=n.next)if(n.name==t)return!0}function p(e,t,n,r,o){var i=e.cc;for(je.state=e,je.stream=o,je.marked=null,je.cc=i,je.style=t,e.lexical.hasOwnProperty("align")||(e.lexical.align=!0);;){var a=i.length?i.pop():Ce?k:w;if(a(n,r)){for(;i.length&&i[i.length-1].lex;)i.pop()();return je.marked?je.marked:"variable"==n&&d(e,r)?"variable-2":t}}}function h(){for(var e=arguments.length-1;e>=0;e--)je.cc.push(arguments[e])}function m(){return h.apply(null,arguments),!0}function v(e){function t(t){for(var n=t;n;n=n.next)if(n.name==e)return!0;return!1}var n=je.state;if(je.marked="def",n.context){if(t(n.localVars))return;n.localVars={name:e,next:n.localVars}}else{if(t(n.globalVars))return;r.globalVars&&(n.globalVars={name:e,next:n.globalVars})}}function g(){je.state.context={prev:je.state.context,vars:je.state.localVars},je.state.localVars=Re}function y(){je.state.localVars=je.state.context.vars,je.state.context=je.state.context.prev}function b(e,t){var n=function(){var n=je.state,r=n.indented;if("stat"==n.lexical.type)r=n.lexical.indented;else for(var o=n.lexical;o&&")"==o.type&&o.align;o=o.prev)r=o.indented;n.lexical=new f(r,je.stream.column(),e,null,n.lexical,t)};return n.lex=!0,n}function x(){var e=je.state;e.lexical.prev&&(")"==e.lexical.type&&(e.indented=e.lexical.indented),e.lexical=e.lexical.prev)}function A(e){function t(n){return n==e?m():";"==e?h():m(t)}return t}function w(e,t){return"var"==e?m(b("vardef",t.length),J,A(";"),x):"keyword a"==e?m(b("form"),k,w,x):"keyword b"==e?m(b("form"),w,x):"{"==e?m(b("}"),V,x):";"==e?m():"if"==e?("else"==je.state.lexical.info&&je.state.cc[je.state.cc.length-1]==x&&je.state.cc.pop()(),m(b("form"),k,w,x,$)):"function"==e?m(ie):"for"==e?m(b("form"),ee,w,x):"variable"==e?m(b("stat"),z):"switch"==e?m(b("form"),k,b("}","switch"),A("{"),V,x,x):"case"==e?m(k,A(":")):"default"==e?m(A(":")):"catch"==e?m(b("form"),g,A("("),ae,A(")"),w,x,y):"class"==e?m(b("form"),se,x):"export"==e?m(b("stat"),fe,x):"import"==e?m(b("stat"),de,x):"module"==e?m(b("form"),K,b("}"),A("{"),V,x,x):h(b("stat"),k,A(";"),x)}function k(e){return C(e,!1)}function P(e){return C(e,!0)}function C(e,t){if(je.state.fatArrowAt==je.stream.start){var n=t?j:L;if("("==e)return m(g,b(")"),U(K,")"),x,A("=>"),n,y);if("variable"==e)return h(g,K,A("=>"),n,y)}var r=t?M:N;return Le.hasOwnProperty(e)?m(r):"function"==e?m(ie,r):"keyword c"==e?m(t?E:T):"("==e?m(b(")"),T,ye,A(")"),x,r):"operator"==e||"spread"==e?m(t?P:k):"["==e?m(b("]"),ve,x,r):"{"==e?X(W,"}",null,r):"quasi"==e?h(S,r):"new"==e?m(R(t)):m()}function T(e){return e.match(/[;\}\)\],]/)?h():h(k)}function E(e){return e.match(/[;\}\)\],]/)?h():h(P)}function N(e,t){return","==e?m(k):M(e,t,!1)}function M(e,t,n){var r=0==n?N:M,o=0==n?k:P;return"=>"==e?m(g,n?j:L,y):"operator"==e?/\+\+|--/.test(t)?m(r):"?"==t?m(k,A(":"),o):m(o):"quasi"==e?h(S,r):";"!=e?"("==e?X(P,")","call",r):"."==e?m(H,r):"["==e?m(b("]"),T,A("]"),x,r):void 0:void 0}function S(e,t){return"quasi"!=e?h():"${"!=t.slice(t.length-2)?m(S):m(k,O)}function O(e){return"}"==e?(je.marked="string-2",je.state.tokenize=l,m(S)):void 0}function L(e){return c(je.stream,je.state),h("{"==e?w:k)}function j(e){return c(je.stream,je.state),h("{"==e?w:P)}function R(e){return function(t){return"."==t?m(e?I:D):h(e?P:k)}}function D(e,t){return"target"==t?(je.marked="keyword",m(N)):void 0}function I(e,t){return"target"==t?(je.marked="keyword",m(M)):void 0}function z(e){return":"==e?m(x,w):h(N,A(";"),x)}function H(e){return"variable"==e?(je.marked="property",m()):void 0}function W(e,t){return"variable"==e||"keyword"==je.style?(je.marked="property",m("get"==t||"set"==t?F:q)):"number"==e||"string"==e?(je.marked=Pe?"property":je.style+" property",m(q)):"jsonld-keyword"==e?m(q):"modifier"==e?m(W):"["==e?m(k,A("]"),q):"spread"==e?m(k):void 0}function F(e){return"variable"!=e?h(q):(je.marked="property",m(ie))}function q(e){return":"==e?m(P):"("==e?h(ie):void 0}function U(e,t){function n(r){if(","==r){var o=je.state.lexical;return"call"==o.info&&(o.pos=(o.pos||0)+1),m(e,n)}return r==t?m():m(A(t))}return function(r){return r==t?m():h(e,n)}}function X(e,t,n){for(var r=3;r!?|~^]/,Se=/^@(context|id|value|language|type|container|list|set|reverse|index|base|vocab|graph)"/,Oe="([{}])",Le={atom:!0,number:!0,variable:!0,string:!0,regexp:!0,"this":!0,"jsonld-keyword":!0},je={state:null,column:null,marked:null,cc:null},Re={name:"this",next:{name:"arguments"}};return x.lex=!0,{startState:function(e){var t={tokenize:a,lastType:"sof",cc:[],lexical:new f((e||0)-we,0,"block",!1),localVars:r.localVars,context:r.localVars&&{vars:r.localVars},indented:e||0};return r.globalVars&&"object"==typeof r.globalVars&&(t.globalVars=r.globalVars),t},token:function(e,t){if(e.sol()&&(t.lexical.hasOwnProperty("align")||(t.lexical.align=!1),t.indented=e.indentation(),c(e,t)),t.tokenize!=u&&e.eatSpace())return null;var n=t.tokenize(e,t);return"comment"==xe?n:(t.lastType="operator"!=xe||"++"!=Ae&&"--"!=Ae?xe:"incdec",p(t,n,xe,Ae,e))},indent:function(t,n){if(t.tokenize==u)return e.Pass;if(t.tokenize!=a)return 0;var o=n&&n.charAt(0),i=t.lexical;if(!/^\s*else\b/.test(n))for(var s=t.cc.length-1;s>=0;--s){var l=t.cc[s];if(l==x)i=i.prev;else if(l!=$)break}"stat"==i.type&&"}"==o&&(i=i.prev),ke&&")"==i.type&&"stat"==i.prev.type&&(i=i.prev);var c=i.type,f=o==c;return"vardef"==c?i.indented+("operator"==t.lastType||","==t.lastType?i.info+1:0):"form"==c&&"{"==o?i.indented:"form"==c?i.indented+we:"stat"==c?i.indented+(be(t,n)?ke||we:0):"switch"!=i.info||f||0==r.doubleIndentSwitch?i.align?i.column+(f?0:1):i.indented+(f?0:we):i.indented+(/^(?:case|default)\b/.test(n)?we:2*we)},electricInput:/^\s*(?:case .*?:|default:|\{|\})$/,blockCommentStart:Ce?null:"/*",blockCommentEnd:Ce?null:"*/",lineComment:Ce?null:"//",fold:"brace",closeBrackets:"()[]{}''\"\"``",helperType:Ce?"json":"javascript",jsonldMode:Pe,jsonMode:Ce,expressionAllowed:t,skipExpression:function(e){var t=e.cc[e.cc.length-1];t!=k&&t!=P||e.cc.pop()}}}),e.registerHelper("wordChars","javascript",/[\w$]/),e.defineMIME("text/javascript","javascript"),e.defineMIME("text/ecmascript","javascript"),e.defineMIME("application/javascript","javascript"),e.defineMIME("application/x-javascript","javascript"),e.defineMIME("application/ecmascript","javascript"),e.defineMIME("application/json",{name:"javascript",json:!0}),e.defineMIME("application/x-json",{name:"javascript",json:!0}),e.defineMIME("application/ld+json",{name:"javascript",jsonld:!0}),e.defineMIME("text/typescript",{name:"javascript",typescript:!0}),e.defineMIME("application/typescript",{name:"javascript",typescript:!0})})},function(e,t,n){!function(e){e(n(18),n(180),n(179))}(function(e){"use strict";e.defineMode("markdown",function(t,n){function r(n){if(e.findModeByName){var r=e.findModeByName(n);r&&(n=r.mime||r.mimes[0])}var o=e.getMode(t,n);return"null"==o.name?null:o}function o(e,t,n){return t.f=t.inline=n,n(e,t)}function i(e,t,n){return t.f=t.block=n,n(e,t)}function a(e){return!e||!/\S/.test(e.string)}function s(e){return e.linkTitle=!1,e.em=!1,e.strong=!1,e.strikethrough=!1,e.quote=0,e.indentedCode=!1,k&&e.f==l&&(e.f=h,e.block=u),e.trailingSpace=0,e.trailingSpaceNewLine=!1,e.prevLine=e.thisLine,e.thisLine=null,null}function u(e,t){var i=e.sol(),s=t.list!==!1,u=t.indentedCode;t.indentedCode=!1,s&&(t.indentationDiff>=0?(t.indentationDiff<4&&(t.indentation-=t.indentationDiff),t.list=null):t.indentation>0?t.list=null:t.list=!1);var l=null;if(t.indentationDiff>=4)return e.skipToEnd(),u||a(t.prevLine)?(t.indentation-=4,t.indentedCode=!0,P.code):null;if(e.eatSpace())return null;if((l=e.match(S))&&l[1].length<=6)return t.header=l[1].length,n.highlightFormatting&&(t.formatting="header"),t.f=t.inline,d(t);if(!(a(t.prevLine)||t.quote||s||u)&&(l=e.match(O)))return t.header="="==l[0].charAt(0)?1:2,n.highlightFormatting&&(t.formatting="header"),t.f=t.inline,d(t);if(e.eat(">"))return t.quote=i?1:t.quote+1,n.highlightFormatting&&(t.formatting="quote"),e.eatSpace(),d(t);if("["===e.peek())return o(e,t,y);if(e.match(T,!0))return t.hr=!0,P.hr;if((a(t.prevLine)||s)&&(e.match(E,!1)||e.match(N,!1))){var f=null;for(e.match(E,!0)?f="ul":(e.match(N,!0),f="ol"),t.indentation=e.column()+e.current().length,t.list=!0;t.listStack&&e.column()")>-1)&&(n.f=h,n.block=u,n.htmlState=null)}return r}function c(e,t){return t.fencedChars&&e.match(t.fencedChars,!1)?(t.localMode=t.localState=null,t.f=t.block=f,null):t.localMode?t.localMode.token(e,t.localState):(e.skipToEnd(),P.code)}function f(e,t){e.match(t.fencedChars),t.block=u,t.f=h,t.fencedChars=null,n.highlightFormatting&&(t.formatting="code-block"),t.code=1;var r=d(t);return t.code=0,r}function d(e){var t=[];if(e.formatting){t.push(P.formatting),"string"==typeof e.formatting&&(e.formatting=[e.formatting]);for(var r=0;r=e.quote?t.push(P.formatting+"-"+e.formatting[r]+"-"+e.quote):t.push("error"))}if(e.taskOpen)return t.push("meta"),t.length?t.join(" "):null;if(e.taskClosed)return t.push("property"),t.length?t.join(" "):null;if(e.linkHref?t.push(P.linkHref,"url"):(e.strong&&t.push(P.strong),e.em&&t.push(P.em),e.strikethrough&&t.push(P.strikethrough),e.linkText&&t.push(P.linkText),e.code&&t.push(P.code)),e.header&&t.push(P.header,P.header+"-"+e.header),e.quote&&(t.push(P.quote),!n.maxBlockquoteDepth||n.maxBlockquoteDepth>=e.quote?t.push(P.quote+"-"+e.quote):t.push(P.quote+"-"+n.maxBlockquoteDepth)),e.list!==!1){var o=(e.listStack.length-1)%3;o?1===o?t.push(P.list2):t.push(P.list3):t.push(P.list1)}return e.trailingSpaceNewLine?t.push("trailing-space-new-line"):e.trailingSpace&&t.push("trailing-space-"+(e.trailingSpace%2?"a":"b")),t.length?t.join(" "):null}function p(e,t){return e.match(L,!0)?d(t):void 0}function h(t,r){var o=r.text(t,r);if("undefined"!=typeof o)return o;if(r.list)return r.list=null,d(r);if(r.taskList){var a="x"!==t.match(M,!0)[1];return a?r.taskOpen=!0:r.taskClosed=!0,n.highlightFormatting&&(r.formatting="task"),r.taskList=!1,d(r)}if(r.taskOpen=!1,r.taskClosed=!1,r.header&&t.match(/^#+$/,!0))return n.highlightFormatting&&(r.formatting="header"),d(r);var s=t.sol(),u=t.next();if(r.linkTitle){r.linkTitle=!1;var c=u;"("===u&&(c=")"),c=(c+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1");var f="^\\s*(?:[^"+c+"\\\\]+|\\\\\\\\|\\\\.)"+c;if(t.match(new RegExp(f),!0))return P.linkHref}if("`"===u){var p=r.formatting;n.highlightFormatting&&(r.formatting="code"),t.eatWhile("`");var h=t.current().length;if(0==r.code)return r.code=h,d(r);if(h==r.code){var g=d(r);return r.code=0,g}return r.formatting=p,d(r)}if(r.code)return d(r);if("\\"===u&&(t.next(),n.highlightFormatting)){var y=d(r),b=P.formatting+"-escape";return y?y+" "+b:b}if("!"===u&&t.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return t.match(/\[[^\]]*\]/),r.inline=r.f=v,P.image;if("["===u&&t.match(/.*\](\(.*\)| ?\[.*\])/,!1))return r.linkText=!0,n.highlightFormatting&&(r.formatting="link"),d(r);if("]"===u&&r.linkText&&t.match(/\(.*\)| ?\[.*\]/,!1)){n.highlightFormatting&&(r.formatting="link");var y=d(r);return r.linkText=!1,r.inline=r.f=v,y}if("<"===u&&t.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=m,n.highlightFormatting&&(r.formatting="link");var y=d(r);return y?y+=" ":y="",y+P.linkInline}if("<"===u&&t.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){r.f=r.inline=m,n.highlightFormatting&&(r.formatting="link");var y=d(r);return y?y+=" ":y="",y+P.linkEmail}if("<"===u&&t.match(/^(!--|\w)/,!1)){var x=t.string.indexOf(">",t.pos);if(-1!=x){var A=t.string.substring(t.start,x);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(A)&&(r.md_inside=!0)}return t.backUp(1),r.htmlState=e.startState(w),i(t,r,l)}if("<"===u&&t.match(/^\/\w*?>/))return r.md_inside=!1,"tag";var k=!1;if(!n.underscoresBreakWords&&"_"===u&&"_"!==t.peek()&&t.match(/(\w)/,!1)){var C=t.pos-2;if(C>=0){var T=t.string.charAt(C);"_"!==T&&T.match(/(\w)/,!1)&&(k=!0)}}if("*"===u||"_"===u&&!k)if(s&&" "===t.peek());else{if(r.strong===u&&t.eat(u)){n.highlightFormatting&&(r.formatting="strong");var g=d(r);return r.strong=!1,g}if(!r.strong&&t.eat(u))return r.strong=u,n.highlightFormatting&&(r.formatting="strong"),d(r);if(r.em===u){n.highlightFormatting&&(r.formatting="em");var g=d(r);return r.em=!1,g}if(!r.em)return r.em=u,n.highlightFormatting&&(r.formatting="em"),d(r)}else if(" "===u&&(t.eat("*")||t.eat("_"))){if(" "===t.peek())return d(r);t.backUp(1)}if(n.strikethrough)if("~"===u&&t.eatWhile(u)){if(r.strikethrough){n.highlightFormatting&&(r.formatting="strikethrough");var g=d(r);return r.strikethrough=!1,g}if(t.match(/^[^\s]/,!1))return r.strikethrough=!0,n.highlightFormatting&&(r.formatting="strikethrough"),d(r)}else if(" "===u&&t.match(/^~~/,!0)){if(" "===t.peek())return d(r);t.backUp(2)}return" "===u&&(t.match(/ +$/,!1)?r.trailingSpace++:r.trailingSpace&&(r.trailingSpaceNewLine=!0)),d(r)}function m(e,t){var r=e.next();if(">"===r){t.f=t.inline=h,n.highlightFormatting&&(t.formatting="link");var o=d(t);return o?o+=" ":o="",o+P.linkInline}return e.match(/^[^>]+/,!0),P.linkInline}function v(e,t){if(e.eatSpace())return null;var r=e.next();return"("===r||"["===r?(t.f=t.inline=g("("===r?")":"]"),n.highlightFormatting&&(t.formatting="link-string"),t.linkHref=!0,d(t)):"error"}function g(e){return function(t,r){var o=t.next();if(o===e){r.f=r.inline=h,n.highlightFormatting&&(r.formatting="link-string");var i=d(r);return r.linkHref=!1,i}return t.match(A(e),!0)&&t.backUp(1),r.linkHref=!0,d(r)}}function y(e,t){return e.match(/^([^\]\\]|\\.)*\]:/,!1)?(t.f=b,e.next(),n.highlightFormatting&&(t.formatting="link"),t.linkText=!0,d(t)):o(e,t,h)}function b(e,t){if(e.match(/^\]:/,!0)){t.f=t.inline=x,n.highlightFormatting&&(t.formatting="link");var r=d(t);return t.linkText=!1,r}return e.match(/^([^\]\\]|\\.)+/,!0),P.linkText}function x(e,t){return e.eatSpace()?null:(e.match(/^[^\s]+/,!0),void 0===e.peek()?t.linkTitle=!0:e.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),t.f=t.inline=h,P.linkHref+" url")}function A(e){return R[e]||(e=(e+"").replace(/([.?*+^$[\]\\(){}|-])/g,"\\$1"),R[e]=new RegExp("^(?:[^\\\\]|\\\\.)*?("+e+")")),R[e]}var w=e.getMode(t,"text/html"),k="null"==w.name;void 0===n.highlightFormatting&&(n.highlightFormatting=!1),void 0===n.maxBlockquoteDepth&&(n.maxBlockquoteDepth=0),void 0===n.underscoresBreakWords&&(n.underscoresBreakWords=!0),void 0===n.taskLists&&(n.taskLists=!1),void 0===n.strikethrough&&(n.strikethrough=!1),void 0===n.tokenTypeOverrides&&(n.tokenTypeOverrides={});var P={header:"header",code:"comment",quote:"quote",list1:"variable-2",list2:"variable-3",list3:"keyword",hr:"hr",image:"tag",formatting:"formatting",linkInline:"link",linkEmail:"link",linkText:"link",linkHref:"string",em:"em",strong:"strong",strikethrough:"strikethrough"};for(var C in P)P.hasOwnProperty(C)&&n.tokenTypeOverrides[C]&&(P[C]=n.tokenTypeOverrides[C]);var T=/^([*\-_])(?:\s*\1){2,}\s*$/,E=/^[*\-+]\s+/,N=/^[0-9]+([.)])\s+/,M=/^\[(x| )\](?=\s)/,S=n.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,O=/^ *(?:\={1,}|-{1,})\s*$/,L=/^[^#!\[\]*_\\<>` "'(~]+/,j=new RegExp("^("+(n.fencedCodeBlocks===!0?"~~~+|```+":n.fencedCodeBlocks)+")[ \\t]*([\\w+#-]*)"),R=[],D={startState:function(){return{f:u,prevLine:null,thisLine:null,block:u,htmlState:null,indentation:0,inline:h,text:p,formatting:!1,linkText:!1,linkHref:!1,linkTitle:!1,code:0,em:!1,strong:!1,header:0,hr:!1,taskList:!1,list:!1,listStack:[],quote:0,trailingSpace:0,trailingSpaceNewLine:!1,strikethrough:!1,fencedChars:null}},copyState:function(t){return{f:t.f,prevLine:t.prevLine,thisLine:t.thisLine,block:t.block,htmlState:t.htmlState&&e.copyState(w,t.htmlState),indentation:t.indentation,localMode:t.localMode,localState:t.localMode?e.copyState(t.localMode,t.localState):null,inline:t.inline,text:t.text,formatting:!1,linkTitle:t.linkTitle,code:t.code,em:t.em,strong:t.strong,strikethrough:t.strikethrough,header:t.header,hr:t.hr,taskList:t.taskList,list:t.list,listStack:t.listStack.slice(0),quote:t.quote,indentedCode:t.indentedCode,trailingSpace:t.trailingSpace,trailingSpaceNewLine:t.trailingSpaceNewLine,md_inside:t.md_inside,fencedChars:t.fencedChars}},token:function(e,t){if(t.formatting=!1,e!=t.thisLine){var n=t.header||t.hr;if(t.header=0,t.hr=!1,e.match(/^\s*$/,!0)||n){if(s(t),!n)return null;t.prevLine=null}t.prevLine=t.thisLine,t.thisLine=e,t.taskList=!1,t.trailingSpace=0,t.trailingSpaceNewLine=!1,t.f=t.block;var r=e.match(/^\s*/,!0)[0].replace(/\t/g," ").length;if(t.indentationDiff=Math.min(r-t.indentation,4),t.indentation=t.indentation+t.indentationDiff,r>0)return null}return t.f(e,t)},innerMode:function(e){return e.block==l?{state:e.htmlState,mode:w}:e.localState?{state:e.localState,mode:e.localMode}:{state:e,mode:D}},blankLine:s,getType:d,fold:"markdown"};return D},"xml"),e.defineMIME("text/x-markdown","markdown")})},function(e,t,n){!function(e){e(n(18))}(function(e){"use strict";e.modeInfo=[{name:"APL",mime:"text/apl",mode:"apl",ext:["dyalog","apl"]},{name:"PGP",mimes:["application/pgp","application/pgp-keys","application/pgp-signature"],mode:"asciiarmor",ext:["pgp"]},{name:"ASN.1",mime:"text/x-ttcn-asn",mode:"asn.1",ext:["asn","asn1"]},{name:"Asterisk",mime:"text/x-asterisk",mode:"asterisk",file:/^extensions\.conf$/i},{name:"Brainfuck",mime:"text/x-brainfuck",mode:"brainfuck",ext:["b","bf"]},{name:"C",mime:"text/x-csrc",mode:"clike",ext:["c","h"]},{name:"C++",mime:"text/x-c++src",mode:"clike",ext:["cpp","c++","cc","cxx","hpp","h++","hh","hxx"],alias:["cpp"]},{name:"Cobol",mime:"text/x-cobol",mode:"cobol",ext:["cob","cpy"]},{name:"C#",mime:"text/x-csharp",mode:"clike",ext:["cs"],alias:["csharp"]},{name:"Clojure",mime:"text/x-clojure",mode:"clojure",ext:["clj","cljc","cljx"]},{name:"ClojureScript",mime:"text/x-clojurescript",mode:"clojure",ext:["cljs"]},{name:"Closure Stylesheets (GSS)",mime:"text/x-gss",mode:"css",ext:["gss"]},{name:"CMake",mime:"text/x-cmake",mode:"cmake",ext:["cmake","cmake.in"],file:/^CMakeLists.txt$/},{name:"CoffeeScript",mime:"text/x-coffeescript",mode:"coffeescript",ext:["coffee"],alias:["coffee","coffee-script"]},{name:"Common Lisp",mime:"text/x-common-lisp",mode:"commonlisp",ext:["cl","lisp","el"],alias:["lisp"]},{name:"Cypher",mime:"application/x-cypher-query",mode:"cypher",ext:["cyp","cypher"]},{name:"Cython",mime:"text/x-cython",mode:"python",ext:["pyx","pxd","pxi"]},{name:"Crystal",mime:"text/x-crystal",mode:"crystal",ext:["cr"]},{name:"CSS",mime:"text/css",mode:"css",ext:["css"]},{name:"CQL",mime:"text/x-cassandra",mode:"sql",ext:["cql"]},{name:"D",mime:"text/x-d",mode:"d",ext:["d"]},{name:"Dart",mimes:["application/dart","text/x-dart"],mode:"dart",ext:["dart"]},{name:"diff",mime:"text/x-diff",mode:"diff",ext:["diff","patch"]},{name:"Django",mime:"text/x-django",mode:"django"},{name:"Dockerfile",mime:"text/x-dockerfile",mode:"dockerfile",file:/^Dockerfile$/},{name:"DTD",mime:"application/xml-dtd",mode:"dtd",ext:["dtd"]},{name:"Dylan",mime:"text/x-dylan",mode:"dylan",ext:["dylan","dyl","intr"]},{name:"EBNF",mime:"text/x-ebnf",mode:"ebnf"},{name:"ECL",mime:"text/x-ecl",mode:"ecl",ext:["ecl"]},{name:"edn",mime:"application/edn",mode:"clojure",ext:["edn"]},{name:"Eiffel",mime:"text/x-eiffel",mode:"eiffel",ext:["e"]},{name:"Elm",mime:"text/x-elm",mode:"elm",ext:["elm"]},{name:"Embedded Javascript",mime:"application/x-ejs",mode:"htmlembedded",ext:["ejs"]},{name:"Embedded Ruby",mime:"application/x-erb",mode:"htmlembedded",ext:["erb"]},{name:"Erlang",mime:"text/x-erlang",mode:"erlang",ext:["erl"]},{name:"Factor",mime:"text/x-factor",mode:"factor",ext:["factor"]},{name:"FCL",mime:"text/x-fcl",mode:"fcl"},{name:"Forth",mime:"text/x-forth",mode:"forth",ext:["forth","fth","4th"]},{name:"Fortran",mime:"text/x-fortran",mode:"fortran",ext:["f","for","f77","f90"]},{name:"F#",mime:"text/x-fsharp",mode:"mllike",ext:["fs"],alias:["fsharp"]},{name:"Gas",mime:"text/x-gas",mode:"gas",ext:["s"]},{name:"Gherkin",mime:"text/x-feature",mode:"gherkin",ext:["feature"]},{name:"GitHub Flavored Markdown",mime:"text/x-gfm",mode:"gfm",file:/^(readme|contributing|history).md$/i},{name:"Go",mime:"text/x-go",mode:"go",ext:["go"]},{name:"Groovy",mime:"text/x-groovy",mode:"groovy",ext:["groovy","gradle"]},{name:"HAML",mime:"text/x-haml",mode:"haml",ext:["haml"]},{name:"Haskell",mime:"text/x-haskell",mode:"haskell",ext:["hs"]},{name:"Haskell (Literate)",mime:"text/x-literate-haskell", +mode:"haskell-literate",ext:["lhs"]},{name:"Haxe",mime:"text/x-haxe",mode:"haxe",ext:["hx"]},{name:"HXML",mime:"text/x-hxml",mode:"haxe",ext:["hxml"]},{name:"ASP.NET",mime:"application/x-aspx",mode:"htmlembedded",ext:["aspx"],alias:["asp","aspx"]},{name:"HTML",mime:"text/html",mode:"htmlmixed",ext:["html","htm"],alias:["xhtml"]},{name:"HTTP",mime:"message/http",mode:"http"},{name:"IDL",mime:"text/x-idl",mode:"idl",ext:["pro"]},{name:"Jade",mime:"text/x-jade",mode:"jade",ext:["jade"]},{name:"Java",mime:"text/x-java",mode:"clike",ext:["java"]},{name:"Java Server Pages",mime:"application/x-jsp",mode:"htmlembedded",ext:["jsp"],alias:["jsp"]},{name:"JavaScript",mimes:["text/javascript","text/ecmascript","application/javascript","application/x-javascript","application/ecmascript"],mode:"javascript",ext:["js"],alias:["ecmascript","js","node"]},{name:"JSON",mimes:["application/json","application/x-json"],mode:"javascript",ext:["json","map"],alias:["json5"]},{name:"JSON-LD",mime:"application/ld+json",mode:"javascript",ext:["jsonld"],alias:["jsonld"]},{name:"JSX",mime:"text/jsx",mode:"jsx",ext:["jsx"]},{name:"Jinja2",mime:"null",mode:"jinja2"},{name:"Julia",mime:"text/x-julia",mode:"julia",ext:["jl"]},{name:"Kotlin",mime:"text/x-kotlin",mode:"clike",ext:["kt"]},{name:"LESS",mime:"text/x-less",mode:"css",ext:["less"]},{name:"LiveScript",mime:"text/x-livescript",mode:"livescript",ext:["ls"],alias:["ls"]},{name:"Lua",mime:"text/x-lua",mode:"lua",ext:["lua"]},{name:"Markdown",mime:"text/x-markdown",mode:"markdown",ext:["markdown","md","mkd"]},{name:"mIRC",mime:"text/mirc",mode:"mirc"},{name:"MariaDB SQL",mime:"text/x-mariadb",mode:"sql"},{name:"Mathematica",mime:"text/x-mathematica",mode:"mathematica",ext:["m","nb"]},{name:"Modelica",mime:"text/x-modelica",mode:"modelica",ext:["mo"]},{name:"MUMPS",mime:"text/x-mumps",mode:"mumps",ext:["mps"]},{name:"MS SQL",mime:"text/x-mssql",mode:"sql"},{name:"mbox",mime:"application/mbox",mode:"mbox",ext:["mbox"]},{name:"MySQL",mime:"text/x-mysql",mode:"sql"},{name:"Nginx",mime:"text/x-nginx-conf",mode:"nginx",file:/nginx.*\.conf$/i},{name:"NSIS",mime:"text/x-nsis",mode:"nsis",ext:["nsh","nsi"]},{name:"NTriples",mime:"text/n-triples",mode:"ntriples",ext:["nt"]},{name:"Objective C",mime:"text/x-objectivec",mode:"clike",ext:["m","mm"],alias:["objective-c","objc"]},{name:"OCaml",mime:"text/x-ocaml",mode:"mllike",ext:["ml","mli","mll","mly"]},{name:"Octave",mime:"text/x-octave",mode:"octave",ext:["m"]},{name:"Oz",mime:"text/x-oz",mode:"oz",ext:["oz"]},{name:"Pascal",mime:"text/x-pascal",mode:"pascal",ext:["p","pas"]},{name:"PEG.js",mime:"null",mode:"pegjs",ext:["jsonld"]},{name:"Perl",mime:"text/x-perl",mode:"perl",ext:["pl","pm"]},{name:"PHP",mime:"application/x-httpd-php",mode:"php",ext:["php","php3","php4","php5","phtml"]},{name:"Pig",mime:"text/x-pig",mode:"pig",ext:["pig"]},{name:"Plain Text",mime:"text/plain",mode:"null",ext:["txt","text","conf","def","list","log"]},{name:"PLSQL",mime:"text/x-plsql",mode:"sql",ext:["pls"]},{name:"PowerShell",mime:"application/x-powershell",mode:"powershell",ext:["ps1","psd1","psm1"]},{name:"Properties files",mime:"text/x-properties",mode:"properties",ext:["properties","ini","in"],alias:["ini","properties"]},{name:"ProtoBuf",mime:"text/x-protobuf",mode:"protobuf",ext:["proto"]},{name:"Python",mime:"text/x-python",mode:"python",ext:["BUILD","bzl","py","pyw"],file:/^(BUCK|BUILD)$/},{name:"Puppet",mime:"text/x-puppet",mode:"puppet",ext:["pp"]},{name:"Q",mime:"text/x-q",mode:"q",ext:["q"]},{name:"R",mime:"text/x-rsrc",mode:"r",ext:["r"],alias:["rscript"]},{name:"reStructuredText",mime:"text/x-rst",mode:"rst",ext:["rst"],alias:["rst"]},{name:"RPM Changes",mime:"text/x-rpm-changes",mode:"rpm"},{name:"RPM Spec",mime:"text/x-rpm-spec",mode:"rpm",ext:["spec"]},{name:"Ruby",mime:"text/x-ruby",mode:"ruby",ext:["rb"],alias:["jruby","macruby","rake","rb","rbx"]},{name:"Rust",mime:"text/x-rustsrc",mode:"rust",ext:["rs"]},{name:"SAS",mime:"text/x-sas",mode:"sas",ext:["sas"]},{name:"Sass",mime:"text/x-sass",mode:"sass",ext:["sass"]},{name:"Scala",mime:"text/x-scala",mode:"clike",ext:["scala"]},{name:"Scheme",mime:"text/x-scheme",mode:"scheme",ext:["scm","ss"]},{name:"SCSS",mime:"text/x-scss",mode:"css",ext:["scss"]},{name:"Shell",mime:"text/x-sh",mode:"shell",ext:["sh","ksh","bash"],alias:["bash","sh","zsh"],file:/^PKGBUILD$/},{name:"Sieve",mime:"application/sieve",mode:"sieve",ext:["siv","sieve"]},{name:"Slim",mimes:["text/x-slim","application/x-slim"],mode:"slim",ext:["slim"]},{name:"Smalltalk",mime:"text/x-stsrc",mode:"smalltalk",ext:["st"]},{name:"Smarty",mime:"text/x-smarty",mode:"smarty",ext:["tpl"]},{name:"Solr",mime:"text/x-solr",mode:"solr"},{name:"Soy",mime:"text/x-soy",mode:"soy",ext:["soy"],alias:["closure template"]},{name:"SPARQL",mime:"application/sparql-query",mode:"sparql",ext:["rq","sparql"],alias:["sparul"]},{name:"Spreadsheet",mime:"text/x-spreadsheet",mode:"spreadsheet",alias:["excel","formula"]},{name:"SQL",mime:"text/x-sql",mode:"sql",ext:["sql"]},{name:"Squirrel",mime:"text/x-squirrel",mode:"clike",ext:["nut"]},{name:"Swift",mime:"text/x-swift",mode:"swift",ext:["swift"]},{name:"sTeX",mime:"text/x-stex",mode:"stex"},{name:"LaTeX",mime:"text/x-latex",mode:"stex",ext:["text","ltx"],alias:["tex"]},{name:"SystemVerilog",mime:"text/x-systemverilog",mode:"verilog",ext:["v"]},{name:"Tcl",mime:"text/x-tcl",mode:"tcl",ext:["tcl"]},{name:"Textile",mime:"text/x-textile",mode:"textile",ext:["textile"]},{name:"TiddlyWiki ",mime:"text/x-tiddlywiki",mode:"tiddlywiki"},{name:"Tiki wiki",mime:"text/tiki",mode:"tiki"},{name:"TOML",mime:"text/x-toml",mode:"toml",ext:["toml"]},{name:"Tornado",mime:"text/x-tornado",mode:"tornado"},{name:"troff",mime:"text/troff",mode:"troff",ext:["1","2","3","4","5","6","7","8","9"]},{name:"TTCN",mime:"text/x-ttcn",mode:"ttcn",ext:["ttcn","ttcn3","ttcnpp"]},{name:"TTCN_CFG",mime:"text/x-ttcn-cfg",mode:"ttcn-cfg",ext:["cfg"]},{name:"Turtle",mime:"text/turtle",mode:"turtle",ext:["ttl"]},{name:"TypeScript",mime:"application/typescript",mode:"javascript",ext:["ts"],alias:["ts"]},{name:"Twig",mime:"text/x-twig",mode:"twig"},{name:"Web IDL",mime:"text/x-webidl",mode:"webidl",ext:["webidl"]},{name:"VB.NET",mime:"text/x-vb",mode:"vb",ext:["vb"]},{name:"VBScript",mime:"text/vbscript",mode:"vbscript",ext:["vbs"]},{name:"Velocity",mime:"text/velocity",mode:"velocity",ext:["vtl"]},{name:"Verilog",mime:"text/x-verilog",mode:"verilog",ext:["v"]},{name:"VHDL",mime:"text/x-vhdl",mode:"vhdl",ext:["vhd","vhdl"]},{name:"XML",mimes:["application/xml","text/xml"],mode:"xml",ext:["xml","xsl","xsd"],alias:["rss","wsdl","xsd"]},{name:"XQuery",mime:"application/xquery",mode:"xquery",ext:["xy","xquery"]},{name:"Yacas",mime:"text/x-yacas",mode:"yacas",ext:["ys"]},{name:"YAML",mime:"text/x-yaml",mode:"yaml",ext:["yaml","yml"],alias:["yml"]},{name:"Z80",mime:"text/x-z80",mode:"z80",ext:["z80"]},{name:"mscgen",mime:"text/x-mscgen",mode:"mscgen",ext:["mscgen","mscin","msc"]},{name:"xu",mime:"text/x-xu",mode:"mscgen",ext:["xu"]},{name:"msgenny",mime:"text/x-msgenny",mode:"mscgen",ext:["msgenny"]}];for(var t=0;t-1&&t.substring(o+1,t.length);return i?e.findModeByExtension(i):void 0},e.findModeByName=function(t){t=t.toLowerCase();for(var n=0;n")):null:e.match("--")?n(u("comment","-->")):e.match("DOCTYPE",!0,!0)?(e.eatWhile(/[\w\._\-]/),n(l(1))):null:e.eat("?")?(e.eatWhile(/[\w\._\-]/),t.tokenize=u("meta","?>"),"meta"):(T=e.eat("/")?"closeTag":"openTag",t.tokenize=a,"tag bracket");if("&"==r){var o;return o=e.eat("#")?e.eat("x")?e.eatWhile(/[a-fA-F\d]/)&&e.eat(";"):e.eatWhile(/[\d]/)&&e.eat(";"):e.eatWhile(/[\w\.\-:]/)&&e.eat(";"),o?"atom":"error"}return e.eatWhile(/[^&<]/),null}function a(e,t){var n=e.next();if(">"==n||"/"==n&&e.eat(">"))return t.tokenize=i,T=">"==n?"endTag":"selfcloseTag","tag bracket";if("="==n)return T="equals",null;if("<"==n){t.tokenize=i,t.state=p,t.tagName=t.tagStart=null;var r=t.tokenize(e,t);return r?r+" tag error":"tag error"}return/[\'\"]/.test(n)?(t.tokenize=s(n),t.stringStartCol=e.column(),t.tokenize(e,t)):(e.match(/^[^\s\u00a0=<>\"\']*[^\s\u00a0=<>\"\'\/]/),"word")}function s(e){var t=function(t,n){for(;!t.eol();)if(t.next()==e){n.tokenize=a;break}return"string"};return t.isInAttribute=!0,t}function u(e,t){return function(n,r){for(;!n.eol();){if(n.match(t)){r.tokenize=i;break}n.next()}return e}}function l(e){return function(t,n){for(var r;null!=(r=t.next());){if("<"==r)return n.tokenize=l(e+1),n.tokenize(t,n);if(">"==r){if(1==e){n.tokenize=i;break}return n.tokenize=l(e-1),n.tokenize(t,n)}}return"meta"}}function c(e,t,n){this.prev=e.context,this.tagName=t,this.indent=e.indented,this.startOfLine=n,(k.doNotIndent.hasOwnProperty(t)||e.context&&e.context.noIndent)&&(this.noIndent=!0)}function f(e){e.context&&(e.context=e.context.prev)}function d(e,t){for(var n;;){if(!e.context)return;if(n=e.context.tagName,!k.contextGrabbers.hasOwnProperty(n)||!k.contextGrabbers[n].hasOwnProperty(t))return;f(e)}}function p(e,t,n){return"openTag"==e?(n.tagStart=t.column(),h):"closeTag"==e?m:p}function h(e,t,n){return"word"==e?(n.tagName=t.current(),E="tag",y):(E="error",h)}function m(e,t,n){if("word"==e){var r=t.current();return n.context&&n.context.tagName!=r&&k.implicitlyClosed.hasOwnProperty(n.context.tagName)&&f(n),n.context&&n.context.tagName==r||k.matchClosing===!1?(E="tag",v):(E="tag error",g)}return E="error",g}function v(e,t,n){return"endTag"!=e?(E="error",v):(f(n),p)}function g(e,t,n){return E="error",v(e,t,n)}function y(e,t,n){if("word"==e)return E="attribute",b;if("endTag"==e||"selfcloseTag"==e){var r=n.tagName,o=n.tagStart;return n.tagName=n.tagStart=null,"selfcloseTag"==e||k.autoSelfClosers.hasOwnProperty(r)?d(n,r):(d(n,r),n.context=new c(n,r,o==n.indented)),p}return E="error",y}function b(e,t,n){return"equals"==e?x:(k.allowMissing||(E="error"),y(e,t,n))}function x(e,t,n){return"string"==e?A:"word"==e&&k.allowUnquoted?(E="string",y):(E="error",y(e,t,n))}function A(e,t,n){return"string"==e?A:y(e,t,n)}var w=r.indentUnit,k={},P=o.htmlMode?t:n;for(var C in P)k[C]=P[C];for(var C in o)k[C]=o[C];var T,E;return i.isInText=!0,{startState:function(e){var t={tokenize:i,state:p,indented:e||0,tagName:null,tagStart:null,context:null};return null!=e&&(t.baseIndent=e),t},token:function(e,t){if(!t.tagName&&e.sol()&&(t.indented=e.indentation()),e.eatSpace())return null;T=null;var n=t.tokenize(e,t);return(n||T)&&"comment"!=n&&(E=null,t.state=t.state(T||n,e,t),E&&(n="error"==E?n+" error":E)),n},indent:function(t,n,r){var o=t.context;if(t.tokenize.isInAttribute)return t.tagStart==t.indented?t.stringStartCol+1:t.indented+w;if(o&&o.noIndent)return e.Pass;if(t.tokenize!=a&&t.tokenize!=i)return r?r.match(/^(\s*)/)[0].length:0;if(t.tagName)return k.multilineTagIndentPastTag!==!1?t.tagStart+t.tagName.length+2:t.tagStart+w*(k.multilineTagIndentFactor||1);if(k.alignCDATA&&/$/,blockCommentStart:"",configuration:k.htmlMode?"html":"xml",helperType:k.htmlMode?"html":"xml",skipAttribute:function(e){e.state==x&&(e.state=y)}}}),e.defineMIME("text/xml","xml"),e.defineMIME("application/xml","xml"),e.mimeModes.hasOwnProperty("text/html")||e.defineMIME("text/html",{name:"xml",htmlMode:!0})})},function(e,t,n){"use strict";function r(e){return!(!e||!l[e.nodeName])}function o(e){return!(!e||!u[e.nodeName])}function i(e,t){if(e.firstChild&&"PRE"!==e.nodeName){"function"!=typeof t&&(t=r);for(var n=null,i=!1,u=null,l=s(u,e);l!==e;){if(3===l.nodeType){var c=l.data.replace(/[ \r\n\t]+/g," ");if(n&&!/ $/.test(n.data)||i||" "!==c[0]||(c=c.substr(1)),!c){l=a(l);continue}l.data=c,n=l}else{if(1!==l.nodeType){l=a(l);continue}t(l)||"BR"===l.nodeName?(n&&(n.data=n.data.replace(/ $/,"")),n=null,i=!1):o(l)&&(n=null,i=!0)}var f=s(u,l);u=l,l=f}n&&(n.data=n.data.replace(/ $/,""),n.data||a(n))}}function a(e){var t=e.nextSibling||e.parentNode;return e.parentNode.removeChild(e),t}function s(e,t){return e&&e.parentNode===t||"PRE"===t.nodeName?t.nextSibling||t.parentNode:t.firstChild||t.nextSibling||t.parentNode}var u=n(362);Object.keys(u).forEach(function(e){u[e.toUpperCase()]=1});var l={};n(171).forEach(function(e){l[e.toUpperCase()]=1}),e.exports=i},function(e,t,n){t=e.exports=n(7)(),t.push([e.id,"@-webkit-keyframes medium-editor__medium-editor-image-loading___aVZNE{0%{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:scale(1);transform:scale(1)}}@keyframes medium-editor__medium-editor-image-loading___aVZNE{0%{-webkit-transform:scale(0);transform:scale(0)}to{-webkit-transform:scale(1);transform:scale(1)}}@-webkit-keyframes medium-editor__medium-editor-pop-upwards___nG1K8{0%{opacity:0;-webkit-transform:matrix(.97,0,0,1,0,12);transform:matrix(.97,0,0,1,0,12)}20%{opacity:.7;-webkit-transform:matrix(.99,0,0,1,0,2);transform:matrix(.99,0,0,1,0,2)}40%{opacity:1;-webkit-transform:matrix(1,0,0,1,0,-1);transform:matrix(1,0,0,1,0,-1)}to{-webkit-transform:matrix(1,0,0,1,0,0);transform:matrix(1,0,0,1,0,0)}}@keyframes medium-editor__medium-editor-pop-upwards___nG1K8{0%{opacity:0;-webkit-transform:matrix(.97,0,0,1,0,12);transform:matrix(.97,0,0,1,0,12)}20%{opacity:.7;-webkit-transform:matrix(.99,0,0,1,0,2);transform:matrix(.99,0,0,1,0,2)}40%{opacity:1;-webkit-transform:matrix(1,0,0,1,0,-1);transform:matrix(1,0,0,1,0,-1)}to{-webkit-transform:matrix(1,0,0,1,0,0);transform:matrix(1,0,0,1,0,0)}}.medium-editor__medium-editor-anchor-preview___1oMBD{font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:16px;left:0;line-height:1.4;max-width:280px;position:absolute;text-align:center;top:0;word-break:break-all;word-wrap:break-word;visibility:hidden;z-index:2000}.medium-editor__medium-editor-anchor-preview___1oMBD a{color:#fff;display:inline-block;margin:5px 5px 10px}.medium-editor__medium-editor-anchor-preview-active___3_7ST{visibility:visible}.medium-editor__medium-editor-dragover___3JRUt{background:#ddd}.medium-editor__medium-editor-image-loading___aVZNE{-webkit-animation:medium-editor__medium-editor-image-loading___aVZNE 1s infinite ease-in-out;animation:medium-editor__medium-editor-image-loading___aVZNE 1s infinite ease-in-out;background-color:#333;border-radius:100%;display:inline-block;height:40px;width:40px}.medium-editor__medium-editor-placeholder___24O32{position:relative}.medium-editor__medium-editor-placeholder___24O32:after{content:attr(data-placeholder)!important;font-style:italic;left:0;position:absolute;top:0;white-space:pre;padding:inherit;margin:inherit}.medium-editor__medium-toolbar-arrow-over___PcakZ:before,.medium-editor__medium-toolbar-arrow-under___3XUUU:after{border-style:solid;content:'';display:block;height:0;left:50%;margin-left:-8px;position:absolute;width:0}.medium-editor__medium-toolbar-arrow-under___3XUUU:after{border-width:8px 8px 0}.medium-editor__medium-toolbar-arrow-over___PcakZ:before{border-width:0 8px 8px;top:-8px}.medium-editor__medium-editor-toolbar___1dmfO{font-family:Helvetica Neue,Helvetica,Arial,sans-serif;font-size:16px;left:0;position:absolute;top:0;visibility:hidden;z-index:2000}.medium-editor__medium-editor-toolbar___1dmfO ul{margin:0;padding:0}.medium-editor__medium-editor-toolbar___1dmfO li{float:left;list-style:none;margin:0;padding:0}.medium-editor__medium-editor-toolbar___1dmfO li button{box-sizing:border-box;cursor:pointer;display:block;font-size:14px;line-height:1.33;margin:0;padding:15px;text-decoration:none}.medium-editor__medium-editor-toolbar___1dmfO li button:focus{outline:none}.medium-editor__medium-editor-toolbar___1dmfO li .medium-editor__medium-editor-action-underline___1sXx3{text-decoration:underline}.medium-editor__medium-editor-toolbar___1dmfO li .medium-editor__medium-editor-action-pre___lK_dd{font-family:Consolas,Liberation Mono,Menlo,Courier,monospace;font-size:12px;font-weight:100;padding:15px 0}.medium-editor__medium-editor-toolbar-active___3NHAk{visibility:visible}.medium-editor__medium-editor-sticky-toolbar___FbUM8{position:fixed;top:1px}.medium-editor__medium-editor-relative-toolbar___1O7Tq{position:relative}.medium-editor__medium-editor-toolbar-active___3NHAk.medium-editor__medium-editor-stalker-toolbar___1MMOL{-webkit-animation:medium-editor__medium-editor-pop-upwards___nG1K8 .16s forwards linear;animation:medium-editor__medium-editor-pop-upwards___nG1K8 .16s forwards linear}.medium-editor__medium-editor-action-bold___Qw1bz{font-weight:bolder}.medium-editor__medium-editor-action-italic___3amyJ{font-style:italic}.medium-editor__medium-editor-toolbar-form___D9mSQ{display:none}.medium-editor__medium-editor-toolbar-form___D9mSQ a,.medium-editor__medium-editor-toolbar-form___D9mSQ input{font-family:Helvetica Neue,Helvetica,Arial,sans-serif}.medium-editor__medium-editor-toolbar-form___D9mSQ .medium-editor__medium-editor-toolbar-form-row___1BYOS{line-height:14px;margin-left:5px;padding-bottom:5px}.medium-editor__medium-editor-toolbar-form___D9mSQ .medium-editor__medium-editor-toolbar-input___2qAlq,.medium-editor__medium-editor-toolbar-form___D9mSQ label{border:none;box-sizing:border-box;font-size:14px;margin:0;padding:6px;width:316px;display:inline-block}.medium-editor__medium-editor-toolbar-form___D9mSQ .medium-editor__medium-editor-toolbar-input___2qAlq:focus,.medium-editor__medium-editor-toolbar-form___D9mSQ label:focus{-webkit-appearance:none;-moz-appearance:none;appearance:none;border:none;box-shadow:none;outline:0}.medium-editor__medium-editor-toolbar-form___D9mSQ a{display:inline-block;font-size:24px;font-weight:bolder;margin:0 10px;text-decoration:none}.medium-editor__medium-editor-toolbar-form-active___3gu9e{display:block}.medium-editor__medium-editor-toolbar-actions___2dh50:after{clear:both;content:\"\";display:table}[data-medium-editor-element]{word-wrap:break-word;min-height:30px}[data-medium-editor-element] img{max-width:100%}[data-medium-editor-element] sub{vertical-align:sub}[data-medium-editor-element] sup{vertical-align:super}.medium-editor__medium-editor-hidden___3ZJi5{display:none}",""]),t.locals={"medium-editor-anchor-preview":"medium-editor__medium-editor-anchor-preview___1oMBD","medium-editor-anchor-preview-active":"medium-editor__medium-editor-anchor-preview-active___3_7ST","medium-editor-dragover":"medium-editor__medium-editor-dragover___3JRUt","medium-editor-image-loading":"medium-editor__medium-editor-image-loading___aVZNE","medium-editor-placeholder":"medium-editor__medium-editor-placeholder___24O32","medium-toolbar-arrow-under":"medium-editor__medium-toolbar-arrow-under___3XUUU","medium-toolbar-arrow-over":"medium-editor__medium-toolbar-arrow-over___PcakZ","medium-editor-toolbar":"medium-editor__medium-editor-toolbar___1dmfO","medium-editor-action-underline":"medium-editor__medium-editor-action-underline___1sXx3","medium-editor-action-pre":"medium-editor__medium-editor-action-pre___lK_dd","medium-editor-toolbar-active":"medium-editor__medium-editor-toolbar-active___3NHAk","medium-editor-sticky-toolbar":"medium-editor__medium-editor-sticky-toolbar___FbUM8","medium-editor-relative-toolbar":"medium-editor__medium-editor-relative-toolbar___1O7Tq","medium-editor-stalker-toolbar":"medium-editor__medium-editor-stalker-toolbar___1MMOL","medium-editor-pop-upwards":"medium-editor__medium-editor-pop-upwards___nG1K8","medium-editor-action-bold":"medium-editor__medium-editor-action-bold___Qw1bz","medium-editor-action-italic":"medium-editor__medium-editor-action-italic___3amyJ","medium-editor-toolbar-form":"medium-editor__medium-editor-toolbar-form___D9mSQ","medium-editor-toolbar-form-row":"medium-editor__medium-editor-toolbar-form-row___1BYOS","medium-editor-toolbar-input":"medium-editor__medium-editor-toolbar-input___2qAlq","medium-editor-toolbar-form-active":"medium-editor__medium-editor-toolbar-form-active___3gu9e","medium-editor-toolbar-actions":"medium-editor__medium-editor-toolbar-actions___2dh50","medium-editor-hidden":"medium-editor__medium-editor-hidden___3ZJi5"}},function(e,t,n){t=e.exports=n(7)(),t.push([e.id,".default__medium-toolbar-arrow-under___2L7yE:after{border-color:#242424 transparent transparent;top:50px}.default__medium-toolbar-arrow-over___1WSgX:before{border-color:transparent transparent #242424;top:-8px}.default__medium-editor-toolbar___scL6V{background-color:#242424;background:-webkit-linear-gradient(top,#242424,rgba(36,36,36,.75));background:linear-gradient(180deg,#242424,rgba(36,36,36,.75));border:1px solid #000;border-radius:5px;box-shadow:0 0 3px #000}.default__medium-editor-toolbar___scL6V li button{background-color:#242424;background:-webkit-linear-gradient(top,#242424,rgba(36,36,36,.89));background:linear-gradient(180deg,#242424,rgba(36,36,36,.89));border:0;border-right:1px solid #000;border-left:1px solid #333;border-left:1px solid hsla(0,0%,100%,.1);box-shadow:0 2px 2px rgba(0,0,0,.3);color:#fff;height:50px;min-width:50px;-webkit-transition:background-color .2s ease-in;transition:background-color .2s ease-in}.default__medium-editor-toolbar___scL6V li button:hover{background-color:#000;color:#ff0}.default__medium-editor-toolbar___scL6V li .default__medium-editor-button-first___3t5dl{border-bottom-left-radius:5px;border-top-left-radius:5px}.default__medium-editor-toolbar___scL6V li .default__medium-editor-button-last___1egI-{border-bottom-right-radius:5px;border-top-right-radius:5px}.default__medium-editor-toolbar___scL6V li .default__medium-editor-button-active___1NCzT{background-color:#000;background:-webkit-linear-gradient(top,#242424,rgba(0,0,0,.89));background:linear-gradient(180deg,#242424,rgba(0,0,0,.89));color:#fff}.default__medium-editor-toolbar-form___ExXvR{background:#242424;border-radius:5px;color:#999}.default__medium-editor-toolbar-form___ExXvR .default__medium-editor-toolbar-input___25G4j{background:#242424;box-sizing:border-box;color:#ccc;height:50px}.default__medium-editor-toolbar-form___ExXvR a{color:#fff}.default__medium-editor-toolbar-anchor-preview___NeF_n{background:#242424;border-radius:5px;color:#fff}.default__medium-editor-placeholder___2hKYy:after{color:#b3b3b1}",""]),t.locals={"medium-toolbar-arrow-under":"default__medium-toolbar-arrow-under___2L7yE","medium-toolbar-arrow-over":"default__medium-toolbar-arrow-over___1WSgX","medium-editor-toolbar":"default__medium-editor-toolbar___scL6V","medium-editor-button-first":"default__medium-editor-button-first___3t5dl","medium-editor-button-last":"default__medium-editor-button-last___1egI-","medium-editor-button-active":"default__medium-editor-button-active___1NCzT","medium-editor-toolbar-form":"default__medium-editor-toolbar-form___ExXvR","medium-editor-toolbar-input":"default__medium-editor-toolbar-input___25G4j","medium-editor-toolbar-anchor-preview":"default__medium-editor-toolbar-anchor-preview___NeF_n","medium-editor-placeholder":"default__medium-editor-placeholder___2hKYy"}},function(e,t,n){t=e.exports=n(7)(),t.push([e.id,"/*! normalize.css v3.0.3 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,hgroup,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block;vertical-align:baseline}audio:not([controls]){display:none;height:0}[hidden],template{display:none}a{background-color:transparent}a:active,a:hover{outline:0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:700}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-.5em}sub{bottom:-.25em}img{border:0}svg:not(:root){overflow:hidden}figure{margin:1em 40px}hr{box-sizing:content-box;height:0}pre{overflow:auto}code,kbd,pre,samp{font-family:monospace;font-size:1em}button,input,optgroup,select,textarea{color:inherit;font:inherit;margin:0}button{overflow:visible}button,select{text-transform:none}button,html input[type=button],input[type=reset],input[type=submit]{-webkit-appearance:button;cursor:pointer}button[disabled],html input[disabled]{cursor:default}button::-moz-focus-inner,input::-moz-focus-inner{border:0;padding:0}input{line-height:normal}input[type=checkbox],input[type=radio]{box-sizing:border-box;padding:0}input[type=number]::-webkit-inner-spin-button,input[type=number]::-webkit-outer-spin-button{height:auto}input[type=search]{-webkit-appearance:textfield;box-sizing:content-box}input[type=search]::-webkit-search-cancel-button,input[type=search]::-webkit-search-decoration{-webkit-appearance:none}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{border:0;padding:0}textarea{overflow:auto}optgroup{font-weight:700}table{border-collapse:collapse;border-spacing:0}td,th{padding:0}",""])},function(e,t,n){t=e.exports=n(7)(),t.push([e.id,".Header__header___3bMN6{display:flex;width:100%;height:42px;position:fixed;z-index:9999;justify-content:space-between;background-color:#111;color:#fff}.Header__header___3bMN6 i{color:#fff;font-family:serif}.Header__header___3bMN6 .Header__headerItem___dQ02F{width:150px;padding:12px 22px;font-size:13px;font-weight:300;font-family:Atlas Grotesk,Helvetica Neue,sans-serif;text-align:center}.Header__header___3bMN6 .Header__headerItem___dQ02F:first-child{text-align:left}.Header__header___3bMN6 .Header__headerItem___dQ02F:last-child{text-align:right}.Header__header___3bMN6 .Header__editorToggle___3NjHu div{margin-right:12px;cursor:pointer;opacity:.4;color:#fff}.Header__header___3bMN6 .Header__editorToggle___3NjHu div.Header__active___1Z5Aq{opacity:1}.Header__header___3bMN6 .Header__editorToggle___3NjHu div:first-child{margin-top:2px;margin-right:15px}.Header__header___3bMN6 .Header__editorToggle___3NjHu div:last-child{margin-top:-2px}.Header__header___3bMN6 .Header__textIcon___1gnLg{font-family:Times,serif;font-size:20px}",""]),t.locals={header:"Header__header___3bMN6",headerItem:"Header__headerItem___dQ02F",editorToggle:"Header__editorToggle___3NjHu",active:"Header__active___1Z5Aq",textIcon:"Header__textIcon___1gnLg"}},function(e,t,n){t=e.exports=n(7)(),t.push([e.id,".Layout__container___hBWrc{display:flex;flex:1}",""]),t.locals={container:"Layout__container___hBWrc"}},function(e,t,n){t=e.exports=n(7)(),t.push([e.id,".MarkdownEditor__container___1K_hC{font-weight:400;font-size:1em;line-height:1.5em;margin:0 auto;padding:2em 3em;max-width:50em}@media all and (max-width:2000px) and (min-width:960px){.MarkdownEditor__container___1K_hC{font-size:1.1em}}",""]),t.locals={container:"MarkdownEditor__container___1K_hC"}},function(e,t,n){t=e.exports=n(7)(),t.push([e.id,"@import url(https://fonts.googleapis.com/css?family=Cousine:400,700,700italic,400italic);",""]),t.push([e.id,".codemirror__cm-s-atlas___1NP9A.codemirror__CodeMirror___2_BuR{background:#fff;color:#202020;font-family:Atlas Typewriter,Cousine,Monaco,monospace;font-weight:300;height:auto}.codemirror__cm-s-atlas___1NP9A div.codemirror__CodeMirror-selected___2kHzs{background:#90caf9}.codemirror__cm-s-atlas___1NP9A div.codemirror__CodeMirror-dragcursors___1Rl_D{visibility:hidden}.codemirror__cm-s-atlas___1NP9A .codemirror__CodeMirror-line___2NQc6::selection,.codemirror__cm-s-atlas___1NP9A .codemirror__CodeMirror-line___2NQc6>span::selection,.codemirror__cm-s-atlas___1NP9A .codemirror__CodeMirror-line___2NQc6>span>span::selection{background:#90caf9}.codemirror__cm-s-atlas___1NP9A .codemirror__CodeMirror-line___2NQc6::-moz-selection,.codemirror__cm-s-atlas___1NP9A .codemirror__CodeMirror-line___2NQc6>span::-moz-selection,.codemirror__cm-s-atlas___1NP9A .codemirror__CodeMirror-line___2NQc6>span>span::-moz-selection{background:#e0e0e0}.codemirror__cm-s-atlas___1NP9A .codemirror__CodeMirror-gutters___3PnXl{background:#f5f5f5;border-right:0}.codemirror__cm-s-atlas___1NP9A .codemirror__CodeMirror-guttermarker___ySZZo{color:#ac4142}.codemirror__cm-s-atlas___1NP9A .codemirror__CodeMirror-guttermarker-subtle___25KgZ,.codemirror__cm-s-atlas___1NP9A .codemirror__CodeMirror-linenumber___2sEnv{color:#b0b0b0}.codemirror__cm-s-atlas___1NP9A .codemirror__CodeMirror-cursor___3T1aR{border-left:2px solid #2196f3}.codemirror__cm-s-atlas___1NP9A span.codemirror__cm-quote___22NzZ{font-style:italic}.codemirror__cm-s-atlas___1NP9A span.codemirror__cm-comment___1RAg8{color:#8f5536}.codemirror__cm-s-atlas___1NP9A span.codemirror__cm-atom___365qu,.codemirror__cm-s-atlas___1NP9A span.codemirror__cm-number___foy66{color:#aa759f}.codemirror__cm-s-atlas___1NP9A span.codemirror__cm-attribute___3lxVY,.codemirror__cm-s-atlas___1NP9A span.codemirror__cm-property___2Mu3O{color:#90a959}.codemirror__cm-s-atlas___1NP9A span.codemirror__cm-keyword___3VPOV{color:#ac4142}.codemirror__cm-s-atlas___1NP9A span.codemirror__cm-string___Jx0MN{color:#f4bf75}.codemirror__cm-s-atlas___1NP9A span.codemirror__cm-variable___1tltC{color:#90a959}.codemirror__cm-s-atlas___1NP9A span.codemirror__cm-variable-2___2QINx{color:#788696}.codemirror__cm-s-atlas___1NP9A span.codemirror__cm-def___-g73U{color:#d28445}.codemirror__cm-s-atlas___1NP9A span.codemirror__cm-bracket___24-h3{color:#202020}.codemirror__cm-s-atlas___1NP9A span.codemirror__cm-tag___3U76b{color:#ac4142}.codemirror__cm-s-atlas___1NP9A span.codemirror__cm-link___17tjQ{color:#aa759f}.codemirror__cm-s-atlas___1NP9A span.codemirror__cm-error___Kt66U{background:#ac4142;color:#505050}.codemirror__cm-s-atlas___1NP9A .codemirror__CodeMirror-activeline-background___3VLwy{background:#dddcdc}.codemirror__cm-s-atlas___1NP9A .codemirror__CodeMirror-matchingbracket___1cO6v{text-decoration:underline;color:#fff!important}",""]),t.locals={"cm-s-atlas":"codemirror__cm-s-atlas___1NP9A",CodeMirror:"codemirror__CodeMirror___2_BuR","CodeMirror-selected":"codemirror__CodeMirror-selected___2kHzs","CodeMirror-dragcursors":"codemirror__CodeMirror-dragcursors___1Rl_D","CodeMirror-line":"codemirror__CodeMirror-line___2NQc6", +"CodeMirror-gutters":"codemirror__CodeMirror-gutters___3PnXl","CodeMirror-guttermarker":"codemirror__CodeMirror-guttermarker___ySZZo","CodeMirror-guttermarker-subtle":"codemirror__CodeMirror-guttermarker-subtle___25KgZ","CodeMirror-linenumber":"codemirror__CodeMirror-linenumber___2sEnv","CodeMirror-cursor":"codemirror__CodeMirror-cursor___3T1aR","cm-quote":"codemirror__cm-quote___22NzZ","cm-comment":"codemirror__cm-comment___1RAg8","cm-atom":"codemirror__cm-atom___365qu","cm-number":"codemirror__cm-number___foy66","cm-property":"codemirror__cm-property___2Mu3O","cm-attribute":"codemirror__cm-attribute___3lxVY","cm-keyword":"codemirror__cm-keyword___3VPOV","cm-string":"codemirror__cm-string___Jx0MN","cm-variable":"codemirror__cm-variable___1tltC","cm-variable-2":"codemirror__cm-variable-2___2QINx","cm-def":"codemirror__cm-def___-g73U","cm-bracket":"codemirror__cm-bracket___24-h3","cm-tag":"codemirror__cm-tag___3U76b","cm-link":"codemirror__cm-link___17tjQ","cm-error":"codemirror__cm-error___Kt66U","CodeMirror-activeline-background":"codemirror__CodeMirror-activeline-background___3VLwy","CodeMirror-matchingbracket":"codemirror__CodeMirror-matchingbracket___1cO6v"}},function(e,t,n){t=e.exports=n(7)(),t.push([e.id,".SlackAuthLink__link___3nyFN{text-decoration:none;background:no-repeat 0/10% url("+n(356)+");padding:5px 0 4px 36px;font-size:1.4em}",""]),t.locals={link:"SlackAuthLink__link___3nyFN"}},function(e,t,n){t=e.exports=n(7)(),t.push([e.id,".TextEditor__container___2jegm{font-weight:400;font-size:1em;line-height:1.5em;margin:0 auto;padding:2em 3em;max-width:50em}.TextEditor__editor___1hL6L{outline:none;font-family:Atlas Grotesk,Helvetica Neue,sans-serif}@media all and (max-width:2000px) and (min-width:960px){.TextEditor__container___2jegm{font-size:1.1em}}",""]),t.locals={container:"TextEditor__container___2jegm",editor:"TextEditor__editor___1hL6L"}},function(e,t,n){t=e.exports=n(7)(),t.push([e.id,"@font-face{font-family:Atlas Grotesk;src:url("+n(358)+') format("woff");font-weight:400;font-style:normal}@font-face{font-family:Atlas Grotesk;src:url('+n(359)+') format("woff");font-weight:400;font-style:italic}@font-face{font-family:Atlas Grotesk;src:url('+n(357)+') format("woff");font-weight:700;font-style:normal}@font-face{font-family:Atlas Grotesk;src:url('+n(146)+') format("woff");font-weight:700;font-style:italic}@font-face{font-family:Atlas Grotesk;src:url('+n(146)+') format("woff");font-weight:700;font-style:italic}@font-face{font-family:Atlas Typewriter;src:url('+n(361)+') format("woff");font-weight:400;font-style:normal}@font-face{font-family:Atlas Typewriter;src:url('+n(360)+') format("woff");font-weight:700;font-style:normal}',""])},function(e,t,n){t=e.exports=n(7)(),t.push([e.id,"*{box-sizing:border-box}.base-styles__viewport___1HuSA,body,html{width:100%;height:100%;margin:0}body,html{font-family:Atlas Grotesk,Helvetica Neue,sans-serif}a{color:#0c77f8}.base-styles__Codemirror___TnUxh{height:auto}",""]),t.locals={viewport:"base-styles__viewport___1HuSA",Codemirror:"base-styles__Codemirror___TnUxh"}},function(e,t,n){t=e.exports=n(7)(),t.push([e.id,".App__container___1X2l7{display:flex;flex-flow:column;width:100%;height:100%;background-color:#fff;font-family:-apple-system,Helvetica Neue,Lucida Grande;color:#222}",""]),t.locals={container:"App__container___1X2l7"}},function(e,t,n){t=e.exports=n(7)(),t.push([e.id,".Dashboard__container___1r_9d{display:flex;padding-top:48px}.Dashboard__panel___1rfVU{width:50%}.Dashboard__fullscreen___2QaJq{width:100%}.Dashboard__markdown___16wFz{background-color:#fff}",""]),t.locals={container:"Dashboard__container___1r_9d",panel:"Dashboard__panel___1rfVU",fullscreen:"Dashboard__fullscreen___2QaJq",markdown:"Dashboard__markdown___16wFz"}},function(e,t,n){t=e.exports=n(7)(),t.push([e.id,".Home__container___AmDCt{display:flex;flex:1;justify-content:space-around}.Home__content___-n8bV{margin:40px;min-width:640px}.Home__intro___3Rvnm{font-family:Atlas Typewriter,Monaco,monospace;font-size:1.4em;margin-bottom:40px}",""]),t.locals={container:"Home__container___AmDCt",content:"Home__content___-n8bV",intro:"Home__intro___3Rvnm"}},function(e,t,n){function r(e){return null===e||void 0===e}function o(e){return e&&"object"==typeof e&&"number"==typeof e.length?"function"!=typeof e.copy||"function"!=typeof e.slice?!1:!(e.length>0&&"number"!=typeof e[0]):!1}function i(e,t,n){var i,c;if(r(e)||r(t))return!1;if(e.prototype!==t.prototype)return!1;if(u(e))return u(t)?(e=a.call(e),t=a.call(t),l(e,t,n)):!1;if(o(e)){if(!o(t))return!1;if(e.length!==t.length)return!1;for(i=0;i=0;i--)if(f[i]!=d[i])return!1;for(i=f.length-1;i>=0;i--)if(c=f[i],!l(e[c],t[c],n))return!1;return typeof e==typeof t}var a=Array.prototype.slice,s=n(198),u=n(197),l=e.exports=function(e,t,n){return n||(n={}),e===t?!0:e instanceof Date&&t instanceof Date?e.getTime()===t.getTime():!e||!t||"object"!=typeof e&&"object"!=typeof t?n.strict?e===t:e==t:i(e,t,n)}},function(e,t){function n(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function r(e){return e&&"object"==typeof e&&"number"==typeof e.length&&Object.prototype.hasOwnProperty.call(e,"callee")&&!Object.prototype.propertyIsEnumerable.call(e,"callee")||!1}var o="[object Arguments]"==function(){return Object.prototype.toString.call(arguments)}();t=e.exports=o?n:r,t.supported=n,t.unsupported=r},function(e,t){function n(e){var t=[];for(var n in e)t.push(n);return t}t=e.exports="function"==typeof Object.keys?Object.keys:n,t.shim=n},function(e,t){"use strict";function n(e){return e.replace(r,function(e,t){return t.toUpperCase()})}var r=/-(.)/g;e.exports=n},function(e,t,n){"use strict";function r(e){return o(e.replace(i,"ms-"))}var o=n(199),i=/^-ms-/;e.exports=r},function(e,t,n){"use strict";function r(e){return!!e&&("object"==typeof e||"function"==typeof e)&&"length"in e&&!("setInterval"in e)&&"number"!=typeof e.nodeType&&(Array.isArray(e)||"callee"in e||"item"in e)}function o(e){return r(e)?Array.isArray(e)?e.slice():i(e):[e]}var i=n(210);e.exports=o},function(e,t,n){"use strict";function r(e){var t=e.match(c);return t&&t[1].toLowerCase()}function o(e,t){var n=l;l?void 0:u(!1);var o=r(e),i=o&&s(o);if(i){n.innerHTML=i[1]+e+i[2];for(var c=i[0];c--;)n=n.lastChild}else n.innerHTML=e;var f=n.getElementsByTagName("script");f.length&&(t?void 0:u(!1),a(f).forEach(t));for(var d=a(n.childNodes);n.lastChild;)n.removeChild(n.lastChild);return d}var i=n(6),a=n(201),s=n(87),u=n(1),l=i.canUseDOM?document.createElement("div"):null,c=/^\s*<(\w+)/;e.exports=o},function(e,t){"use strict";function n(e){return e===window?{x:window.pageXOffset||document.documentElement.scrollLeft,y:window.pageYOffset||document.documentElement.scrollTop}:{x:e.scrollLeft,y:e.scrollTop}}e.exports=n},function(e,t){"use strict";function n(e){return e.replace(r,"-$1").toLowerCase()}var r=/([A-Z])/g;e.exports=n},function(e,t,n){"use strict";function r(e){return o(e).replace(i,"-ms-")}var o=n(204),i=/^ms-/;e.exports=r},function(e,t){"use strict";function n(e){return!(!e||!("function"==typeof Node?e instanceof Node:"object"==typeof e&&"number"==typeof e.nodeType&&"string"==typeof e.nodeName))}e.exports=n},function(e,t,n){"use strict";function r(e){return o(e)&&3==e.nodeType}var o=n(206);e.exports=r},function(e,t){"use strict";function n(e,t,n){if(!e)return null;var o={};for(var i in e)r.call(e,i)&&(o[i]=t.call(n,e[i],i,e));return o}var r=Object.prototype.hasOwnProperty;e.exports=n},function(e,t){"use strict";function n(e){var t={};return function(n){return t.hasOwnProperty(n)||(t[n]=e.call(this,n)),t[n]}}e.exports=n},function(e,t,n){"use strict";function r(e){var t=e.length;if(Array.isArray(e)||"object"!=typeof e&&"function"!=typeof e?o(!1):void 0,"number"!=typeof t?o(!1):void 0,0===t||t-1 in e?void 0:o(!1),e.hasOwnProperty)try{return Array.prototype.slice.call(e)}catch(n){}for(var r=Array(t),i=0;t>i;i++)r[i]=e[i];return r}var o=n(1);e.exports=r},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e){return l.indexOf(e)>-1}function i(e){return u["default"](e)&&"undefined"!=typeof e.type&&Object.keys(e).every(o)}function a(e){return e.error===!0}t.__esModule=!0,t.isFSA=i,t.isError=a;var s=n(219),u=r(s),l=["type","payload","error","meta"]},function(e,t){"use strict";var n={childContextTypes:!0,contextTypes:!0,defaultProps:!0,displayName:!0,getDefaultProps:!0,mixins:!0,propTypes:!0,type:!0},r={name:!0,length:!0,prototype:!0,caller:!0,arguments:!0,arity:!0};e.exports=function(e,t){for(var o=Object.getOwnPropertyNames(t),i=0;in)return!1;var r=e.length-1;return n==r?e.pop():ee.call(e,n,1),!0}function k(e,t){var n=C(e,t);return 0>n?void 0:e[n][1]}function P(e,t){return C(e,t)>-1}function C(e,t){for(var n=e.length;n--;)if(S(e[n][0],t))return n;return-1}function T(e,t,n){var r=C(e,t);0>r?e.push([t,n]):e[r][1]=n}function E(e,t){var n=e[t];return j(n)?n:void 0}function N(e){var t=typeof e;return"number"==t||"boolean"==t||"string"==t&&"__proto__"!=e||null==e}function M(e){if(null!=e){try{return Y.call(e)}catch(t){}try{return e+""}catch(t){}}return""}function S(e,t){return e===t||e!==e&&t!==t}function O(e){var t=L(e)?_.call(e):"";return t==I||t==z}function L(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function j(e){if(!L(e))return!1;var t=O(e)||o(e)?$:W;return t.test(M(e))}var R=200,D="__lodash_hash_undefined__",I="[object Function]",z="[object GeneratorFunction]",H=/[\\^$.*+?()[\]{}|]/g,W=/^\[object .+?Constructor\]$/,F={"function":!0,object:!0},q=F[typeof t]&&t&&!t.nodeType?t:void 0,U=F[typeof e]&&e&&!e.nodeType?e:void 0,X=r(q&&U&&"object"==typeof n&&n),V=r(F[typeof self]&&self),B=r(F[typeof window]&&window),Z=r(F[typeof this]&&this),G=X||B!==(Z&&Z.window)&&B||V||Z||Function("return this")(),J=Array.prototype,K=Object.prototype,Y=Function.prototype.toString,Q=K.hasOwnProperty,_=K.toString,$=RegExp("^"+Y.call(Q).replace(H,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ee=J.splice,te=E(G,"Map"),ne=E(Object,"create");i.prototype=ne?ne(null):K,c.prototype.clear=f,c.prototype["delete"]=d,c.prototype.get=p,c.prototype.has=h,c.prototype.set=m,v.prototype.clear=g,v.prototype["delete"]=y,v.prototype.get=b,v.prototype.has=x,v.prototype.set=A,e.exports=v}).call(t,n(52)(e),function(){return this}())},function(e,t){function n(e,t,n){function r(t){var n=m,r=v;return m=v=void 0,P=t,y=e.apply(r,n)}function i(e){return P=e,b=setTimeout(c,t),C?r(e):y}function a(e){var n=e-k,r=e-P,o=t-n;return T?A(o,g-r):o}function l(e){var n=e-k,r=e-P;return!k||n>=t||0>n||T&&r>=g}function c(){var e=w();return l(e)?f(e):void(b=setTimeout(c,a(e)))}function f(e){return clearTimeout(b),b=void 0,E&&m?r(e):(m=v=void 0,y)}function d(){void 0!==b&&clearTimeout(b),k=P=0,m=v=b=void 0}function p(){return void 0===b?y:f(w())}function h(){var e=w(),n=l(e);if(m=arguments,v=this,k=e,n){if(void 0===b)return i(k);if(T)return clearTimeout(b),b=setTimeout(c,t),r(k)}return void 0===b&&(b=setTimeout(c,t)),y}var m,v,g,y,b,k=0,P=0,C=!1,T=!1,E=!0;if("function"!=typeof e)throw new TypeError(u);return t=s(t)||0,o(n)&&(C=!!n.leading,T="maxWait"in n,g=T?x(s(n.maxWait)||0,t):g,E="trailing"in n?!!n.trailing:E),h.cancel=d,h.flush=p,h}function r(e){var t=o(e)?b.call(e):"";return t==c||t==f}function o(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function i(e){return!!e&&"object"==typeof e}function a(e){return"symbol"==typeof e||i(e)&&b.call(e)==d}function s(e){if("number"==typeof e)return e;if(a(e))return l;if(o(e)){var t=r(e.valueOf)?e.valueOf():e;e=o(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(p,"");var n=m.test(e);return n||v.test(e)?g(e.slice(2),n?2:8):h.test(e)?l:+e}var u="Expected a function",l=NaN,c="[object Function]",f="[object GeneratorFunction]",d="[object Symbol]",p=/^\s+|\s+$/g,h=/^[-+]0x[0-9a-f]+$/i,m=/^0b[01]+$/i,v=/^0o[0-7]+$/i,g=parseInt,y=Object.prototype,b=y.toString,x=Math.max,A=Math.min,w=Date.now;e.exports=n},function(e,t){function n(e){return!!e&&"object"==typeof e}function r(e,t){var n=null==e?void 0:e[t];return s(n)?n:void 0}function o(e){return"number"==typeof e&&e>-1&&e%1==0&&g>=e}function i(e){return a(e)&&h.call(e)==l}function a(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function s(e){return null==e?!1:i(e)?m.test(d.call(e)):n(e)&&c.test(e)}var u="[object Array]",l="[object Function]",c=/^\[object .+?Constructor\]$/,f=Object.prototype,d=Function.prototype.toString,p=f.hasOwnProperty,h=f.toString,m=RegExp("^"+d.call(p).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),v=r(Array,"isArray"),g=9007199254740991,y=v||function(e){return n(e)&&o(e.length)&&h.call(e)==u};e.exports=y},function(e,t){function n(e){var t=r(e)?s.call(e):"";return t==o||t==i}function r(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}var o="[object Function]",i="[object GeneratorFunction]",a=Object.prototype,s=a.toString;e.exports=n},function(e,t,n){function r(e){return!!e&&"object"==typeof e}function o(e,t){return a(e,t,u)}function i(e){var t;if(!r(e)||d.call(e)!=l||s(e)||!f.call(e,"constructor")&&(t=e.constructor,"function"==typeof t&&!(t instanceof t)))return!1;var n;return o(e,function(e,t){n=t}),void 0===n||f.call(e,n)}var a=n(214),s=n(90),u=n(220),l="[object Object]",c=Object.prototype,f=c.hasOwnProperty,d=c.toString;e.exports=i},function(e,t,n){function r(e,t){return e="number"==typeof e||l.test(e)?+e:-1,t=null==t?d:t,e>-1&&e%1==0&&t>e}function o(e){return"number"==typeof e&&e>-1&&e%1==0&&d>=e}function i(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function a(e){if(null==e)return[];i(e)||(e=Object(e));var t=e.length;t=t&&o(t)&&(u(e)||s(e))&&t||0;for(var n=e.constructor,a=-1,l="function"==typeof n&&n.prototype===e,c=Array(t),d=t>0;++ae?-1:1;return t*d}var n=e%1;return e===e?n?e-n:e:0}function l(e){if("number"==typeof e)return e;if(s(e))return p;if(i(e)){var t=o(e.valueOf)?e.valueOf():e;e=i(t)?t+"":t}if("string"!=typeof e)return 0===e?e:+e;e=e.replace(g,"");var n=b.test(e);return n||x.test(e)?A(e.slice(2),n?2:8):y.test(e)?p:+e}var c="Expected a function",f=1/0,d=1.7976931348623157e308,p=NaN,h="[object Function]",m="[object GeneratorFunction]",v="[object Symbol]",g=/^\s+|\s+$/g,y=/^[-+]0x[0-9a-f]+$/i,b=/^0b[01]+$/i,x=/^0o[0-7]+$/i,A=parseInt,w=Object.prototype,k=w.toString,P=Math.max;e.exports=r},function(e,t){function n(e){return r(Object(e))}var r=Object.getPrototypeOf;e.exports=n},function(e,t){function n(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(n){}return t}e.exports=n},function(e,t){function n(e){return!!e&&"object"==typeof e}e.exports=n},function(e,t,n){(function(t){(function(){function t(e){this.tokens=[],this.tokens.links={},this.options=e||c.defaults,this.rules=f.normal,this.options.gfm&&(this.options.tables?this.rules=f.tables:this.rules=f.gfm)}function n(e,t){if(this.options=t||c.defaults,this.links=e,this.rules=d.normal,this.renderer=this.options.renderer||new r,this.renderer.options=this.options,!this.links)throw new Error("Tokens array requires a `links` property.");this.options.gfm?this.options.breaks?this.rules=d.breaks:this.rules=d.gfm:this.options.pedantic&&(this.rules=d.pedantic)}function r(e){this.options=e||{}}function o(e){this.tokens=[],this.token=null,this.options=e||c.defaults,this.options.renderer=this.options.renderer||new r,this.renderer=this.options.renderer,this.renderer.options=this.options}function i(e,t){return e.replace(t?/&/g:/&(?!#?\w+;)/g,"&").replace(//g,">").replace(/"/g,""").replace(/'/g,"'")}function a(e){return e.replace(/&([#\w]+);/g,function(e,t){return t=t.toLowerCase(),"colon"===t?":":"#"===t.charAt(0)?"x"===t.charAt(1)?String.fromCharCode(parseInt(t.substring(2),16)):String.fromCharCode(+t.substring(1)):""})}function s(e,t){return e=e.source,t=t||"",function n(r,o){return r?(o=o.source||o,o=o.replace(/(^|[^\[])\^/g,"$1"),e=e.replace(r,o),n):new RegExp(e,t)}}function u(){}function l(e){for(var t,n,r=1;rAn error occured:

    "+i(d.message+"",!0)+"
    ";throw d}}var f={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:u,hr:/^( *[-*_]){3,} *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *#* *(?:\n+|$)/,nptable:u,lheading:/^([^\n]+)\n *(=|-){2,} *(?:\n+|$)/,blockquote:/^( *>[^\n]+(\n(?!def)[^\n]+)*\n*)+/,list:/^( *)(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:/^ *(?:comment *(?:\n|\s*$)|closed *(?:\n{2,}|\s*$)|closing *(?:\n{2,}|\s*$))/,def:/^ *\[([^\]]+)\]: *]+)>?(?: +["(]([^\n]+)[")])? *(?:\n+|$)/,table:u,paragraph:/^((?:[^\n]+\n?(?!hr|heading|lheading|blockquote|tag|def))+)\n*/,text:/^[^\n]+/};f.bullet=/(?:[*+-]|\d+\.)/,f.item=/^( *)(bull) [^\n]*(?:\n(?!\1bull )[^\n]*)*/,f.item=s(f.item,"gm")(/bull/g,f.bullet)(),f.list=s(f.list)(/bull/g,f.bullet)("hr","\\n+(?=\\1?(?:[-*_] *){3,}(?:\\n+|$))")("def","\\n+(?="+f.def.source+")")(),f.blockquote=s(f.blockquote)("def",f.def)(),f._tag="(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:/|[^\\w\\s@]*@)\\b",f.html=s(f.html)("comment",//)("closed",/<(tag)[\s\S]+?<\/\1>/)("closing",/])*?>/)(/tag/g,f._tag)(),f.paragraph=s(f.paragraph)("hr",f.hr)("heading",f.heading)("lheading",f.lheading)("blockquote",f.blockquote)("tag","<"+f._tag)("def",f.def)(),f.normal=l({},f),f.gfm=l({},f.normal,{fences:/^ *(`{3,}|~{3,})[ \.]*(\S+)? *\n([\s\S]*?)\s*\1 *(?:\n+|$)/,paragraph:/^/,heading:/^ *(#{1,6}) +([^\n]+?) *#* *(?:\n+|$)/}),f.gfm.paragraph=s(f.paragraph)("(?!","(?!"+f.gfm.fences.source.replace("\\1","\\2")+"|"+f.list.source.replace("\\1","\\3")+"|")(),f.tables=l({},f.gfm,{nptable:/^ *(\S.*\|.*)\n *([-:]+ *\|[-| :]*)\n((?:.*\|.*(?:\n|$))*)\n*/,table:/^ *\|(.+)\n *\|( *[-:]+[-| :]*)\n((?: *\|.*(?:\n|$))*)\n*/}),t.rules=f,t.lex=function(e,n){var r=new t(n);return r.lex(e)},t.prototype.lex=function(e){return e=e.replace(/\r\n|\r/g,"\n").replace(/\t/g," ").replace(/\u00a0/g," ").replace(/\u2424/g,"\n"),this.token(e,!0)},t.prototype.token=function(e,t,n){for(var r,o,i,a,s,u,l,c,d,e=e.replace(/^ +$/gm,"");e;)if((i=this.rules.newline.exec(e))&&(e=e.substring(i[0].length),i[0].length>1&&this.tokens.push({type:"space"})),i=this.rules.code.exec(e))e=e.substring(i[0].length),i=i[0].replace(/^ {4}/gm,""),this.tokens.push({type:"code",text:this.options.pedantic?i:i.replace(/\n+$/,"")});else if(i=this.rules.fences.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"code",lang:i[2],text:i[3]||""});else if(i=this.rules.heading.exec(e))e=e.substring(i[0].length),this.tokens.push({type:"heading",depth:i[1].length,text:i[2]});else if(t&&(i=this.rules.nptable.exec(e))){for(e=e.substring(i[0].length),u={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/\n$/,"").split("\n")},c=0;c ?/gm,""),this.token(i,t,!0),this.tokens.push({type:"blockquote_end"});else if(i=this.rules.list.exec(e)){for(e=e.substring(i[0].length),a=i[2],this.tokens.push({type:"list_start",ordered:a.length>1}),i=i[0].match(this.rules.item),r=!1,d=i.length,c=0;d>c;c++)u=i[c],l=u.length,u=u.replace(/^ *([*+-]|\d+\.) +/,""),~u.indexOf("\n ")&&(l-=u.length,u=this.options.pedantic?u.replace(/^ {1,4}/gm,""):u.replace(new RegExp("^ {1,"+l+"}","gm"),"")),this.options.smartLists&&c!==d-1&&(s=f.bullet.exec(i[c+1])[0],a===s||a.length>1&&s.length>1||(e=i.slice(c+1).join("\n")+e,c=d-1)),o=r||/\n\n(?!\s*$)/.test(u),c!==d-1&&(r="\n"===u.charAt(u.length-1),o||(o=r)),this.tokens.push({type:o?"loose_item_start":"list_item_start"}),this.token(u,!1,n),this.tokens.push({type:"list_item_end"});this.tokens.push({type:"list_end"})}else if(i=this.rules.html.exec(e))e=e.substring(i[0].length),this.tokens.push({type:this.options.sanitize?"paragraph":"html",pre:!this.options.sanitizer&&("pre"===i[1]||"script"===i[1]||"style"===i[1]),text:i[0]});else if(!n&&t&&(i=this.rules.def.exec(e)))e=e.substring(i[0].length),this.tokens.links[i[1].toLowerCase()]={href:i[2],title:i[3]};else if(t&&(i=this.rules.table.exec(e))){for(e=e.substring(i[0].length),u={type:"table",header:i[1].replace(/^ *| *\| *$/g,"").split(/ *\| */),align:i[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:i[3].replace(/(?: *\| *)?\n$/,"").split("\n")},c=0;c])/,autolink:/^<([^ >]+(@|:\/)[^ >]+)>/,url:u,tag:/^|^<\/?\w+(?:"[^"]*"|'[^']*'|[^'">])*?>/,link:/^!?\[(inside)\]\(href\)/,reflink:/^!?\[(inside)\]\s*\[([^\]]*)\]/,nolink:/^!?\[((?:\[[^\]]*\]|[^\[\]])*)\]/,strong:/^__([\s\S]+?)__(?!_)|^\*\*([\s\S]+?)\*\*(?!\*)/,em:/^\b_((?:[^_]|__)+?)_\b|^\*((?:\*\*|[\s\S])+?)\*(?!\*)/,code:/^(`+)\s*([\s\S]*?[^`])\s*\1(?!`)/,br:/^ {2,}\n(?!\s*$)/,del:u,text:/^[\s\S]+?(?=[\\?(?:\s+['"]([\s\S]*?)['"])?\s*/,d.link=s(d.link)("inside",d._inside)("href",d._href)(),d.reflink=s(d.reflink)("inside",d._inside)(),d.normal=l({},d),d.pedantic=l({},d.normal,{strong:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,em:/^_(?=\S)([\s\S]*?\S)_(?!_)|^\*(?=\S)([\s\S]*?\S)\*(?!\*)/}),d.gfm=l({},d.normal,{escape:s(d.escape)("])","~|])")(),url:/^(https?:\/\/[^\s<]+[^<.,:;"')\]\s])/,del:/^~~(?=\S)([\s\S]*?\S)~~/,text:s(d.text)("]|","~]|")("|","|https?://|")()}),d.breaks=l({},d.gfm,{br:s(d.br)("{2,}","*")(),text:s(d.gfm.text)("{2,}","*")()}),n.rules=d,n.output=function(e,t,r){var o=new n(t,r);return o.output(e)},n.prototype.output=function(e){for(var t,n,r,o,a="";e;)if(o=this.rules.escape.exec(e))e=e.substring(o[0].length),a+=o[1];else if(o=this.rules.autolink.exec(e))e=e.substring(o[0].length),"@"===o[2]?(n=":"===o[1].charAt(6)?this.mangle(o[1].substring(7)):this.mangle(o[1]),r=this.mangle("mailto:")+n):(n=i(o[1]),r=n),a+=this.renderer.link(r,null,n);else if(this.inLink||!(o=this.rules.url.exec(e))){if(o=this.rules.tag.exec(e))!this.inLink&&/^
    /i.test(o[0])&&(this.inLink=!1),e=e.substring(o[0].length),a+=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(o[0]):i(o[0]):o[0];else if(o=this.rules.link.exec(e))e=e.substring(o[0].length),this.inLink=!0,a+=this.outputLink(o,{href:o[2],title:o[3]}),this.inLink=!1;else if((o=this.rules.reflink.exec(e))||(o=this.rules.nolink.exec(e))){if(e=e.substring(o[0].length),t=(o[2]||o[1]).replace(/\s+/g," "),t=this.links[t.toLowerCase()],!t||!t.href){a+=o[0].charAt(0),e=o[0].substring(1)+e;continue}this.inLink=!0,a+=this.outputLink(o,t),this.inLink=!1}else if(o=this.rules.strong.exec(e))e=e.substring(o[0].length),a+=this.renderer.strong(this.output(o[2]||o[1]));else if(o=this.rules.em.exec(e))e=e.substring(o[0].length),a+=this.renderer.em(this.output(o[2]||o[1]));else if(o=this.rules.code.exec(e))e=e.substring(o[0].length),a+=this.renderer.codespan(i(o[2],!0));else if(o=this.rules.br.exec(e))e=e.substring(o[0].length),a+=this.renderer.br();else if(o=this.rules.del.exec(e))e=e.substring(o[0].length),a+=this.renderer.del(this.output(o[1]));else if(o=this.rules.text.exec(e))e=e.substring(o[0].length),a+=this.renderer.text(i(this.smartypants(o[0])));else if(e)throw new Error("Infinite loop on byte: "+e.charCodeAt(0))}else e=e.substring(o[0].length),n=i(o[1]),r=n,a+=this.renderer.link(r,null,n);return a},n.prototype.outputLink=function(e,t){var n=i(t.href),r=t.title?i(t.title):null;return"!"!==e[0].charAt(0)?this.renderer.link(n,r,this.output(e[1])):this.renderer.image(n,r,i(e[1]))},n.prototype.smartypants=function(e){return this.options.smartypants?e.replace(/---/g,"—").replace(/--/g,"–").replace(/(^|[-\u2014\/(\[{"\s])'/g,"$1‘").replace(/'/g,"’").replace(/(^|[-\u2014\/(\[{\u2018\s])"/g,"$1“").replace(/"/g,"”").replace(/\.{3}/g,"…"):e},n.prototype.mangle=function(e){if(!this.options.mangle)return e;for(var t,n="",r=e.length,o=0;r>o;o++)t=e.charCodeAt(o),Math.random()>.5&&(t="x"+t.toString(16)),n+="&#"+t+";";return n},r.prototype.code=function(e,t,n){if(this.options.highlight){var r=this.options.highlight(e,t);null!=r&&r!==e&&(n=!0,e=r)}return t?'
    '+(n?e:i(e,!0))+"\n
    \n":"
    "+(n?e:i(e,!0))+"\n
    "},r.prototype.blockquote=function(e){return"
    \n"+e+"
    \n"},r.prototype.html=function(e){return e},r.prototype.heading=function(e,t,n){return"'+e+"\n"; +},r.prototype.hr=function(){return this.options.xhtml?"
    \n":"
    \n"},r.prototype.list=function(e,t){var n=t?"ol":"ul";return"<"+n+">\n"+e+"\n"},r.prototype.listitem=function(e){return"
  • "+e+"
  • \n"},r.prototype.paragraph=function(e){return"

    "+e+"

    \n"},r.prototype.table=function(e,t){return"\n\n"+e+"\n\n"+t+"\n
    \n"},r.prototype.tablerow=function(e){return"\n"+e+"\n"},r.prototype.tablecell=function(e,t){var n=t.header?"th":"td",r=t.align?"<"+n+' style="text-align:'+t.align+'">':"<"+n+">";return r+e+"\n"},r.prototype.strong=function(e){return""+e+""},r.prototype.em=function(e){return""+e+""},r.prototype.codespan=function(e){return""+e+""},r.prototype.br=function(){return this.options.xhtml?"
    ":"
    "},r.prototype.del=function(e){return""+e+""},r.prototype.link=function(e,t,n){if(this.options.sanitize){try{var r=decodeURIComponent(a(e)).replace(/[^\w:]/g,"").toLowerCase()}catch(o){return""}if(0===r.indexOf("javascript:")||0===r.indexOf("vbscript:"))return""}var i='
    "},r.prototype.image=function(e,t,n){var r=''+n+'":">"},r.prototype.text=function(e){return e},o.parse=function(e,t,n){var r=new o(t,n);return r.parse(e)},o.prototype.parse=function(e){this.inline=new n(e.links,this.options,this.renderer),this.tokens=e.reverse();for(var t="";this.next();)t+=this.tok();return t},o.prototype.next=function(){return this.token=this.tokens.pop()},o.prototype.peek=function(){return this.tokens[this.tokens.length-1]||0},o.prototype.parseText=function(){for(var e=this.token.text;"text"===this.peek().type;)e+="\n"+this.next().text;return this.inline.output(e)},o.prototype.tok=function(){switch(this.token.type){case"space":return"";case"hr":return this.renderer.hr();case"heading":return this.renderer.heading(this.inline.output(this.token.text),this.token.depth,this.token.text);case"code":return this.renderer.code(this.token.text,this.token.lang,this.token.escaped);case"table":var e,t,n,r,o,i="",a="";for(n="",e=0;et;t++)if(t in this&&this[t]===e)return t;return-1},s=function(e,t){this.name=e,this.code=DOMException[e],this.message=t},u=function(e,t){if(""===t)throw new s("SYNTAX_ERR","An invalid or illegal string was specified");if(/\s/.test(t))throw new s("INVALID_CHARACTER_ERR","String contains an invalid character");return a.call(e,t)},l=function(e){for(var t=i.call(e.getAttribute("class")||""),n=t?t.split(/\s+/):[],r=0,o=n.length;o>r;r++)this.push(n[r]);this._updateClassName=function(){e.setAttribute("class",this.toString())}},c=l[n]=[],f=function(){return new l(this)};if(s[n]=Error[n],c.item=function(e){return this[e]||null},c.contains=function(e){return e+="",-1!==u(this,e)},c.add=function(){var e,t=arguments,n=0,r=t.length,o=!1;do e=t[n]+"",-1===u(this,e)&&(this.push(e),o=!0);while(++nu;u++)o+=String.fromCharCode(i[u]);n.push(o)}else if("Blob"===t(e)||"File"===t(e)){if(!a)throw new s("NOT_READABLE_ERR");var c=new a;n.push(c.readAsBinaryString(e))}else e instanceof r?"base64"===e.encoding&&m?n.push(m(e.data)):"URI"===e.encoding?n.push(decodeURIComponent(e.data)):"raw"===e.encoding&&n.push(e.data):("string"!=typeof e&&(e+=""),n.push(unescape(encodeURIComponent(e))))},o.getBlob=function(e){return arguments.length||(e=null),new r(this.data.join(""),e,"raw")},o.toString=function(){return"[object BlobBuilder]"},i.slice=function(e,t,n){var o=arguments.length;return 3>o&&(n=null),new r(this.data.slice(e,o>1?t:this.data.length),n,this.encoding)},i.toString=function(){return"[object Blob]"},i.close=function(){this.size=0,delete this.data},n}(e);e.Blob=function(e,t){var r=t?t.type||"":"",o=new n;if(e)for(var i=0,a=e.length;a>i;i++)Uint8Array&&e[i]instanceof Uint8Array?o.append(e[i].buffer):o.append(e[i]);var s=o.getBlob(r);return!s.slice&&s.webkitSlice&&(s.slice=s.webkitSlice),s};var r=Object.getPrototypeOf||function(e){return e.__proto__};e.Blob.prototype=r(new e.Blob)}("undefined"!=typeof self&&self||"undefined"!=typeof window&&window||this.content||this),function(t,n){"use strict";e.exports=n}(this,function(){"use strict";function e(e,t){return this.init(e,t)}return e.extensions={},function(t){function n(e,t){var n,r=Array.prototype.slice.call(arguments,2);t=t||{};for(var o=0;o-1,isMac:t.navigator.platform.toUpperCase().indexOf("MAC")>=0,keyCode:{BACKSPACE:8,TAB:9,ENTER:13,ESCAPE:27,SPACE:32,DELETE:46,K:75,M:77},isMetaCtrlKey:function(e){return!!(s.isMac&&e.metaKey||!s.isMac&&e.ctrlKey)},isKey:function(e,t){var n=s.getKeyCode(e);return!1===Array.isArray(t)?n===t:-1!==t.indexOf(n)},getKeyCode:function(e){var t=e.which;return null===t&&(t=null!==e.charCode?e.charCode:e.keyCode),t},blockContainerElementNames:["p","h1","h2","h3","h4","h5","h6","blockquote","pre","ul","li","ol","address","article","aside","audio","canvas","dd","dl","dt","fieldset","figcaption","figure","footer","form","header","hgroup","main","nav","noscript","output","section","video","table","thead","tbody","tfoot","tr","th","td"],emptyElementNames:["br","col","colgroup","hr","img","input","source","wbr"],extend:function(){var e=[!0].concat(Array.prototype.slice.call(arguments));return n.apply(this,e)},defaults:function(){var e=[!1].concat(Array.prototype.slice.call(arguments));return n.apply(this,e)},createLink:function(e,t,n,r){var o=e.createElement("a");return s.moveTextRangeIntoElement(t[0],t[t.length-1],o),o.setAttribute("href",n),r&&o.setAttribute("target",r),o},findOrCreateMatchingTextNodes:function(e,t,n){for(var r=e.createTreeWalker(t,NodeFilter.SHOW_ALL,null,!1),o=[],i=0,a=!1,u=null,l=null;null!==(u=r.nextNode());)if(!(u.nodeType>3))if(3===u.nodeType){if(!a&&n.startn.end+1)throw new Error("PerformLinking overshot the target!");a&&o.push(l||u),i+=u.nodeValue.length,null!==l&&(i+=l.nodeValue.length,r.nextNode()),l=null}else"img"===u.tagName.toLowerCase()&&(!a&&n.start<=i&&(a=!0),a&&o.push(u));return o},splitStartNodeIfNeeded:function(e,t,n){return t!==n?e.splitText(t-n):null},splitEndNodeIfNeeded:function(e,t,n,r){var o,i;o=r+(t||e).nodeValue.length+(t?e.nodeValue.length:0)-1,i=(t||e).nodeValue.length-(o+1-n),o>=n&&r!==o&&0!==i&&(t||e).splitText(i)},splitByBlockElements:function(t){if(3!==t.nodeType&&1!==t.nodeType)return[];var n=[],r=e.util.blockContainerElementNames.join(",");if(3===t.nodeType||0===t.querySelectorAll(r).length)return[t];for(var o=0;o0)break;r=i.nextNode()}return r},findPreviousSibling:function(e){if(!e||s.isMediumEditorElement(e))return!1;for(var t=e.previousSibling;!t&&!s.isMediumEditorElement(e.parentNode);)e=e.parentNode,t=e.previousSibling;return t},isDescendant:function(e,t,n){if(!e||!t)return!1;if(e===t)return!!n;if(1!==e.nodeType)return!1;if(r||3!==t.nodeType)return e.contains(t);for(var o=t.parentNode;null!==o;){if(o===e)return!0;o=o.parentNode}return!1},isElement:function(e){return!(!e||1!==e.nodeType)},throttle:function(e,t){var n,r,o,i=50,a=null,s=0,u=function(){s=Date.now(),a=null,o=e.apply(n,r),a||(n=r=null)};return t||0===t||(t=i),function(){var i=Date.now(),l=t-(i-s);return n=this,r=arguments,0>=l||l>t?(a&&(clearTimeout(a),a=null),s=i,o=e.apply(n,r),a||(n=r=null)):a||(a=setTimeout(u,l)),o}},traverseUp:function(e,t){if(!e)return!1;do{if(1===e.nodeType){if(t(e))return e;if(s.isMediumEditorElement(e))return!1}e=e.parentNode}while(e);return!1},htmlEntities:function(e){return String(e).replace(/&/g,"&").replace(//g,">").replace(/"/g,""")},insertHTMLCommand:function(t,n){var r,o,i,a,u,l,c,f=!1,d=["insertHTML",!1,n];if(!e.util.isEdge&&t.queryCommandSupported("insertHTML"))try{return t.execCommand.apply(t,d)}catch(p){}if(r=t.getSelection(),r.rangeCount){if(o=r.getRangeAt(0),c=o.commonAncestorContainer,s.isMediumEditorElement(c)&&!c.firstChild)o.selectNode(c.appendChild(t.createTextNode("")));else if(3===c.nodeType&&0===o.startOffset&&o.endOffset===c.nodeValue.length||3!==c.nodeType&&c.innerHTML===o.toString()){for(;!s.isMediumEditorElement(c)&&c.parentNode&&1===c.parentNode.childNodes.length&&!s.isMediumEditorElement(c.parentNode);)c=c.parentNode;o.selectNode(c)}for(o.deleteContents(),i=t.createElement("div"),i.innerHTML=n,a=t.createDocumentFragment();i.firstChild;)u=i.firstChild,l=a.appendChild(u);o.insertNode(a),l&&(o=o.cloneRange(),o.setStartAfter(l),o.collapse(!0),r.removeAllRanges(),r.addRange(o)),f=!0}return t.execCommand.callListeners&&t.execCommand.callListeners(d,f),f},execFormatBlock:function(t,n){var r,o=s.getTopBlockContainer(e.selection.getSelectionStart(t));if("blockquote"===n){if(o&&(r=Array.prototype.slice.call(o.childNodes),r.some(function(e){return s.isBlockContainer(e)})))return t.execCommand("outdent",!1,null);if(s.isIE)return t.execCommand("indent",!1,n)}if(o&&n===o.nodeName.toLowerCase()&&(n="p"),s.isIE&&(n="<"+n+">"),o&&"blockquote"===o.nodeName.toLowerCase()){if(s.isIE&&"

    "===n)return t.execCommand("outdent",!1,n);if((s.isFF||s.isEdge)&&"p"===n)return r=Array.prototype.slice.call(o.childNodes),r.some(function(e){return!s.isBlockContainer(e)})&&t.execCommand("formatBlock",!1,n),t.execCommand("outdent",!1,n)}return t.execCommand("formatBlock",!1,n)},setTargetBlank:function(e,t){var n,r=t||!1;if("a"===e.nodeName.toLowerCase())e.target="_blank";else for(e=e.getElementsByTagName("a"),n=0;nr?(o=o.parentNode,n-=1):(i=i.parentNode,r-=1);for(;o!==i;)o=o.parentNode,i=i.parentNode;return o},isElementAtBeginningOfBlock:function(e){for(var t,n;!s.isBlockContainer(e)&&!s.isMediumEditorElement(e);){for(n=e;n=n.previousSibling;)if(t=3===n.nodeType?n.nodeValue:n.textContent,t.length>0)return!1;e=e.parentNode}return!0},isMediumEditorElement:function(e){return e&&e.getAttribute&&!!e.getAttribute("data-medium-editor-element")},getContainerEditorElement:function(e){return s.traverseUp(e,function(e){return s.isMediumEditorElement(e)})},isBlockContainer:function(e){return e&&3!==e.nodeType&&-1!==s.blockContainerElementNames.indexOf(e.nodeName.toLowerCase())},getClosestBlockContainer:function(e){return s.traverseUp(e,function(e){return s.isBlockContainer(e)||s.isMediumEditorElement(e)})},getTopBlockContainer:function(e){var t=s.isBlockContainer(e)?e:!1;return s.traverseUp(e,function(e){return s.isBlockContainer(e)&&(t=e),!t&&s.isMediumEditorElement(e)?(t=e,!0):!1}),t},getFirstSelectableLeafNode:function(e){for(;e&&e.firstChild;)e=e.firstChild;if(e=s.traverseUp(e,function(e){return-1===s.emptyElementNames.indexOf(e.nodeName.toLowerCase())}),"table"===e.nodeName.toLowerCase()){var t=e.querySelector("th, td");t&&(e=t)}return e},getFirstTextNode:function(e){return s.warn("getFirstTextNode is deprecated and will be removed in version 6.0.0"),s._getFirstTextNode(e)},_getFirstTextNode:function(e){if(3===e.nodeType)return e;for(var t=0;t0){var o,i=r.getRangeAt(0),a=i.cloneRange();a.selectNodeContents(e),a.setEnd(i.startContainer,i.startOffset),o=a.toString().length,n={start:o,end:o+i.toString().length},this.doesRangeStartWithImages(i,t)&&(n.startsWithImage=!0);var s=this.getTrailingImageCount(e,n,i.endContainer,i.endOffset);if(s&&(n.trailingImageCount=s),0!==o){var u=this.getIndexRelativeToAdjacentEmptyBlocks(t,e,i.startContainer,i.startOffset);-1!==u&&(n.emptyBlocksIndex=u)}}return n},importSelection:function(e,t,n,r){if(e&&t){var o=n.createRange();o.setStart(t,0),o.collapse(!0);var i,a=t,s=[],u=0,l=!1,c=!1,f=0,d=!1,p=!1,h=null;for((r||e.startsWithImage||"undefined"!=typeof e.emptyBlocksIndex)&&(p=!0);!d&&a;)if(a.nodeType>3)a=s.pop();else{if(3!==a.nodeType||c){if(e.trailingImageCount&&c&&("img"===a.nodeName.toLowerCase()&&f++,f===e.trailingImageCount)){for(var m=0;a.parentNode.childNodes[m]!==a;)m++;o.setEnd(a.parentNode,m+1),d=!0}if(!d&&1===a.nodeType)for(var v=a.childNodes.length-1;v>=0;)s.push(a.childNodes[v]),v-=1}else i=u+a.length,!l&&e.start>=u&&e.start<=i&&(p||e.start=u&&e.end<=i&&(e.trailingImageCount?c=!0:(o.setEnd(a,e.end-u),d=!0)),u=i;d||(a=s.pop())}!l&&h&&(o.setStart(h,h.length),o.setEnd(h,h.length)),"undefined"!=typeof e.emptyBlocksIndex&&(o=this.importSelectionMoveCursorPastBlocks(n,t,e.emptyBlocksIndex,o)),r&&(o=this.importSelectionMoveCursorPastAnchor(e,o));var g=n.getSelection();g.removeAllRanges(),g.addRange(o)}},importSelectionMoveCursorPastAnchor:function(t,n){var r=function(e){return"a"===e.nodeName.toLowerCase()};if(t.start===t.end&&3===n.startContainer.nodeType&&n.startOffset===n.startContainer.nodeValue.length&&e.util.traverseUp(n.startContainer,r)){for(var o=n.startContainer,i=n.startContainer.parentNode;null!==i&&"a"!==i.nodeName.toLowerCase();)i.childNodes[i.childNodes.length-1]!==o?i=null:(o=i,i=i.parentNode);if(null!==i&&"a"===i.nodeName.toLowerCase()){for(var a=null,s=0;null===a&&s0)break}else a===u.currentNode&&(s=u.currentNode);return s||(s=a),i.setStart(e.util.getFirstSelectableLeafNode(s),0),i},getIndexRelativeToAdjacentEmptyBlocks:function(n,r,o,i){if(o.textContent.length>0&&i>0)return-1;var a=o;if(3!==a.nodeType&&(a=o.childNodes[i]),a){if(!e.util.isElementAtBeginningOfBlock(a))return-1;var s=e.util.findPreviousSibling(a);if(!s)return-1;if(s.nodeValue)return-1}for(var u=e.util.getClosestBlockContainer(o),l=n.createTreeWalker(r,NodeFilter.SHOW_ELEMENT,t,!1),c=0;l.nextNode();){var f=""===l.currentNode.textContent;if((f||c>0)&&(c+=1),l.currentNode===u)return c;f||(c=0)}return c},doesRangeStartWithImages:function(e,t){if(0!==e.startOffset||1!==e.startContainer.nodeType)return!1;if("img"===e.startContainer.nodeName.toLowerCase())return!0;var n=e.startContainer.querySelector("img");if(!n)return!1;for(var r=t.createTreeWalker(e.startContainer,NodeFilter.SHOW_ALL,null,!1);r.nextNode();){var o=r.currentNode;if(o===n)break;if(o.nodeValue)return!1}return!0},getTrailingImageCount:function(e,t,n,r){if(0===r||1!==n.nodeType)return 0;if("img"!==n.nodeName.toLowerCase()&&!n.querySelector("img"))return 0;for(var o=n.childNodes[r-1];o.hasChildNodes();)o=o.lastChild;for(var i,a=e,s=[],u=0,l=!1,c=!1,f=!1,d=0;!f&&a;)if(a.nodeType>3)a=s.pop();else{if(3!==a.nodeType||c){if("img"===a.nodeName.toLowerCase()&&d++,a===o)f=!0;else if(1===a.nodeType)for(var p=a.childNodes.length-1;p>=0;)s.push(a.childNodes[p]),p-=1}else d=0,i=u+a.length,!l&&t.start>=u&&t.start<=i&&(l=!0),l&&t.end>=u&&t.end<=i&&(c=!0),u=i;f||(a=s.pop())}return d},selectionContainsContent:function(e){var t=e.getSelection();if(!t||t.isCollapsed||!t.rangeCount)return!1;if(""!==t.toString().trim())return!0;var n=this.getSelectedParentElement(t.getRangeAt(0));return!(!n||!("img"===n.nodeName.toLowerCase()||1===n.nodeType&&n.querySelector("img")))},selectionInContentEditableFalse:function(e){var t,n=this.findMatchingSelectionParent(function(e){var n=e&&e.getAttribute("contenteditable");return"true"===n&&(t=!0),"#text"!==e.nodeName&&"false"===n},e);return!t&&n},getSelectionHtml:function(e){var t,n,r,o="",i=e.getSelection();if(i.rangeCount){for(r=e.createElement("div"),t=0,n=i.rangeCount;n>t;t+=1)r.appendChild(i.getRangeAt(t).cloneContents());o=r.innerHTML}return o},getCaretOffsets:function(e,t){var n,r;return t||(t=window.getSelection().getRangeAt(0)),n=t.cloneRange(),r=t.cloneRange(),n.selectNodeContents(e),n.setEnd(t.endContainer,t.endOffset),r.selectNodeContents(e),r.setStart(t.endContainer,t.endOffset),{left:n.toString().length,right:r.toString().length}},rangeSelectsSingleNode:function(e){var t=e.startContainer;return t===e.endContainer&&t.hasChildNodes()&&e.endOffset===e.startOffset+1},getSelectedParentElement:function(e){return e?this.rangeSelectsSingleNode(e)&&3!==e.startContainer.childNodes[e.startOffset].nodeType?e.startContainer.childNodes[e.startOffset]:3===e.startContainer.nodeType?e.startContainer.parentNode:e.startContainer:null},getSelectedElements:function(e){var t,n,r,o=e.getSelection();if(!o.rangeCount||o.isCollapsed||!o.getRangeAt(0).commonAncestorContainer)return[];if(t=o.getRangeAt(0),3===t.commonAncestorContainer.nodeType){for(n=[],r=t.commonAncestorContainer;r.parentNode&&1===r.parentNode.childNodes.length;)n.push(r.parentNode),r=r.parentNode;return n}return[].filter.call(t.commonAncestorContainer.getElementsByTagName("*"),function(e){return"function"==typeof o.containsNode?o.containsNode(e,!0):!0})},selectNode:function(e,t){var n=t.createRange(),r=t.getSelection();n.selectNodeContents(e),r.removeAllRanges(),r.addRange(n)},select:function(e,t,n,r,o){e.getSelection().removeAllRanges();var i=e.createRange();return i.setStart(t,n),r?i.setEnd(r,o):i.collapse(!0),e.getSelection().addRange(i),i},clearSelection:function(e,t){t?e.getSelection().collapseToStart():e.getSelection().collapseToEnd()},moveCursor:function(e,t,n){this.select(e,t,n)},getSelectionRange:function(e){var t=e.getSelection();return 0===t.rangeCount?null:t.getRangeAt(0)},getSelectionStart:function(e){var t=e.getSelection().anchorNode,n=t&&3===t.nodeType?t.parentNode:t;return n}};e.selection=n}(),function(){var t=function(e){this.base=e,this.options=this.base.options,this.events=[],this.disabledEvents={},this.customEvents={},this.listeners={}};t.prototype={InputEventOnContenteditableSupported:!e.util.isIE&&!e.util.isEdge,attachDOMEvent:function(t,n,r,o){t=e.util.isElement(t)||[window,document].indexOf(t)>-1?[t]:t,Array.prototype.forEach.call(t,function(e){e.addEventListener(n,r,o),this.events.push([e,n,r,o])}.bind(this))},detachDOMEvent:function(t,n,r,o){var i,a;t=e.util.isElement(t)||[window,document].indexOf(t)>-1?[t]:t,Array.prototype.forEach.call(t,function(e){i=this.indexOfListener(e,n,r,o),-1!==i&&(a=this.events.splice(i,1)[0],a[0].removeEventListener(a[1],a[2],a[3]))}.bind(this))},indexOfListener:function(e,t,n,r){var o,i,a;for(o=0,i=this.events.length;i>o;o+=1)if(a=this.events[o],a[0]===e&&a[1]===t&&a[2]===n&&a[3]===r)return o;return-1},detachAllDOMEvents:function(){for(var e=this.events.pop();e;)e[0].removeEventListener(e[1],e[2],e[3]),e=this.events.pop()},enableCustomEvent:function(e){void 0!==this.disabledEvents[e]&&delete this.disabledEvents[e]},disableCustomEvent:function(e){this.disabledEvents[e]=!0},attachCustomEvent:function(e,t){this.setupListener(e),this.customEvents[e]||(this.customEvents[e]=[]),this.customEvents[e].push(t)},detachCustomEvent:function(e,t){var n=this.indexOfCustomListener(e,t);-1!==n&&this.customEvents[e].splice(n,1)},indexOfCustomListener:function(e,t){return this.customEvents[e]&&this.customEvents[e].length?this.customEvents[e].indexOf(t):-1},detachAllCustomEvents:function(){this.customEvents={}},triggerCustomEvent:function(e,t,n){this.customEvents[e]&&!this.disabledEvents[e]&&this.customEvents[e].forEach(function(e){e(t,n)})},destroy:function(){this.detachAllDOMEvents(),this.detachAllCustomEvents(),this.detachExecCommand(),this.base.elements&&this.base.elements.forEach(function(e){e.removeAttribute("data-medium-focused")})},attachToExecCommand:function(){this.execCommandListener||(this.execCommandListener=function(e){this.handleDocumentExecCommand(e)}.bind(this),this.wrapExecCommand(),this.options.ownerDocument.execCommand.listeners.push(this.execCommandListener))},detachExecCommand:function(){var e=this.options.ownerDocument;if(this.execCommandListener&&e.execCommand.listeners){var t=e.execCommand.listeners.indexOf(this.execCommandListener);-1!==t&&e.execCommand.listeners.splice(t,1),e.execCommand.listeners.length||this.unwrapExecCommand()}},wrapExecCommand:function(){var e=this.options.ownerDocument;if(!e.execCommand.listeners){var t=function(t,n){e.execCommand.listeners&&e.execCommand.listeners.forEach(function(e){e({command:t[0],value:t[2],args:t,result:n})})},n=function(){var n=e.execCommand.orig.apply(this,arguments);if(!e.execCommand.listeners)return n;var r=Array.prototype.slice.call(arguments);return t(r,n),n};n.orig=e.execCommand,n.listeners=[],n.callListeners=t,e.execCommand=n}},unwrapExecCommand:function(){var e=this.options.ownerDocument;e.execCommand.orig&&(e.execCommand=e.execCommand.orig)},setupListener:function(e){if(!this.listeners[e]){switch(e){case"externalInteraction":this.attachDOMEvent(this.options.ownerDocument.body,"mousedown",this.handleBodyMousedown.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"click",this.handleBodyClick.bind(this),!0),this.attachDOMEvent(this.options.ownerDocument.body,"focus",this.handleBodyFocus.bind(this),!0);break;case"blur":this.setupListener("externalInteraction");break;case"focus":this.setupListener("externalInteraction");break;case"editableInput":this.contentCache=[],this.base.elements.forEach(function(e){this.contentCache[e.getAttribute("medium-editor-index")]=e.innerHTML,this.InputEventOnContenteditableSupported&&this.attachDOMEvent(e,"input",this.handleInput.bind(this))}.bind(this)),this.InputEventOnContenteditableSupported||(this.setupListener("editableKeypress"),this.keypressUpdateInput=!0,this.attachDOMEvent(document,"selectionchange",this.handleDocumentSelectionChange.bind(this)),this.attachToExecCommand());break;case"editableClick":this.attachToEachElement("click",this.handleClick);break;case"editableBlur":this.attachToEachElement("blur",this.handleBlur);break;case"editableKeypress":this.attachToEachElement("keypress",this.handleKeypress);break;case"editableKeyup":this.attachToEachElement("keyup",this.handleKeyup);break;case"editableKeydown":this.attachToEachElement("keydown",this.handleKeydown);break;case"editableKeydownSpace":this.setupListener("editableKeydown");break;case"editableKeydownEnter":this.setupListener("editableKeydown");break;case"editableKeydownTab":this.setupListener("editableKeydown");break;case"editableKeydownDelete":this.setupListener("editableKeydown");break;case"editableMouseover":this.attachToEachElement("mouseover",this.handleMouseover);break;case"editableDrag":this.attachToEachElement("dragover",this.handleDragging),this.attachToEachElement("dragleave",this.handleDragging);break;case"editableDrop":this.attachToEachElement("drop",this.handleDrop);break;case"editablePaste":this.attachToEachElement("paste",this.handlePaste)}this.listeners[e]=!0}},attachToEachElement:function(e,t){this.base.elements.forEach(function(n){this.attachDOMEvent(n,e,t.bind(this))},this)},focusElement:function(e){e.focus(),this.updateFocus(e,{target:e,type:"focus"})},updateFocus:function(t,n){var r,o=this.base.getExtensionByName("toolbar"),i=o?o.getToolbarElement():null,a=this.base.getExtensionByName("anchor-preview"),s=a&&a.getPreviewElement?a.getPreviewElement():null,u=this.base.getFocusedElement();u&&"click"===n.type&&this.lastMousedownTarget&&(e.util.isDescendant(u,this.lastMousedownTarget,!0)||e.util.isDescendant(i,this.lastMousedownTarget,!0)||e.util.isDescendant(s,this.lastMousedownTarget,!0))&&(r=u),r||this.base.elements.some(function(n){return!r&&e.util.isDescendant(n,t,!0)&&(r=n),!!r},this);var l=!e.util.isDescendant(u,t,!0)&&!e.util.isDescendant(i,t,!0)&&!e.util.isDescendant(s,t,!0);r!==u&&(u&&l&&(u.removeAttribute("data-medium-focused"),this.triggerCustomEvent("blur",n,u)),r&&(r.setAttribute("data-medium-focused",!0),this.triggerCustomEvent("focus",n,r))),l&&this.triggerCustomEvent("externalInteraction",n)},updateInput:function(e,t){if(this.contentCache){var n=e.getAttribute("medium-editor-index"),r=e.innerHTML;r!==this.contentCache[n]&&this.triggerCustomEvent("editableInput",t,e),this.contentCache[n]=r}},handleDocumentSelectionChange:function(t){if(t.currentTarget&&t.currentTarget.activeElement){var n,r=t.currentTarget.activeElement;this.base.elements.some(function(t){return e.util.isDescendant(t,r,!0)?(n=t,!0):!1},this),n&&this.updateInput(n,{target:r,currentTarget:n})}},handleDocumentExecCommand:function(){var e=this.base.getFocusedElement();e&&this.updateInput(e,{target:e,currentTarget:e})},handleBodyClick:function(e){this.updateFocus(e.target,e)},handleBodyFocus:function(e){this.updateFocus(e.target,e)},handleBodyMousedown:function(e){this.lastMousedownTarget=e.target},handleInput:function(e){this.updateInput(e.currentTarget,e)},handleClick:function(e){this.triggerCustomEvent("editableClick",e,e.currentTarget)},handleBlur:function(e){this.triggerCustomEvent("editableBlur",e,e.currentTarget)},handleKeypress:function(e){if(this.triggerCustomEvent("editableKeypress",e,e.currentTarget),this.keypressUpdateInput){var t={target:e.target,currentTarget:e.currentTarget};setTimeout(function(){this.updateInput(t.currentTarget,t)}.bind(this),0)}},handleKeyup:function(e){this.triggerCustomEvent("editableKeyup",e,e.currentTarget)},handleMouseover:function(e){this.triggerCustomEvent("editableMouseover",e,e.currentTarget)},handleDragging:function(e){this.triggerCustomEvent("editableDrag",e,e.currentTarget)},handleDrop:function(e){this.triggerCustomEvent("editableDrop",e,e.currentTarget)},handlePaste:function(e){this.triggerCustomEvent("editablePaste",e,e.currentTarget)},handleKeydown:function(t){return this.triggerCustomEvent("editableKeydown",t,t.currentTarget),e.util.isKey(t,e.util.keyCode.SPACE)?this.triggerCustomEvent("editableKeydownSpace",t,t.currentTarget):e.util.isKey(t,e.util.keyCode.ENTER)||t.ctrlKey&&e.util.isKey(t,e.util.keyCode.M)?this.triggerCustomEvent("editableKeydownEnter",t,t.currentTarget):e.util.isKey(t,e.util.keyCode.TAB)?this.triggerCustomEvent("editableKeydownTab",t,t.currentTarget):e.util.isKey(t,[e.util.keyCode.DELETE,e.util.keyCode.BACKSPACE])?this.triggerCustomEvent("editableKeydownDelete",t,t.currentTarget):void 0}},e.Events=t}(),function(){var t=e.Extension.extend({action:void 0,aria:void 0,tagNames:void 0,style:void 0,useQueryState:void 0,contentDefault:void 0,contentFA:void 0,classList:void 0,attrs:void 0,constructor:function(n){t.isBuiltInButton(n)?e.Extension.call(this,this.defaults[n]):e.Extension.call(this,n)},init:function(){e.Extension.prototype.init.apply(this,arguments),this.button=this.createButton(),this.on(this.button,"click",this.handleClick.bind(this))},getButton:function(){return this.button},getAction:function(){return"function"==typeof this.action?this.action(this.base.options):this.action},getAria:function(){return"function"==typeof this.aria?this.aria(this.base.options):this.aria},getTagNames:function(){return"function"==typeof this.tagNames?this.tagNames(this.base.options):this.tagNames},createButton:function(){var e=this.document.createElement("button"),t=this.contentDefault,n=this.getAria(),r=this.getEditorOption("buttonLabels");return e.classList.add("medium-editor-action"),e.classList.add("medium-editor-action-"+this.name),this.classList&&this.classList.forEach(function(t){e.classList.add(t)}),e.setAttribute("data-action",this.getAction()),n&&(e.setAttribute("title",n),e.setAttribute("aria-label",n)),this.attrs&&Object.keys(this.attrs).forEach(function(t){e.setAttribute(t,this.attrs[t])},this),"fontawesome"===r&&this.contentFA&&(t=this.contentFA),e.innerHTML=t,e},handleClick:function(e){e.preventDefault(),e.stopPropagation();var t=this.getAction();t&&this.execAction(t)},isActive:function(){return this.button.classList.contains(this.getEditorOption("activeButtonClass"))},setInactive:function(){this.button.classList.remove(this.getEditorOption("activeButtonClass")), +delete this.knownState},setActive:function(){this.button.classList.add(this.getEditorOption("activeButtonClass")),delete this.knownState},queryCommandState:function(){var e=null;return this.useQueryState&&(e=this.base.queryCommandState(this.getAction())),e},isAlreadyApplied:function(e){var t,n,r=!1,o=this.getTagNames();return this.knownState===!1||this.knownState===!0?this.knownState:(o&&o.length>0&&(r=-1!==o.indexOf(e.nodeName.toLowerCase())),!r&&this.style&&(t=this.style.value.split("|"),n=this.window.getComputedStyle(e,null).getPropertyValue(this.style.prop),t.forEach(function(e){this.knownState||(r=-1!==n.indexOf(e),(r||"text-decoration"!==this.style.prop)&&(this.knownState=r))},this)),r)}});t.isBuiltInButton=function(t){return"string"==typeof t&&e.extensions.button.prototype.defaults.hasOwnProperty(t)},e.extensions.button=t}(),function(){e.extensions.button.prototype.defaults={bold:{name:"bold",action:"bold",aria:"bold",tagNames:["b","strong"],style:{prop:"font-weight",value:"700|bold"},useQueryState:!0,contentDefault:"B",contentFA:''},italic:{name:"italic",action:"italic",aria:"italic",tagNames:["i","em"],style:{prop:"font-style",value:"italic"},useQueryState:!0,contentDefault:"I",contentFA:''},underline:{name:"underline",action:"underline",aria:"underline",tagNames:["u"],style:{prop:"text-decoration",value:"underline"},useQueryState:!0,contentDefault:"U",contentFA:''},strikethrough:{name:"strikethrough",action:"strikethrough",aria:"strike through",tagNames:["strike"],style:{prop:"text-decoration",value:"line-through"},useQueryState:!0,contentDefault:"A",contentFA:''},superscript:{name:"superscript",action:"superscript",aria:"superscript",tagNames:["sup"],contentDefault:"x1",contentFA:''},subscript:{name:"subscript",action:"subscript",aria:"subscript",tagNames:["sub"],contentDefault:"x1",contentFA:''},image:{name:"image",action:"image",aria:"image",tagNames:["img"],contentDefault:"image",contentFA:''},orderedlist:{name:"orderedlist",action:"insertorderedlist",aria:"ordered list",tagNames:["ol"],useQueryState:!0,contentDefault:"1.",contentFA:''},unorderedlist:{name:"unorderedlist",action:"insertunorderedlist",aria:"unordered list",tagNames:["ul"],useQueryState:!0,contentDefault:"",contentFA:''},indent:{name:"indent",action:"indent",aria:"indent",tagNames:[],contentDefault:"",contentFA:''},outdent:{name:"outdent",action:"outdent",aria:"outdent",tagNames:[],contentDefault:"",contentFA:''},justifyCenter:{name:"justifyCenter",action:"justifyCenter",aria:"center justify",tagNames:[],style:{prop:"text-align",value:"center"},contentDefault:"C",contentFA:''},justifyFull:{name:"justifyFull",action:"justifyFull",aria:"full justify",tagNames:[],style:{prop:"text-align",value:"justify"},contentDefault:"J",contentFA:''},justifyLeft:{name:"justifyLeft",action:"justifyLeft",aria:"left justify",tagNames:[],style:{prop:"text-align",value:"left"},contentDefault:"L",contentFA:''},justifyRight:{name:"justifyRight",action:"justifyRight",aria:"right justify",tagNames:[],style:{prop:"text-align",value:"right"},contentDefault:"R",contentFA:''},removeFormat:{name:"removeFormat",aria:"remove formatting",action:"removeFormat",contentDefault:"X",contentFA:''},quote:{name:"quote",action:"append-blockquote",aria:"blockquote",tagNames:["blockquote"],contentDefault:"",contentFA:''},pre:{name:"pre",action:"append-pre",aria:"preformatted text",tagNames:["pre"],contentDefault:"0101",contentFA:''},h1:{name:"h1",action:"append-h1",aria:"header type one",tagNames:["h1"],contentDefault:"H1",contentFA:'1'},h2:{name:"h2",action:"append-h2",aria:"header type two",tagNames:["h2"],contentDefault:"H2",contentFA:'2'},h3:{name:"h3",action:"append-h3",aria:"header type three",tagNames:["h3"],contentDefault:"H3",contentFA:'3'},h4:{name:"h4",action:"append-h4",aria:"header type four",tagNames:["h4"],contentDefault:"H4",contentFA:'4'},h5:{name:"h5",action:"append-h5",aria:"header type five",tagNames:["h5"],contentDefault:"H5",contentFA:'5'},h6:{name:"h6",action:"append-h6",aria:"header type six",tagNames:["h6"],contentDefault:"H6",contentFA:'6'}}}(),function(){var t=e.extensions.button.extend({init:function(){e.extensions.button.prototype.init.apply(this,arguments)},formSaveLabel:"✓",formCloseLabel:"×",activeClass:"medium-editor-toolbar-form-active",hasForm:!0,getForm:function(){},isDisplayed:function(){return this.hasForm?this.getForm().classList.contains(this.activeClass):!1},showForm:function(){this.hasForm&&this.getForm().classList.add(this.activeClass)},hideForm:function(){this.hasForm&&this.getForm().classList.remove(this.activeClass)},showToolbarDefaultActions:function(){var e=this.base.getExtensionByName("toolbar");e&&e.showToolbarDefaultActions()},hideToolbarDefaultActions:function(){var e=this.base.getExtensionByName("toolbar");e&&e.hideToolbarDefaultActions()},setToolbarPosition:function(){var e=this.base.getExtensionByName("toolbar");e&&e.setToolbarPosition()}});e.extensions.form=t}(),function(){var t=e.extensions.form.extend({customClassOption:null,customClassOptionText:"Button",linkValidation:!1,placeholderText:"Paste or type a link",targetCheckbox:!1,targetCheckboxText:"Open in new window",name:"anchor",action:"createLink",aria:"link",tagNames:["a"],contentDefault:"#",contentFA:'',init:function(){e.extensions.form.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this))},handleClick:function(t){t.preventDefault(),t.stopPropagation();var n=e.selection.getSelectionRange(this.document);return"a"===n.startContainer.nodeName.toLowerCase()||"a"===n.endContainer.nodeName.toLowerCase()||e.util.getClosestTag(e.selection.getSelectedParentElement(n),"a")?this.execAction("unlink"):(this.isDisplayed()||this.showForm(),!1)},handleKeydown:function(t){e.util.isKey(t,e.util.keyCode.K)&&e.util.isMetaCtrlKey(t)&&!t.shiftKey&&this.handleClick(t)},getForm:function(){return this.form||(this.form=this.createForm()),this.form},getTemplate:function(){var e=[''];return e.push('',"fontawesome"===this.getEditorOption("buttonLabels")?'':this.formSaveLabel,""),e.push('',"fontawesome"===this.getEditorOption("buttonLabels")?'':this.formCloseLabel,""),this.targetCheckbox&&e.push('

    ','',"","
    "),this.customClassOption&&e.push('
    ','',"","
    "),e.join("")},isDisplayed:function(){return e.extensions.form.prototype.isDisplayed.apply(this)},hideForm:function(){e.extensions.form.prototype.hideForm.apply(this),this.getInput().value=""},showForm:function(t){var n=this.getInput(),r=this.getAnchorTargetCheckbox(),o=this.getAnchorButtonCheckbox();if(t=t||{url:""},"string"==typeof t&&(t={url:t}),this.base.saveSelection(),this.hideToolbarDefaultActions(),e.extensions.form.prototype.showForm.apply(this),this.setToolbarPosition(),n.value=t.url,n.focus(),r&&(r.checked="_blank"===t.target),o){var i=t.buttonClass?t.buttonClass.split(" "):[];o.checked=-1!==i.indexOf(this.customClassOption)}},destroy:function(){return this.form?(this.form.parentNode&&this.form.parentNode.removeChild(this.form),void delete this.form):!1},getFormOpts:function(){var e=this.getAnchorTargetCheckbox(),t=this.getAnchorButtonCheckbox(),n={url:this.getInput().value.trim()};return this.linkValidation&&(n.url=this.checkLinkFormat(n.url)),n.target="_self",e&&e.checked&&(n.target="_blank"),t&&t.checked&&(n.buttonClass=this.customClassOption),n},doFormSave:function(){var e=this.getFormOpts();this.completeFormSave(e)},completeFormSave:function(e){this.base.restoreSelection(),this.execAction(this.action,e),this.base.checkSelection()},checkLinkFormat:function(e){var t=/^([a-z]+:)?\/\/|^(mailto|tel|maps):/i,n=/^\+?\s?\(?(?:\d\s?\-?\)?){3,20}$/;return n.test(e)?"tel:"+e:(t.test(e)?"":"http://")+encodeURI(e)},doFormCancel:function(){this.base.restoreSelection(),this.base.checkSelection()},attachFormEvents:function(e){var t=e.querySelector(".medium-editor-toolbar-close"),n=e.querySelector(".medium-editor-toolbar-save"),r=e.querySelector(".medium-editor-toolbar-input");this.on(e,"click",this.handleFormClick.bind(this)),this.on(r,"keyup",this.handleTextboxKeyup.bind(this)),this.on(t,"click",this.handleCloseClick.bind(this)),this.on(n,"click",this.handleSaveClick.bind(this),!0)},createForm:function(){var e=this.document,t=e.createElement("div");return t.className="medium-editor-toolbar-form",t.id="medium-editor-toolbar-form-anchor-"+this.getEditorId(),t.innerHTML=this.getTemplate(),this.attachFormEvents(t),t},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},getAnchorTargetCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-target")},getAnchorButtonCheckbox:function(){return this.getForm().querySelector(".medium-editor-toolbar-anchor-button")},handleTextboxKeyup:function(t){return t.keyCode===e.util.keyCode.ENTER?(t.preventDefault(),void this.doFormSave()):void(t.keyCode===e.util.keyCode.ESCAPE&&(t.preventDefault(),this.doFormCancel()))},handleFormClick:function(e){e.stopPropagation()},handleSaveClick:function(e){e.preventDefault(),this.doFormSave()},handleCloseClick:function(e){e.preventDefault(),this.doFormCancel()}});e.extensions.anchor=t}(),function(){var t=e.Extension.extend({name:"anchor-preview",hideDelay:500,previewValueSelector:"a",showWhenToolbarIsVisible:!1,init:function(){this.anchorPreview=this.createPreview(),this.getEditorOption("elementsContainer").appendChild(this.anchorPreview),this.attachToEditables()},getPreviewElement:function(){return this.anchorPreview},createPreview:function(){var e=this.document.createElement("div");return e.id="medium-editor-anchor-preview-"+this.getEditorId(),e.className="medium-editor-anchor-preview",e.innerHTML=this.getTemplate(),this.on(e,"click",this.handleClick.bind(this)),e},getTemplate:function(){return'
    '},destroy:function(){this.anchorPreview&&(this.anchorPreview.parentNode&&this.anchorPreview.parentNode.removeChild(this.anchorPreview),delete this.anchorPreview)},hidePreview:function(){this.anchorPreview.classList.remove("medium-editor-anchor-preview-active"),this.activeAnchor=null},showPreview:function(e){return this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||e.getAttribute("data-disable-preview")?!0:(this.previewValueSelector&&(this.anchorPreview.querySelector(this.previewValueSelector).textContent=e.attributes.href.value,this.anchorPreview.querySelector(this.previewValueSelector).href=e.attributes.href.value),this.anchorPreview.classList.add("medium-toolbar-arrow-over"),this.anchorPreview.classList.remove("medium-toolbar-arrow-under"),this.anchorPreview.classList.contains("medium-editor-anchor-preview-active")||this.anchorPreview.classList.add("medium-editor-anchor-preview-active"),this.activeAnchor=e,this.positionPreview(),this.attachPreviewHandlers(),this)},positionPreview:function(e){e=e||this.activeAnchor;var t,n,r=this.anchorPreview.offsetHeight,o=e.getBoundingClientRect(),i=(o.left+o.right)/2,a=this.diffLeft,s=this.diffTop;t=this.anchorPreview.offsetWidth/2;var u=this.base.getExtensionByName("toolbar");u&&(a=u.diffLeft,s=u.diffTop),n=a-t,this.anchorPreview.style.top=Math.round(r+o.bottom-s+this.window.pageYOffset-this.anchorPreview.offsetHeight)+"px",this.anchorPreview.style.right="initial",t>i?(this.anchorPreview.style.left=n+t+"px",this.anchorPreview.style.right="initial"):this.window.innerWidth-ithis.hideDelay&&this.detachPreviewHandlers()},detachPreviewHandlers:function(){clearInterval(this.intervalTimer),this.instanceHandlePreviewMouseover&&(this.off(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.activeAnchor&&(this.off(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.off(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout))),this.hidePreview(),this.hovering=this.instanceHandlePreviewMouseover=this.instanceHandlePreviewMouseout=null},attachPreviewHandlers:function(){this.lastOver=(new Date).getTime(),this.hovering=!0,this.instanceHandlePreviewMouseover=this.handlePreviewMouseover.bind(this),this.instanceHandlePreviewMouseout=this.handlePreviewMouseout.bind(this),this.intervalTimer=setInterval(this.updatePreview.bind(this),200),this.on(this.anchorPreview,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.anchorPreview,"mouseout",this.instanceHandlePreviewMouseout),this.on(this.activeAnchor,"mouseover",this.instanceHandlePreviewMouseover),this.on(this.activeAnchor,"mouseout",this.instanceHandlePreviewMouseout)}});e.extensions.anchorPreview=t}(),function(){function t(t){return!e.util.getClosestTag(t,"a")}var n,r,o,i;n=[" "," ","\n","\r"," "," "," "," "," ","\u2028","\u2029"],r="com|net|org|edu|gov|mil|aero|asia|biz|cat|coop|info|int|jobs|mobi|museum|name|post|pro|tel|travel|xxx|ac|ad|ae|af|ag|ai|al|am|an|ao|aq|ar|as|at|au|aw|ax|az|ba|bb|bd|be|bf|bg|bh|bi|bj|bm|bn|bo|br|bs|bt|bv|bw|by|bz|ca|cc|cd|cf|cg|ch|ci|ck|cl|cm|cn|co|cr|cs|cu|cv|cx|cy|cz|dd|de|dj|dk|dm|do|dz|ec|ee|eg|eh|er|es|et|eu|fi|fj|fk|fm|fo|fr|ga|gb|gd|ge|gf|gg|gh|gi|gl|gm|gn|gp|gq|gr|gs|gt|gu|gw|gy|hk|hm|hn|hr|ht|hu|id|ie|il|im|in|io|iq|ir|is|it|je|jm|jo|jp|ke|kg|kh|ki|km|kn|kp|kr|kw|ky|kz|la|lb|lc|li|lk|lr|ls|lt|lu|lv|ly|ma|mc|md|me|mg|mh|mk|ml|mm|mn|mo|mp|mq|mr|ms|mt|mu|mv|mw|mx|my|mz|na|nc|ne|nf|ng|ni|nl|no|np|nr|nu|nz|om|pa|pe|pf|pg|ph|pk|pl|pm|pn|pr|ps|pt|pw|py|qa|re|ro|rs|ru|rw|sa|sb|sc|sd|se|sg|sh|si|sj|ja|sk|sl|sm|sn|so|sr|ss|st|su|sv|sx|sy|sz|tc|td|tf|tg|th|tj|tk|tl|tm|tn|to|tp|tr|tt|tv|tw|tz|ua|ug|uk|us|uy|uz|va|vc|ve|vg|vi|vn|vu|wf|ws|ye|yt|yu|za|zm|zw",o="(((?:(https?://|ftps?://|nntp://)|www\\d{0,3}[.]|[a-z0-9.\\-]+[.]("+r+")\\/)\\S+(?:[^\\s`!\\[\\]{};:'\".,?«»“”‘’])))|(([a-z0-9\\-]+\\.)?[a-z0-9\\-]+\\.("+r+"))",i=new RegExp("^("+r+")$","i");var a=e.Extension.extend({init:function(){e.Extension.prototype.init.apply(this,arguments),this.disableEventHandling=!1,this.subscribe("editableKeypress",this.onKeypress.bind(this)),this.subscribe("editableBlur",this.onBlur.bind(this)),this.document.execCommand("AutoUrlDetect",!1,!1)},isLastInstance:function(){for(var e=0,t=0;t0&&null!==a;)o=n.currentNode,i=o.nodeValue,i.length>t?(a=o.splitText(i.length-t),t=0):(a=n.previousNode(),t-=i.length);return a},performLinkingWithinElement:function(t){for(var n=this.findLinkableText(t),r=!1,o=0;o1;)o.appendChild(r.childNodes[1])}});e.extensions.autoLink=a}(),function(){function t(t){var r=e.util.getContainerEditorElement(t),o=Array.prototype.slice.call(r.parentElement.querySelectorAll("."+n));o.forEach(function(e){e.classList.remove(n)})}var n="medium-editor-dragover",r=e.Extension.extend({name:"fileDragging",allowedTypes:["image"],init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(e){e.preventDefault(),e.dataTransfer.dropEffect="copy";var r=e.target.classList?e.target:e.target.parentElement;t(r),"dragover"===e.type&&r.classList.add(n)},handleDrop:function(e){e.preventDefault(),e.stopPropagation(),this.base.selectElement(e.target);var n=this.base.exportSelection();n.start=n.end,this.base.importSelection(n),e.dataTransfer.files&&Array.prototype.slice.call(e.dataTransfer.files).forEach(function(e){this.isAllowedFile(e)&&e.type.match("image")&&this.insertImageFile(e)},this),t(e.target)},isAllowedFile:function(e){return this.allowedTypes.some(function(t){return!!e.type.match(t)})},insertImageFile:function(t){if("function"==typeof FileReader){var n=new FileReader;n.readAsDataURL(t),n.addEventListener("load",function(t){var n=this.document.createElement("img");n.src=t.target.result,e.util.insertHTMLCommand(this.document,n.outerHTML)}.bind(this))}}});e.extensions.fileDragging=r}(),function(){var t=e.Extension.extend({name:"keyboard-commands",commands:[{command:"bold",key:"B",meta:!0,shift:!1,alt:!1},{command:"italic",key:"I",meta:!0,shift:!1,alt:!1},{command:"underline",key:"U",meta:!0,shift:!1,alt:!1}],init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableKeydown",this.handleKeydown.bind(this)),this.keys={},this.commands.forEach(function(e){var t=e.key.charCodeAt(0);this.keys[t]||(this.keys[t]=[]),this.keys[t].push(e)},this)},handleKeydown:function(t){var n=e.util.getKeyCode(t);if(this.keys[n]){var r=e.util.isMetaCtrlKey(t),o=!!t.shiftKey,i=!!t.altKey;this.keys[n].forEach(function(e){e.meta!==r||e.shift!==o||e.alt!==i&&void 0!==e.alt||(t.preventDefault(),t.stopPropagation(),"function"==typeof e.command?e.command.apply(this):!1!==e.command&&this.execAction(e.command))},this)}}});e.extensions.keyboardCommands=t}(),function(){var t=e.extensions.form.extend({name:"fontname",action:"fontName",aria:"change font name",contentDefault:"±",contentFA:'',fonts:["","Arial","Verdana","Times New Roman"],init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(e){if(e.preventDefault(),e.stopPropagation(),!this.isDisplayed()){var t=this.document.queryCommandValue("fontName")+"";this.showForm(t)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return"block"===this.getForm().style.display},hideForm:function(){this.getForm().style.display="none",this.getSelect().value=""},showForm:function(e){var t=this.getSelect();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),t.value=e||"",t.focus()},destroy:function(){return this.form?(this.form.parentNode&&this.form.parentNode.removeChild(this.form),void delete this.form):!1},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontName(),this.base.checkSelection()},createForm:function(){var e,t=this.document,n=t.createElement("div"),r=t.createElement("select"),o=t.createElement("a"),i=t.createElement("a");n.className="medium-editor-toolbar-form",n.id="medium-editor-toolbar-form-fontname-"+this.getEditorId(),this.on(n,"click",this.handleFormClick.bind(this));for(var a=0;a
    ':"✓",n.appendChild(i),this.on(i,"click",this.handleSaveClick.bind(this),!0),o.setAttribute("href","#"),o.className="medium-editor-toobar-close",o.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'':"×",n.appendChild(o),this.on(o,"click",this.handleCloseClick.bind(this)),n},getSelect:function(){return this.getForm().querySelector("select.medium-editor-toolbar-select")},clearFontName:function(){e.selection.getSelectedElements(this.document).forEach(function(e){"font"===e.nodeName.toLowerCase()&&e.hasAttribute("face")&&e.removeAttribute("face")})},handleFontChange:function(){var e=this.getSelect().value;""===e?this.clearFontName():this.execAction("fontName",{name:e})},handleFormClick:function(e){e.stopPropagation()},handleSaveClick:function(e){e.preventDefault(),this.doFormSave()},handleCloseClick:function(e){e.preventDefault(),this.doFormCancel()}});e.extensions.fontName=t}(),function(){var t=e.extensions.form.extend({name:"fontsize",action:"fontSize",aria:"increase/decrease font size",contentDefault:"±",contentFA:'',init:function(){e.extensions.form.prototype.init.apply(this,arguments)},handleClick:function(e){if(e.preventDefault(),e.stopPropagation(),!this.isDisplayed()){var t=this.document.queryCommandValue("fontSize")+"";this.showForm(t)}return!1},getForm:function(){return this.form||(this.form=this.createForm()),this.form},isDisplayed:function(){return"block"===this.getForm().style.display},hideForm:function(){this.getForm().style.display="none",this.getInput().value=""},showForm:function(e){var t=this.getInput();this.base.saveSelection(),this.hideToolbarDefaultActions(),this.getForm().style.display="block",this.setToolbarPosition(),t.value=e||"",t.focus()},destroy:function(){return this.form?(this.form.parentNode&&this.form.parentNode.removeChild(this.form),void delete this.form):!1},doFormSave:function(){this.base.restoreSelection(),this.base.checkSelection()},doFormCancel:function(){this.base.restoreSelection(),this.clearFontSize(),this.base.checkSelection()},createForm:function(){var e=this.document,t=e.createElement("div"),n=e.createElement("input"),r=e.createElement("a"),o=e.createElement("a");return t.className="medium-editor-toolbar-form",t.id="medium-editor-toolbar-form-fontsize-"+this.getEditorId(),this.on(t,"click",this.handleFormClick.bind(this)),n.setAttribute("type","range"),n.setAttribute("min","1"),n.setAttribute("max","7"),n.className="medium-editor-toolbar-input",t.appendChild(n),this.on(n,"change",this.handleSliderChange.bind(this)),o.setAttribute("href","#"),o.className="medium-editor-toobar-save",o.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'':"✓",t.appendChild(o),this.on(o,"click",this.handleSaveClick.bind(this),!0),r.setAttribute("href","#"),r.className="medium-editor-toobar-close",r.innerHTML="fontawesome"===this.getEditorOption("buttonLabels")?'':"×",t.appendChild(r),this.on(r,"click",this.handleCloseClick.bind(this)),t},getInput:function(){return this.getForm().querySelector("input.medium-editor-toolbar-input")},clearFontSize:function(){e.selection.getSelectedElements(this.document).forEach(function(e){"font"===e.nodeName.toLowerCase()&&e.hasAttribute("size")&&e.removeAttribute("size")})},handleSliderChange:function(){var e=this.getInput().value;"4"===e?this.clearFontSize():this.execAction("fontSize",{size:e})},handleFormClick:function(e){e.stopPropagation()},handleSaveClick:function(e){e.preventDefault(),this.doFormSave()},handleCloseClick:function(e){e.preventDefault(),this.doFormCancel()}});e.extensions.fontSize=t}(),function(){function t(){return[[new RegExp(/<[^>]*docs-internal-guid[^>]*>/gi),""],[new RegExp(/<\/b>(]*>)?$/gi),""],[new RegExp(/\s+<\/span>/g)," "],[new RegExp(/
    /g),"
    "],[new RegExp(/]*(font-style:italic;font-weight:bold|font-weight:bold;font-style:italic)[^>]*>/gi),''],[new RegExp(/]*font-style:italic[^>]*>/gi),''],[new RegExp(/]*font-weight:bold[^>]*>/gi),''],[new RegExp(/<(\/?)(i|b|a)>/gi),"<$1$2>"],[new RegExp(/<a(?:(?!href).)+href=(?:"|”|“|"|“|”)(((?!"|”|“|"|“|”).)*)(?:"|”|“|"|“|”)(?:(?!>).)*>/gi),''],[new RegExp(/<\/p>\n+/gi),"

    "],[new RegExp(/\n+

    /gi),""],["",""],["",""]]}var n=e.Extension.extend({forcePlainText:!0,cleanPastedHTML:!1,preCleanReplacements:[],cleanReplacements:[],cleanAttrs:["class","style","dir"],cleanTags:["meta"],init:function(){e.Extension.prototype.init.apply(this,arguments),(this.forcePlainText||this.cleanPastedHTML)&&this.subscribe("editablePaste",this.handlePaste.bind(this))},handlePaste:function(t,n){var r,o,i,a,s="",u="text/html",l="text/plain";if(this.window.clipboardData&&void 0===t.clipboardData&&(t.clipboardData=this.window.clipboardData,u="Text",l="Text"),t.clipboardData&&t.clipboardData.getData&&!t.defaultPrevented){if(t.preventDefault(),i=t.clipboardData.getData(u),a=t.clipboardData.getData(l),this.cleanPastedHTML&&i)return this.cleanPaste(i);if(this.getEditorOption("disableReturn")||n.getAttribute("data-disable-return"))s=e.util.htmlEntities(a);else if(r=a.split(/[\r\n]+/g),r.length>1)for(o=0;o"+e.util.htmlEntities(r[o])+"

    ");else s=e.util.htmlEntities(r[0]);e.util.insertHTMLCommand(this.document,s)}},cleanPaste:function(e){var n,r,o,i,a=/"+e.split("

    ").join("

    ")+"

    ",r=o.querySelectorAll("a,p,div,br"),n=0;n"+r.innerHTML+"
    ":o.innerHTML=r.innerHTML,r.parentNode.replaceChild(o,r);for(i=t.querySelectorAll("span"),n=0;n0&&(r[0].classList.add(this.firstButtonClass),r[r.length-1].classList.add(this.lastButtonClass)),s},destroy:function(){this.toolbar&&(this.toolbar.parentNode&&this.toolbar.parentNode.removeChild(this.toolbar),delete this.toolbar)},getToolbarElement:function(){return this.toolbar||(this.toolbar=this.createToolbar()),this.toolbar},getToolbarActionsElement:function(){return this.getToolbarElement().querySelector(".medium-editor-toolbar-actions")},initThrottledMethods:function(){this.throttledPositionToolbar=e.util.throttle(function(){this.base.isActive&&this.positionToolbarIfShown()}.bind(this))},attachEventHandlers:function(){this.subscribe("blur",this.handleBlur.bind(this)),this.subscribe("focus",this.handleFocus.bind(this)),this.subscribe("editableClick",this.handleEditableClick.bind(this)),this.subscribe("editableKeyup",this.handleEditableKeyup.bind(this)),this.on(this.document.documentElement,"mouseup",this.handleDocumentMouseup.bind(this)),this["static"]&&this.sticky&&this.on(this.window,"scroll",this.handleWindowScroll.bind(this),!0),this.on(this.window,"resize",this.handleWindowResize.bind(this))},handleWindowScroll:function(){this.positionToolbarIfShown()},handleWindowResize:function(){this.throttledPositionToolbar()},handleDocumentMouseup:function(t){return t&&t.target&&e.util.isDescendant(this.getToolbarElement(),t.target)?!1:void this.checkState()},handleEditableClick:function(){setTimeout(function(){this.checkState()}.bind(this),0)},handleEditableKeyup:function(){this.checkState()},handleBlur:function(){clearTimeout(this.hideTimeout),clearTimeout(this.delayShowTimeout),this.hideTimeout=setTimeout(function(){this.hideToolbar()}.bind(this),1)},handleFocus:function(){this.checkState()},isDisplayed:function(){return this.getToolbarElement().classList.contains("medium-editor-toolbar-active")},showToolbar:function(){clearTimeout(this.hideTimeout),this.isDisplayed()||(this.getToolbarElement().classList.add("medium-editor-toolbar-active"),this.trigger("showToolbar",{},this.base.getFocusedElement()))},hideToolbar:function(){this.isDisplayed()&&(this.getToolbarElement().classList.remove("medium-editor-toolbar-active"),this.trigger("hideToolbar",{},this.base.getFocusedElement()))},isToolbarDefaultActionsDisplayed:function(){return"block"===this.getToolbarActionsElement().style.display},hideToolbarDefaultActions:function(){this.isToolbarDefaultActionsDisplayed()&&(this.getToolbarActionsElement().style.display="none")},showToolbarDefaultActions:function(){this.hideExtensionForms(),this.isToolbarDefaultActionsDisplayed()||(this.getToolbarActionsElement().style.display="block"),this.delayShowTimeout=this.base.delay(function(){this.showToolbar()}.bind(this))},hideExtensionForms:function(){this.forEachExtension(function(e){e.hasForm&&e.isDisplayed()&&e.hideForm()})},multipleBlockElementsSelected:function(){var t=/<[^\/>][^>]*><\/[^>]+>/gim,n=new RegExp("<("+e.util.blockContainerElementNames.join("|")+")[^>]*>","g"),r=e.selection.getSelectionHtml(this.document).replace(t,""),o=r.match(n);return!!o&&o.length>1},modifySelection:function(){var t=this.window.getSelection(),n=t.getRangeAt(0);if(this.standardizeSelectionStart&&n.startContainer.nodeValue&&n.startOffset===n.startContainer.nodeValue.length){var r=e.util.findAdjacentTextNodeWithContent(e.selection.getSelectionElement(this.window),n.startContainer,this.document);if(r){for(var o=0;0===r.nodeValue.substr(o,1).trim().length;)o+=1;n=e.selection.select(this.document,r,o,n.endContainer,n.endOffset)}}},checkState:function(){if(!this.base.preventSelectionUpdates){if(!this.base.getFocusedElement()||e.selection.selectionInContentEditableFalse(this.window))return this.hideToolbar();var t=e.selection.getSelectionElement(this.window);return!t||-1===this.getEditorElements().indexOf(t)||t.getAttribute("data-disable-toolbar")?this.hideToolbar():this.updateOnEmptySelection&&this["static"]?this.showAndUpdateToolbar():!e.selection.selectionContainsContent(this.document)||this.allowMultiParagraphSelection===!1&&this.multipleBlockElementsSelected()?this.hideToolbar():void this.showAndUpdateToolbar()}},showAndUpdateToolbar:function(){this.modifySelection(),this.setToolbarButtonStates(),this.trigger("positionToolbar",{},this.base.getFocusedElement()),this.showToolbarDefaultActions(),this.setToolbarPosition()},setToolbarButtonStates:function(){this.forEachExtension(function(e){"function"==typeof e.isActive&&"function"==typeof e.setInactive&&e.setInactive()}),this.checkActiveButtons()},checkActiveButtons:function(){var t,n=[],r=null,o=e.selection.getSelectionRange(this.document),i=function(e){"function"==typeof e.checkState?e.checkState(t):"function"==typeof e.isActive&&"function"==typeof e.isAlreadyApplied&&"function"==typeof e.setActive&&!e.isActive()&&e.isAlreadyApplied(t)&&e.setActive()};if(o&&(this.forEachExtension(function(e){return"function"==typeof e.queryCommandState&&(r=e.queryCommandState(),null!==r)?void(r&&"function"==typeof e.setActive&&e.setActive()):void n.push(e)}),t=e.selection.getSelectedParentElement(o),this.getEditorElements().some(function(n){return e.util.isDescendant(n,t,!0)})))for(;t&&(n.forEach(i),!e.util.isMediumEditorElement(t));)t=t.parentNode},positionToolbarIfShown:function(){this.isDisplayed()&&this.setToolbarPosition()},setToolbarPosition:function(){var e=this.base.getFocusedElement(),t=this.window.getSelection();return e?void(!this["static"]&&t.isCollapsed||(this.showToolbar(),this.relativeContainer||(this["static"]?this.positionStaticToolbar(e):this.positionToolbar(t)),this.trigger("positionedToolbar",{},this.base.getFocusedElement()))):this},positionStaticToolbar:function(e){this.getToolbarElement().style.left="0";var t,n=this.document.documentElement&&this.document.documentElement.scrollTop||this.document.body.scrollTop,r=this.window.innerWidth,o=this.getToolbarElement(),i=e.getBoundingClientRect(),a=i.top+n,s=i.left+i.width/2,u=o.offsetHeight,l=o.offsetWidth,c=l/2;switch(this.sticky?n>a+e.offsetHeight-u-this.stickyTopOffset?(o.style.top=a+e.offsetHeight-u+"px",o.classList.remove("medium-editor-sticky-toolbar")):n>a-u-this.stickyTopOffset?(o.classList.add("medium-editor-sticky-toolbar"),o.style.top=this.stickyTopOffset+"px"):(o.classList.remove("medium-editor-sticky-toolbar"),o.style.top=a-u+"px"):o.style.top=a-u+"px",this.align){case"left":t=i.left;break;case"right":t=i.right-l;break;case"center":t=s-c}0>t?t=0:t+l>r&&(t=r-Math.ceil(l)-1),o.style.left=t+"px"},positionToolbar:function(e){this.getToolbarElement().style.left="0",this.getToolbarElement().style.right="initial";var t=e.getRangeAt(0),n=t.getBoundingClientRect();(!n||0===n.height&&0===n.width&&t.startContainer===t.endContainer)&&(n=1===t.startContainer.nodeType&&t.startContainer.querySelector("img")?t.startContainer.querySelector("img").getBoundingClientRect():t.startContainer.getBoundingClientRect());var r=this.window.innerWidth,o=(n.left+n.right)/2,i=this.getToolbarElement(),a=i.offsetHeight,s=i.offsetWidth,u=s/2,l=50,c=this.diffLeft-u;n.topo?(i.style.left=c+u+"px",i.style.right="initial"):u>r-o?(i.style.left="auto",i.style.right=0):(i.style.left=c+o+"px",i.style.right="initial")}});e.extensions.toolbar=t}(),function(){var t=e.Extension.extend({init:function(){e.Extension.prototype.init.apply(this,arguments),this.subscribe("editableDrag",this.handleDrag.bind(this)),this.subscribe("editableDrop",this.handleDrop.bind(this))},handleDrag:function(e){var t="medium-editor-dragover";e.preventDefault(),e.dataTransfer.dropEffect="copy","dragover"===e.type?e.target.classList.add(t):"dragleave"===e.type&&e.target.classList.remove(t)},handleDrop:function(t){var n,r="medium-editor-dragover";t.preventDefault(),t.stopPropagation(),t.dataTransfer.files&&(n=Array.prototype.slice.call(t.dataTransfer.files,0),n.some(function(t){if(t.type.match("image")){var n,r;n=new FileReader,n.readAsDataURL(t),r="medium-img-"+ +new Date,e.util.insertHTMLCommand(this.document,''),n.onload=function(){var e=this.document.getElementById(r);e&&(e.removeAttribute("id"),e.removeAttribute("class"),e.src=n.result)}.bind(this)}}.bind(this))),t.target.classList.remove(r)}});e.extensions.imageDragging=t}(),function(){function t(t){var n=e.selection.getSelectionStart(this.options.ownerDocument),r=n.textContent,o=e.selection.getCaretOffsets(n);(void 0===r[o.left-1]||""===r[o.left-1].trim()||void 0!==r[o.left]&&""===r[o.left].trim())&&t.preventDefault()}function n(t,n){if(this.options.disableReturn||n.getAttribute("data-disable-return"))t.preventDefault();else if(this.options.disableDoubleReturn||n.getAttribute("data-disable-double-return")){var r=e.selection.getSelectionStart(this.options.ownerDocument);(r&&""===r.textContent.trim()&&"li"!==r.nodeName.toLowerCase()||r.previousElementSibling&&"br"!==r.previousElementSibling.nodeName.toLowerCase()&&""===r.previousElementSibling.textContent.trim())&&t.preventDefault()}}function r(t){var n=e.selection.getSelectionStart(this.options.ownerDocument),r=n&&n.nodeName.toLowerCase();"pre"===r&&(t.preventDefault(),e.util.insertHTMLCommand(this.options.ownerDocument," ")),e.util.isListItem(n)&&(t.preventDefault(),t.shiftKey?this.options.ownerDocument.execCommand("outdent",!1,null):this.options.ownerDocument.execCommand("indent",!1,null))}function o(t){var n,r=e.selection.getSelectionStart(this.options.ownerDocument),o=r.nodeName.toLowerCase(),i=/^(\s+|)?$/i,a=/h\d/i;e.util.isKey(t,[e.util.keyCode.BACKSPACE,e.util.keyCode.ENTER])&&r.previousElementSibling&&a.test(o)&&0===e.selection.getCaretOffsets(r).left?e.util.isKey(t,e.util.keyCode.BACKSPACE)&&i.test(r.previousElementSibling.innerHTML)?(r.previousElementSibling.parentNode.removeChild(r.previousElementSibling),t.preventDefault()):!this.options.disableDoubleReturn&&e.util.isKey(t,e.util.keyCode.ENTER)&&(n=this.options.ownerDocument.createElement("p"),n.innerHTML="
    ",r.previousElementSibling.parentNode.insertBefore(n,r),t.preventDefault()):e.util.isKey(t,e.util.keyCode.DELETE)&&r.nextElementSibling&&r.previousElementSibling&&!a.test(o)&&i.test(r.innerHTML)&&a.test(r.nextElementSibling.nodeName.toLowerCase())?(e.selection.moveCursor(this.options.ownerDocument,r.nextElementSibling),r.previousElementSibling.parentNode.removeChild(r),t.preventDefault()):e.util.isKey(t,e.util.keyCode.BACKSPACE)&&"li"===o&&i.test(r.innerHTML)&&!r.previousElementSibling&&!r.parentElement.previousElementSibling&&r.nextElementSibling&&"li"===r.nextElementSibling.nodeName.toLowerCase()?(n=this.options.ownerDocument.createElement("p"),n.innerHTML="
    ",r.parentElement.parentElement.insertBefore(n,r.parentElement),e.selection.moveCursor(this.options.ownerDocument,n),r.parentElement.removeChild(r),t.preventDefault()):e.util.isKey(t,e.util.keyCode.BACKSPACE)&&e.util.getClosestTag(r,"blockquote")!==!1&&0===e.selection.getCaretOffsets(r).left&&(t.preventDefault(),e.util.execFormatBlock(this.options.ownerDocument,"p"))}function i(t){var n,r=e.selection.getSelectionStart(this.options.ownerDocument);r&&(e.util.isMediumEditorElement(r)&&0===r.children.length&&!e.util.isBlockContainer(r)&&this.options.ownerDocument.execCommand("formatBlock",!1,"p"),!e.util.isKey(t,e.util.keyCode.ENTER)||e.util.isListItem(r)||e.util.isBlockContainer(r)||(n=r.nodeName.toLowerCase(),"a"===n?this.options.ownerDocument.execCommand("unlink",!1,null):t.shiftKey||t.ctrlKey||this.options.ownerDocument.execCommand("formatBlock",!1,"p")))}function a(e){e._mediumEditors||(e._mediumEditors=[null]),this.id||(this.id=e._mediumEditors.length),e._mediumEditors[this.id]=this}function s(e){e._mediumEditors&&e._mediumEditors[this.id]&&(e._mediumEditors[this.id]=null)}function u(t){t||(t=[]),"string"==typeof t&&(t=this.options.ownerDocument.querySelectorAll(t)),e.util.isElement(t)&&(t=[t]);var n=Array.prototype.slice.apply(t);this.elements=[],n.forEach(function(e,t){"textarea"===e.nodeName.toLowerCase()?this.elements.push(y.call(this,e,t)):this.elements.push(e)},this)}function l(e,t){return Object.keys(t).forEach(function(n){void 0===e[n]&&(e[n]=t[n])}),e}function c(e,t,n){var r={window:n.options.contentWindow,document:n.options.ownerDocument,base:n};return e=l(e,r),"function"==typeof e.init&&e.init(),e.name||(e.name=t),e}function f(){return this.elements.every(function(e){return!!e.getAttribute("data-disable-toolbar")})?!1:this.options.toolbar!==!1}function d(){return f.call(this)?this.options.anchorPreview!==!1:!1}function p(){return this.options.placeholder!==!1}function h(){return this.options.autoLink!==!1}function m(){return this.options.imageDragging!==!1}function v(){return this.options.keyboardCommands!==!1}function g(){return!this.options.extensions.imageDragging}function y(e,t){for(var n=this.options.ownerDocument.createElement("div"),r=Date.now(),o="medium-editor-"+r+"-"+t,i=e.attributes;this.options.ownerDocument.getElementById(o);)r++,o="medium-editor-"+r+"-"+t;n.className=e.className,n.id=o,n.innerHTML=e.value,e.setAttribute("medium-editor-textarea-id",o);for(var a=0,s=i.length;s>a;a++)n.hasAttribute(i[a].nodeName)||n.setAttribute(i[a].nodeName,i[a].nodeValue);return e.classList.add("medium-editor-hidden"),e.parentNode.insertBefore(n,e),n}function b(){var e=!1;this.elements.forEach(function(t,n){this.options.disableEditing||t.getAttribute("data-disable-editing")||(t.setAttribute("contentEditable",!0),t.setAttribute("spellcheck",this.options.spellcheck)),t.setAttribute("data-medium-editor-element",!0),t.setAttribute("role","textbox"),t.setAttribute("aria-multiline",!0),t.setAttribute("medium-editor-index",n),t.hasAttribute("medium-editor-textarea-id")&&(e=!0)},this),e&&this.subscribe("editableInput",function(e,t){var n=t.parentNode.querySelector('textarea[medium-editor-textarea-id="'+t.getAttribute("medium-editor-textarea-id")+'"]');n&&(n.value=this.serialize()[t.id].value)}.bind(this))}function x(){var e;if(this.subscribe("editableKeydownTab",r.bind(this)),this.subscribe("editableKeydownDelete",o.bind(this)),this.subscribe("editableKeydownEnter",o.bind(this)),this.options.disableExtraSpaces&&this.subscribe("editableKeydownSpace",t.bind(this)),this.options.disableReturn||this.options.disableDoubleReturn)this.subscribe("editableKeydownEnter",n.bind(this));else for(e=0;e=0&&(r=e.selection.exportSelection(t,this.options.ownerDocument)),null!==r&&0!==n&&(r.editableElementIndex=n),r},saveSelection:function(){this.selectionState=this.exportSelection()},importSelection:function(t,n){if(t){var r=this.elements[t.editableElementIndex||0];e.selection.importSelection(t,r,this.options.ownerDocument,n)}},restoreSelection:function(){this.importSelection(this.selectionState)},createLink:function(t){var n=e.selection.getSelectionElement(this.options.contentWindow),r={};if(-1!==this.elements.indexOf(n)){try{if(this.events.disableCustomEvent("editableInput"),t.url&&t.url.trim().length>0){var o=this.options.contentWindow.getSelection();if(o){var i,a,s,u,l=o.getRangeAt(0),c=l.commonAncestorContainer;if(3===l.endContainer.nodeType&&3!==l.startContainer.nodeType&&0===l.startOffset&&l.startContainer.firstChild===l.endContainer&&(c=l.endContainer),a=e.util.getClosestBlockContainer(l.startContainer),s=e.util.getClosestBlockContainer(l.endContainer),3!==c.nodeType&&0!==c.textContent.length&&a===s){var f=a||n,d=this.options.ownerDocument.createDocumentFragment();this.execAction("unlink"),i=this.exportSelection(),d.appendChild(f.cloneNode(!0)),n===f?e.selection.select(this.options.ownerDocument,f.firstChild,0,f.lastChild,3===f.lastChild.nodeType?f.lastChild.nodeValue.length:f.lastChild.childNodes.length):e.selection.select(this.options.ownerDocument,f,0,f,f.childNodes.length);var p=this.exportSelection();u=e.util.findOrCreateMatchingTextNodes(this.options.ownerDocument,d,{start:i.start-p.start,end:i.end-p.start,editableElementIndex:i.editableElementIndex}),0===u.length&&(d=this.options.ownerDocument.createDocumentFragment(),d.appendChild(c.cloneNode(!0)),u=[d.firstChild.firstChild,d.firstChild.lastChild]),e.util.createLink(this.options.ownerDocument,u,t.url.trim());var h=(d.firstChild.innerHTML.match(/^\s+/)||[""])[0].length;e.util.insertHTMLCommand(this.options.ownerDocument,d.firstChild.innerHTML.replace(/^\s+/,"")),i.start-=h,i.end-=h,this.importSelection(i)}else this.options.ownerDocument.execCommand("createLink",!1,t.url);this.options.targetBlank||"_blank"===t.target?e.util.setTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),t.url):e.util.removeTargetBlank(e.selection.getSelectionStart(this.options.ownerDocument),t.url),t.buttonClass&&e.util.addClassToAnchors(e.selection.getSelectionStart(this.options.ownerDocument),t.buttonClass)}}if(this.options.targetBlank||"_blank"===t.target||t.buttonClass){r=this.options.ownerDocument.createEvent("HTMLEvents"),r.initEvent("input",!0,!0,this.options.contentWindow);for(var m=0;m1?t[1]:"";return{major:parseInt(n[0],10),minor:parseInt(n[1],10),revision:parseInt(n[2],10),preRelease:r,toString:function(){return[n[0],n[1],n[2]].join(".")+(r?"-"+r:"")}}},e.version=e.parseVersionString.call(this,{version:"5.16.1"}.version),e}())},function(e,t){"use strict";function n(e){if(null===e||void 0===e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}var r=Object.prototype.hasOwnProperty,o=Object.prototype.propertyIsEnumerable;e.exports=Object.assign||function(e,t){for(var i,a,s=n(e),u=1;u=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}function s(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)}Object.defineProperty(t,"__esModule",{value:!0});var u=Object.assign||function(e){for(var t=1;t0||(this.setState({isDragActive:!1,isDragReject:!1}),this.props.onDragLeave&&this.props.onDragLeave.call(this,e))}},{key:"onDrop",value:function(e){e.preventDefault(),this.enterCounter=0,this.setState({isDragActive:!1,isDragReject:!1});for(var t=e.dataTransfer?e.dataTransfer.files:e.target.files,n=this.props.multiple?t.length:Math.min(t.length,1),r=[],o=0;n>o;o++){var i=t[o];this.props.disablePreview||(i.preview=window.URL.createObjectURL(i)),r.push(i)}this.props.onDrop&&this.props.onDrop.call(this,r,e),this.allFilesAccepted(r)?this.props.onDropAccepted&&this.props.onDropAccepted.call(this,r,e):this.props.onDropRejected&&this.props.onDropRejected.call(this,r,e)}},{key:"onClick",value:function(){this.props.disableClick||this.open()}},{key:"allFilesAccepted",value:function(e){var t=this;return e.every(function(e){return(0,f["default"])(e,t.props.accept)})}},{key:"open",value:function(){this.fileInputEl.value=null,this.fileInputEl.click()}},{key:"render",value:function(){var e=this,t=this.props,n=t.accept,r=t.activeClassName,i=t.inputProps,a=t.multiple,s=t.name,l=t.rejectClassName,c=o(t,["accept","activeClassName","inputProps","multiple","name","rejectClassName"]),f=c.activeStyle,d=c.className,m=c.rejectStyle,v=c.style,g=o(c,["activeStyle","className","rejectStyle","style"]),y=this.state,b=y.isDragActive,x=y.isDragReject;d=d||"",b&&r&&(d+=" "+r),x&&l&&(d+=" "+l),d||v||f||m||(v={width:200,height:200,borderWidth:2,borderColor:"#666",borderStyle:"dashed",borderRadius:5},f={borderStyle:"solid",backgroundColor:"#eee"},m={borderStyle:"solid",backgroundColor:"#ffdddd"});var A=void 0;A=f&&b?u({},v,f):m&&x?u({},v,m):u({},v);var w={accept:n,type:"file",style:{display:"none"},multiple:h&&a,ref:function(t){return e.fileInputEl=t},onChange:this.onDrop};return s&&s.length&&(w.name=s),p["default"].createElement("div",u({className:d,style:A},g,{onClick:this.onClick,onDragEnter:this.onDragEnter,onDragOver:this.onDragOver,onDragLeave:this.onDragLeave,onDrop:this.onDrop}),this.props.children,p["default"].createElement("input",u({},i,w)))}}]),t}(p["default"].Component);m.defaultProps={disablePreview:!1,disableClick:!1,multiple:!0},m.propTypes={onDrop:p["default"].PropTypes.func,onDropAccepted:p["default"].PropTypes.func,onDropRejected:p["default"].PropTypes.func,onDragEnter:p["default"].PropTypes.func,onDragLeave:p["default"].PropTypes.func,children:p["default"].PropTypes.node,style:p["default"].PropTypes.object,activeStyle:p["default"].PropTypes.object,rejectStyle:p["default"].PropTypes.object,className:p["default"].PropTypes.string,activeClassName:p["default"].PropTypes.string,rejectClassName:p["default"].PropTypes.string,disablePreview:p["default"].PropTypes.bool,disableClick:p["default"].PropTypes.bool,inputProps:p["default"].PropTypes.object,multiple:p["default"].PropTypes.bool,accept:p["default"].PropTypes.string,name:p["default"].PropTypes.string},t["default"]=m,e.exports=t["default"]},function(e,t){e.exports=function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={exports:{},id:r,loaded:!1};return e[r].call(o.exports,o,o.exports,t),o.loaded=!0,o.exports}var n={};return t.m=e,t.c=n,t.p="",t(0)}([function(e,t,n){"use strict";t.__esModule=!0,n(8),n(9),t["default"]=function(e,t){if(e&&t){var n=function(){var n=t.split(","),r=e.name||"",o=e.type||"",i=o.replace(/\/.*$/,"");return{v:n.some(function(e){var t=e.trim();return"."===t.charAt(0)?r.toLowerCase().endsWith(t.toLowerCase()):/\/\*$/.test(t)?i===t.replace(/\/.*$/,""):o===t})}}();if("object"==typeof n)return n.v}return!0},e.exports=t["default"]},function(e,t){var n=e.exports={version:"1.2.2"};"number"==typeof __e&&(__e=n)},function(e,t){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(e,t,n){var r=n(2),o=n(1),i=n(4),a=n(19),s="prototype",u=function(e,t){return function(){return e.apply(t,arguments)}},l=function(e,t,n){var c,f,d,p,h=e&l.G,m=e&l.P,v=h?r:e&l.S?r[t]||(r[t]={}):(r[t]||{})[s],g=h?o:o[t]||(o[t]={});h&&(n=t);for(c in n)f=!(e&l.F)&&v&&c in v,d=(f?v:n)[c],p=e&l.B&&f?u(d,r):m&&"function"==typeof d?u(Function.call,d):d,v&&!f&&a(v,c,d),g[c]!=d&&i(g,c,p),m&&((g[s]||(g[s]={}))[c]=d)};r.core=o,l.F=1,l.G=2,l.S=4,l.P=8,l.B=16,l.W=32,e.exports=l},function(e,t,n){var r=n(5),o=n(18);e.exports=n(22)?function(e,t,n){return r.setDesc(e,t,o(1,n))}:function(e,t,n){return e[t]=n,e}},function(e,t){var n=Object;e.exports={create:n.create,getProto:n.getPrototypeOf,isEnum:{}.propertyIsEnumerable,getDesc:n.getOwnPropertyDescriptor,setDesc:n.defineProperty,setDescs:n.defineProperties,getKeys:n.keys,getNames:n.getOwnPropertyNames,getSymbols:n.getOwnPropertySymbols,each:[].forEach}},function(e,t){var n=0,r=Math.random();e.exports=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++n+r).toString(36))}},function(e,t,n){var r=n(20)("wks"),o=n(2).Symbol;e.exports=function(e){return r[e]||(r[e]=o&&o[e]||(o||n(6))("Symbol."+e))}},function(e,t,n){n(26),e.exports=n(1).Array.some},function(e,t,n){n(25),e.exports=n(1).String.endsWith},function(e,t){e.exports=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e}},function(e,t){var n={}.toString;e.exports=function(e){return n.call(e).slice(8,-1)}},function(e,t,n){var r=n(10);e.exports=function(e,t,n){if(r(e),void 0===t)return e;switch(n){case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,o){return e.call(t,n,r,o)}}return function(){return e.apply(t,arguments)}}},function(e,t){e.exports=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e}},function(e,t,n){e.exports=function(e){var t=/./;try{"/./"[e](t)}catch(r){try{return t[n(7)("match")]=!1,!"/./"[e](t)}catch(o){}}return!0}},function(e,t){e.exports=function(e){try{return!!e()}catch(t){return!0}}},function(e,t){e.exports=function(e){return"object"==typeof e?null!==e:"function"==typeof e}},function(e,t,n){var r=n(16),o=n(11),i=n(7)("match");e.exports=function(e){var t;return r(e)&&(void 0!==(t=e[i])?!!t:"RegExp"==o(e))}},function(e,t){e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},function(e,t,n){var r=n(2),o=n(4),i=n(6)("src"),a="toString",s=Function[a],u=(""+s).split(a);n(1).inspectSource=function(e){return s.call(e)},(e.exports=function(e,t,n,a){"function"==typeof n&&(o(n,i,e[t]?""+e[t]:u.join(String(t))),"name"in n||(n.name=t)),e===r?e[t]=n:(a||delete e[t],o(e,t,n))})(Function.prototype,a,function(){return"function"==typeof this&&this[i]||s.call(this)})},function(e,t,n){var r=n(2),o="__core-js_shared__",i=r[o]||(r[o]={});e.exports=function(e){return i[e]||(i[e]={})}},function(e,t,n){var r=n(17),o=n(13);e.exports=function(e,t,n){if(r(t))throw TypeError("String#"+n+" doesn't accept regex!");return String(o(e))}},function(e,t,n){e.exports=!n(15)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(e,t){var n=Math.ceil,r=Math.floor;e.exports=function(e){return isNaN(e=+e)?0:(e>0?r:n)(e)}},function(e,t,n){var r=n(23),o=Math.min;e.exports=function(e){return e>0?o(r(e),9007199254740991):0}},function(e,t,n){"use strict";var r=n(3),o=n(24),i=n(21),a="endsWith",s=""[a];r(r.P+r.F*n(14)(a),"String",{endsWith:function(e){var t=i(this,e,a),n=arguments,r=n.length>1?n[1]:void 0,u=o(t.length),l=void 0===r?u:Math.min(o(r),u),c=String(e);return s?s.call(t,c,l):t.slice(l-c.length,l)===c}})},function(e,t,n){var r=n(5),o=n(3),i=n(1).Array||Array,a={},s=function(e,t){r.each.call(e.split(","),function(e){void 0==t&&e in i?a[e]=i[e]:e in[]&&(a[e]=n(12)(Function.call,[][e],t))})};s("pop,reverse,shift,keys,values,entries",1),s("indexOf,every,some,forEach,map,filter,find,findIndex,includes",3),s("join,slice,concat,push,splice,unshift,sort,lastIndexOf,reduce,reduceRight,copyWithin,fill"),o(o.S,"Array",a)}])},function(t,n){t.exports=e}])})},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){for(var n=Object.getOwnPropertyNames(t),r=0;r=0&&n, "+('or explicitly pass "store" as a prop to "'+n+'".'));var u=a.store.getState();return a.state={storeState:u},a.clearCache(),a}return a(s,r),s.prototype.shouldComponentUpdate=function(){return!b||this.haveOwnPropsChanged||this.hasStoreStateChanged},s.prototype.computeStateProps=function(e,t){if(!this.finalMapStateToProps)return this.configureFinalMapState(e,t);var n=e.getState(),r=this.doStatePropsDependOnOwnProps?this.finalMapStateToProps(n,t):this.finalMapStateToProps(n);return r},s.prototype.configureFinalMapState=function(e,t){var n=d(e.getState(),t),r="function"==typeof n;return this.finalMapStateToProps=r?n:d,this.doStatePropsDependOnOwnProps=1!==this.finalMapStateToProps.length,r?this.computeStateProps(e,t):n},s.prototype.computeDispatchProps=function(e,t){if(!this.finalMapDispatchToProps)return this.configureFinalMapDispatch(e,t);var n=e.dispatch,r=this.doDispatchPropsDependOnOwnProps?this.finalMapDispatchToProps(n,t):this.finalMapDispatchToProps(n);return r},s.prototype.configureFinalMapDispatch=function(e,t){var n=h(e.dispatch,t),r="function"==typeof n;return this.finalMapDispatchToProps=r?n:h,this.doDispatchPropsDependOnOwnProps=1!==this.finalMapDispatchToProps.length,r?this.computeDispatchProps(e,t):n},s.prototype.updateStatePropsIfNeeded=function(){var e=this.computeStateProps(this.store,this.props);return this.stateProps&&(0,m["default"])(e,this.stateProps)?!1:(this.stateProps=e,!0)},s.prototype.updateDispatchPropsIfNeeded=function(){var e=this.computeDispatchProps(this.store,this.props);return this.dispatchProps&&(0,m["default"])(e,this.dispatchProps)?!1:(this.dispatchProps=e,!0)},s.prototype.updateMergedPropsIfNeeded=function(){var e=t(this.stateProps,this.dispatchProps,this.props);return this.mergedProps&&M&&(0,m["default"])(e,this.mergedProps)?!1:(this.mergedProps=e,!0)},s.prototype.isSubscribed=function(){return"function"==typeof this.unsubscribe},s.prototype.trySubscribe=function(){l&&!this.unsubscribe&&(this.unsubscribe=this.store.subscribe(this.handleChange.bind(this)),this.handleChange())},s.prototype.tryUnsubscribe=function(){this.unsubscribe&&(this.unsubscribe(),this.unsubscribe=null)},s.prototype.componentDidMount=function(){this.trySubscribe()},s.prototype.componentWillReceiveProps=function(e){b&&(0,m["default"])(e,this.props)||(this.haveOwnPropsChanged=!0)},s.prototype.componentWillUnmount=function(){this.tryUnsubscribe(),this.clearCache()},s.prototype.clearCache=function(){this.dispatchProps=null,this.stateProps=null,this.mergedProps=null,this.haveOwnPropsChanged=!0,this.hasStoreStateChanged=!0,this.haveStatePropsBeenPrecalculated=!1,this.statePropsPrecalculationError=null,this.renderedElement=null,this.finalMapDispatchToProps=null,this.finalMapStateToProps=null},s.prototype.handleChange=function(){if(this.unsubscribe){var e=this.store.getState(),t=this.state.storeState;if(!b||t!==e){if(b&&!this.doStatePropsDependOnOwnProps){var n=u(this.updateStatePropsIfNeeded,this);if(!n)return;n===E&&(this.statePropsPrecalculationError=E.value),this.haveStatePropsBeenPrecalculated=!0}this.hasStoreStateChanged=!0,this.setState({storeState:e})}}},s.prototype.getWrappedInstance=function(){return(0,k["default"])(w,"To access the wrapped instance, you need to specify { withRef: true } as the fourth argument of the connect() call."),this.refs.wrappedInstance},s.prototype.render=function(){var t=this.haveOwnPropsChanged,n=this.hasStoreStateChanged,r=this.haveStatePropsBeenPrecalculated,o=this.statePropsPrecalculationError,i=this.renderedElement;if(this.haveOwnPropsChanged=!1,this.hasStoreStateChanged=!1,this.haveStatePropsBeenPrecalculated=!1,this.statePropsPrecalculationError=null,o)throw o;var a=!0,s=!0;b&&i&&(a=n||t&&this.doStatePropsDependOnOwnProps,s=t&&this.doDispatchPropsDependOnOwnProps);var u=!1,l=!1;r?u=!0:a&&(u=this.updateStatePropsIfNeeded()),s&&(l=this.updateDispatchPropsIfNeeded());var d=!0;return d=u||l||t?this.updateMergedPropsIfNeeded():!1,!d&&i?i:(w?this.renderedElement=(0,f.createElement)(e,c({},this.mergedProps,{ref:"wrappedInstance"})):this.renderedElement=(0,f.createElement)(e,this.mergedProps),this.renderedElement)},s}(f.Component);return r.displayName=n,r.WrappedComponent=e,r.contextTypes={store:p["default"]},r.propTypes={store:p["default"]},(0,A["default"])(r,e)}}var c=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e){return!e||!e.__v2_compatible__}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;ti;i++)o[i]=arguments[i];if(e.apply(t,o),e.lengtht;++t)e[t].onLeave&&e[t].onLeave.call(e[t])}t.__esModule=!0,t.runEnterHooks=u,t.runChangeHooks=l,t.runLeaveHooks=c;var f=n(56),d=n(5);r(d)},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=Object.assign||function(e){for(var t=1;tn;n++)t[n]=arguments[n];var r=t.map(function(e){return e.renderRouterContext}).filter(function(e){return e}),s=t.map(function(e){return e.renderRouteComponent}).filter(function(e){return e}),l=function(){var e=arguments.length<=0||void 0===arguments[0]?i.createElement:arguments[0];return function(t,n){return s.reduceRight(function(e,t){return t(e,n)},e(t,n))}};return function(e){return r.reduceRight(function(t,n){return n(t,e)},a["default"].createElement(u["default"],o({},e,{createElement:l(e.createElement)})))}},e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(260),i=r(o),a=n(102),s=r(a);t["default"]=s["default"](i["default"]),e.exports=t["default"]},function(e,t,n){"use strict";function r(e,t,n){if(!e.path)return!1;var r=i.getParamNames(e.path);return r.some(function(e){return t.params[e]!==n.params[e]})}function o(e,t){var n=e&&e.routes,o=t.routes,i=void 0,a=void 0,s=void 0;return n?!function(){var u=!1;i=n.filter(function(n){if(u)return!0;var i=-1===o.indexOf(n)||r(n,e,t);return i&&(u=!0),i}),i.reverse(),s=[],a=[],o.forEach(function(e){var t=-1===n.indexOf(e),r=-1!==i.indexOf(e);t||r?s.push(e):a.push(e)})}():(i=[],a=[],s=o),{leaveRoutes:i,changeRoutes:a,enterRoutes:s}}t.__esModule=!0;var i=n(27);t["default"]=o, +e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t,n){if(t.component||t.components)return void n(null,t.component||t.components);var r=t.getComponent||t.getComponents;if(!r)return void n();var o=e.location,i=void 0;i=a({},e,o),r.call(t,i,n)}function i(e,t){s.mapAsync(e.routes,function(t,n,r){o(e,t,r)},t)}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;ta;++a){var l=t[a],c=l.path||"";if("/"===c.charAt(0)&&(r=e,o=[],i=[]),null!==r&&c){var f=u.matchPattern(c,r);if(r=f.remainingPathname,o=[].concat(o,f.paramNames),i=[].concat(i,f.paramValues),""===r)return o.every(function(e,t){return String(i[t])===String(n[e])})}}return!1}function a(e,t){return null==t?null==e:null==e?!0:r(e,t)}function s(e,t,n,r,s){var u=e.pathname,l=e.query;return null==n?!1:("/"!==u.charAt(0)&&(u="/"+u),o(u,n.pathname)||!t&&i(u,r,s)?a(l,n.query):!1)}t.__esModule=!0,t["default"]=s;var u=n(27);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n={};for(var r in e)t.indexOf(r)>=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e,t){var n=e.history,r=e.routes,i=e.location,s=o(e,["history","routes","location"]);n||i?void 0:u["default"](!1),n=n?n:c["default"](s);var l=d["default"](n,p.createRoutes(r)),f=void 0;i?i=n.createLocation(i):f=n.listen(function(e){i=e});var m=h.createRouterObject(n,l);n=h.createRoutingHistory(n,l),l.match(i,function(e,r,o){t(e,r,o&&a({},o,{history:n,router:m,matchContext:{history:n,transitionManager:l,router:m}})),f&&f()})}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;t=0||Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=e[r]);return n}function i(e){return function(){var t=arguments.length<=0||void 0===arguments[0]?{}:arguments[0],n=t.routes,r=o(t,["routes"]),i=u["default"](e)(r),s=c["default"](i,n);return a({},i,s)}}t.__esModule=!0;var a=Object.assign||function(e){for(var t=1;ta&&l;)l=!1,t.call(this,a++,i,o);return u=!1,s?void n.apply(this,c):void(a>=e&&l&&(s=!0,n()))}}var a=0,s=!1,u=!1,l=!1,c=void 0;i()}t.__esModule=!0;var r=Array.prototype.slice;t.loopAsync=n},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(){function e(e){e=e||window.history.state||{};var t=f.getWindowPath(),n=e,r=n.key,o=void 0;r?o=d.readState(r):(o=null,r=b.createKey(),g&&window.history.replaceState(i({},e,{key:r}),null));var a=l.parsePath(t);return b.createLocation(i({},a,{state:o}),void 0,r)}function t(t){function n(t){void 0!==t.state&&r(e(t.state))}var r=t.transitionTo;return f.addEventListener(window,"popstate",n),function(){f.removeEventListener(window,"popstate",n)}}function n(e){var t=e.basename,n=e.pathname,r=e.search,o=e.hash,i=e.state,a=e.action,s=e.key;if(a!==u.POP){d.saveState(s,i);var l=(t||"")+n+r+o,c={key:s};if(a===u.PUSH){if(y)return window.location.href=l,!1;window.history.pushState(c,null,l)}else{if(y)return window.location.replace(l),!1;window.history.replaceState(c,null,l)}}}function r(e){1===++x&&(A=t(b));var n=b.listenBefore(e);return function(){n(),0===--x&&A()}}function o(e){1===++x&&(A=t(b));var n=b.listen(e);return function(){n(),0===--x&&A()}}function a(e){1===++x&&(A=t(b)),b.registerTransitionHook(e)}function p(e){b.unregisterTransitionHook(e),0===--x&&A()}var m=arguments.length<=0||void 0===arguments[0]?{}:arguments[0];c.canUseDOM?void 0:s["default"](!1);var v=m.forceRefresh,g=f.supportsHistory(),y=!g||v,b=h["default"](i({},m,{getCurrentLocation:e,finishTransition:n,saveState:d.saveState})),x=0,A=void 0;return i({},b,{listenBefore:r,listen:o,registerTransitionHook:a,unregisterTransitionHook:p})}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t=0&&t=0&&v8&&11>=k),T=32,E=String.fromCharCode(T),N=p.topLevelTypes,M={beforeInput:{phasedRegistrationNames:{bubbled:b({onBeforeInput:null}),captured:b({onBeforeInputCapture:null})},dependencies:[N.topCompositionEnd,N.topKeyPress,N.topTextInput,N.topPaste]},compositionEnd:{phasedRegistrationNames:{bubbled:b({onCompositionEnd:null}),captured:b({onCompositionEndCapture:null})},dependencies:[N.topBlur,N.topCompositionEnd,N.topKeyDown,N.topKeyPress,N.topKeyUp,N.topMouseDown]},compositionStart:{phasedRegistrationNames:{bubbled:b({onCompositionStart:null}),captured:b({onCompositionStartCapture:null})},dependencies:[N.topBlur,N.topCompositionStart,N.topKeyDown,N.topKeyPress,N.topKeyUp,N.topMouseDown]},compositionUpdate:{phasedRegistrationNames:{bubbled:b({onCompositionUpdate:null}),captured:b({onCompositionUpdateCapture:null})},dependencies:[N.topBlur,N.topCompositionUpdate,N.topKeyDown,N.topKeyPress,N.topKeyUp,N.topMouseDown]}},S=!1,O=null,L={eventTypes:M,extractEvents:function(e,t,n,r,o){return[l(e,t,n,r,o),d(e,t,n,r,o)]}};e.exports=L},function(e,t,n){"use strict";var r=n(110),o=n(6),i=n(12),a=(n(200),n(310)),s=n(205),u=n(209),l=(n(3),u(function(e){return s(e)})),c=!1,f="cssFloat";if(o.canUseDOM){var d=document.createElement("div").style;try{d.font=""}catch(p){c=!0}void 0===document.documentElement.style.cssFloat&&(f="styleFloat")}var h={createMarkupForStyles:function(e){var t="";for(var n in e)if(e.hasOwnProperty(n)){var r=e[n];null!=r&&(t+=l(n)+":",t+=a(n,r)+";")}return t||null},setValueForStyles:function(e,t){var n=e.style;for(var o in t)if(t.hasOwnProperty(o)){var i=a(o,t[o]);if("float"===o&&(o=f),i)n[o]=i;else{var s=c&&r.shorthandPropertyExpansions[o];if(s)for(var u in s)n[u]="";else n[o]=""}}}};i.measureMethods(h,"CSSPropertyOperations",{setValueForStyles:"setValueForStyles"}),e.exports=h},function(e,t,n){"use strict";function r(e){var t=e.nodeName&&e.nodeName.toLowerCase();return"select"===t||"input"===t&&"file"===e.type}function o(e){var t=k.getPooled(M.change,O,e,P(e));x.accumulateTwoPhaseDispatches(t),w.batchedUpdates(i,t)}function i(e){b.enqueueEvents(e),b.processEventQueue(!1)}function a(e,t){S=e,O=t,S.attachEvent("onchange",o)}function s(){S&&(S.detachEvent("onchange",o),S=null,O=null)}function u(e,t,n){return e===N.topChange?n:void 0}function l(e,t,n){e===N.topFocus?(s(),a(t,n)):e===N.topBlur&&s()}function c(e,t){S=e,O=t,L=e.value,j=Object.getOwnPropertyDescriptor(e.constructor.prototype,"value"),Object.defineProperty(S,"value",I),S.attachEvent("onpropertychange",d)}function f(){S&&(delete S.value,S.detachEvent("onpropertychange",d),S=null,O=null,L=null,j=null)}function d(e){if("value"===e.propertyName){var t=e.srcElement.value;t!==L&&(L=t,o(e))}}function p(e,t,n){return e===N.topInput?n:void 0}function h(e,t,n){e===N.topFocus?(f(),c(t,n)):e===N.topBlur&&f()}function m(e,t,n){return e!==N.topSelectionChange&&e!==N.topKeyUp&&e!==N.topKeyDown||!S||S.value===L?void 0:(L=S.value,O)}function v(e){return e.nodeName&&"input"===e.nodeName.toLowerCase()&&("checkbox"===e.type||"radio"===e.type)}function g(e,t,n){return e===N.topClick?n:void 0}var y=n(16),b=n(32),x=n(33),A=n(6),w=n(13),k=n(25),P=n(72),C=n(75),T=n(137),E=n(19),N=y.topLevelTypes,M={change:{phasedRegistrationNames:{bubbled:E({onChange:null}),captured:E({onChangeCapture:null})},dependencies:[N.topBlur,N.topChange,N.topClick,N.topFocus,N.topInput,N.topKeyDown,N.topKeyUp,N.topSelectionChange]}},S=null,O=null,L=null,j=null,R=!1;A.canUseDOM&&(R=C("change")&&(!("documentMode"in document)||document.documentMode>8));var D=!1;A.canUseDOM&&(D=C("input")&&(!("documentMode"in document)||document.documentMode>9));var I={get:function(){return j.get.call(this)},set:function(e){L=""+e,j.set.call(this,e)}},z={eventTypes:M,extractEvents:function(e,t,n,o,i){var a,s;if(r(t)?R?a=u:s=l:T(t)?D?a=p:(a=m,s=h):v(t)&&(a=g),a){var c=a(e,t,n);if(c){var f=k.getPooled(M.change,c,o,i);return f.type="change",x.accumulateTwoPhaseDispatches(f),f}}s&&s(e,t,n)}};e.exports=z},function(e,t){"use strict";var n=0,r={createReactRootIndex:function(){return n++}};e.exports=r},function(e,t,n){"use strict";function r(e){return e.substring(1,e.indexOf(" "))}var o=n(6),i=n(202),a=n(15),s=n(87),u=n(1),l=/^(<[^ \/>]+)/,c="data-danger-index",f={dangerouslyRenderMarkup:function(e){o.canUseDOM?void 0:u(!1);for(var t,n={},f=0;fe&&n[e]===o[e];e++);var a=r-e;for(t=1;a>=t&&n[r-t]===o[i-t];t++);var s=t>1?1-t:void 0;return this._fallbackText=o.slice(e,s),this._fallbackText}}),o.addPoolingTo(r),e.exports=r},function(e,t,n){"use strict";var r,o=n(29),i=n(6),a=o.injection.MUST_USE_ATTRIBUTE,s=o.injection.MUST_USE_PROPERTY,u=o.injection.HAS_BOOLEAN_VALUE,l=o.injection.HAS_SIDE_EFFECTS,c=o.injection.HAS_NUMERIC_VALUE,f=o.injection.HAS_POSITIVE_NUMERIC_VALUE,d=o.injection.HAS_OVERLOADED_BOOLEAN_VALUE;if(i.canUseDOM){var p=document.implementation;r=p&&p.hasFeature&&p.hasFeature("http://www.w3.org/TR/SVG11/feature#BasicStructure","1.1")}var h={isCustomAttribute:RegExp.prototype.test.bind(/^(data|aria)-[a-z_][a-z\d_.\-]*$/),Properties:{accept:null,acceptCharset:null,accessKey:null,action:null,allowFullScreen:a|u,allowTransparency:a,alt:null,async:u,autoComplete:null,autoPlay:u,capture:a|u,cellPadding:null,cellSpacing:null,charSet:a,challenge:a,checked:s|u,classID:a,className:r?a:s,cols:a|f,colSpan:null,content:null,contentEditable:null,contextMenu:a,controls:s|u,coords:null,crossOrigin:null,data:null,dateTime:a,"default":u,defer:u,dir:null,disabled:a|u,download:d,draggable:null,encType:null,form:a,formAction:a,formEncType:a,formMethod:a,formNoValidate:u,formTarget:a,frameBorder:a,headers:null,height:a,hidden:a|u,high:null,href:null,hrefLang:null,htmlFor:null,httpEquiv:null,icon:null,id:s,inputMode:a,integrity:null,is:a,keyParams:a,keyType:a,kind:null,label:null,lang:null,list:a,loop:s|u,low:null,manifest:a,marginHeight:null,marginWidth:null,max:null,maxLength:a,media:a,mediaGroup:null,method:null,min:null,minLength:a,multiple:s|u,muted:s|u,name:null,nonce:a,noValidate:u,open:u,optimum:null,pattern:null,placeholder:null,poster:null,preload:null,radioGroup:null,readOnly:s|u,rel:null,required:u,reversed:u,role:a,rows:a|f,rowSpan:null,sandbox:null,scope:null,scoped:u,scrolling:null,seamless:a|u,selected:s|u,shape:null,size:a|f,sizes:a,span:f,spellCheck:null,src:null,srcDoc:s,srcLang:null,srcSet:a,start:c,step:null,style:null,summary:null,tabIndex:null,target:null,title:null,type:null,useMap:null,value:s|l,width:a,wmode:a,wrap:null,about:a,datatype:a,inlist:a,prefix:a,property:a,resource:a,"typeof":a,vocab:a,autoCapitalize:a,autoCorrect:a,autoSave:null,color:null,itemProp:a,itemScope:a|u,itemType:a,itemID:a,itemRef:a,results:null,security:a,unselectable:a},DOMAttributeNames:{acceptCharset:"accept-charset",className:"class",htmlFor:"for",httpEquiv:"http-equiv"},DOMPropertyNames:{autoComplete:"autocomplete",autoFocus:"autofocus",autoPlay:"autoplay",autoSave:"autosave",encType:"encoding",hrefLang:"hreflang",radioGroup:"radiogroup",spellCheck:"spellcheck",srcDoc:"srcdoc",srcSet:"srcset"}};e.exports=h},function(e,t,n){"use strict";var r=n(116),o=n(284),i=n(289),a=n(4),s=n(311),u={};a(u,i),a(u,{findDOMNode:s("findDOMNode","ReactDOM","react-dom",r,r.findDOMNode),render:s("render","ReactDOM","react-dom",r,r.render),unmountComponentAtNode:s("unmountComponentAtNode","ReactDOM","react-dom",r,r.unmountComponentAtNode),renderToString:s("renderToString","ReactDOMServer","react-dom/server",o,o.renderToString),renderToStaticMarkup:s("renderToStaticMarkup","ReactDOMServer","react-dom/server",o,o.renderToStaticMarkup)}),u.__SECRET_DOM_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=r,u.__SECRET_DOM_SERVER_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=o,e.exports=u},function(e,t,n){"use strict";var r=(n(34),n(69)),o=(n(3),"_getDOMNodeDidWarn"),i={getDOMNode:function(){return this.constructor[o]=!0,r(this)}};e.exports=i},function(e,t,n){"use strict";function r(e,t,n){var r=void 0===e[n];null!=t&&r&&(e[n]=i(t,null))}var o=n(24),i=n(74),a=n(77),s=n(78),u=(n(3),{instantiateChildren:function(e,t,n){if(null==e)return null;var o={};return s(e,r,o),o},updateChildren:function(e,t,n,r){if(!t&&!e)return null;var s;for(s in t)if(t.hasOwnProperty(s)){var u=e&&e[s],l=u&&u._currentElement,c=t[s];if(null!=u&&a(l,c))o.receiveComponent(u,c,n,r),t[s]=u;else{u&&o.unmountComponent(u,s);var f=i(c,null);t[s]=f}}for(s in e)!e.hasOwnProperty(s)||t&&t.hasOwnProperty(s)||o.unmountComponent(e[s]);return t},unmountChildren:function(e){for(var t in e)if(e.hasOwnProperty(t)){var n=e[t];o.unmountComponent(n)}}});e.exports=u},function(e,t,n){"use strict";function r(e){var t=e._currentElement._owner||null;if(t){var n=t.getName();if(n)return" Check the render method of `"+n+"`."}return""}function o(e){}var i=n(65),a=n(17),s=n(11),u=n(34),l=n(12),c=n(46),f=(n(45),n(24)),d=n(67),p=n(4),h=n(31),m=n(1),v=n(77);n(3);o.prototype.render=function(){var e=u.get(this)._currentElement.type;return e(this.props,this.context,this.updater)};var g=1,y={construct:function(e){this._currentElement=e,this._rootNodeID=null,this._instance=null,this._pendingElement=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._renderedComponent=null,this._context=null,this._mountOrder=0,this._topLevelWrapper=null,this._pendingCallbacks=null},mountComponent:function(e,t,n){this._context=n,this._mountOrder=g++,this._rootNodeID=e;var r,i,a=this._processProps(this._currentElement.props),l=this._processContext(n),c=this._currentElement.type,p="prototype"in c;p&&(r=new c(a,l,d)),p&&null!==r&&r!==!1&&!s.isValidElement(r)||(i=r,r=new o(c)),r.props=a,r.context=l,r.refs=h,r.updater=d,this._instance=r,u.set(r,this);var v=r.state;void 0===v&&(r.state=v=null),"object"!=typeof v||Array.isArray(v)?m(!1):void 0,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,r.componentWillMount&&(r.componentWillMount(),this._pendingStateQueue&&(r.state=this._processPendingState(r.props,r.context))),void 0===i&&(i=this._renderValidatedComponent()),this._renderedComponent=this._instantiateReactComponent(i);var y=f.mountComponent(this._renderedComponent,e,t,this._processChildContext(n));return r.componentDidMount&&t.getReactMountReady().enqueue(r.componentDidMount,r),y},unmountComponent:function(){var e=this._instance;e.componentWillUnmount&&e.componentWillUnmount(),f.unmountComponent(this._renderedComponent),this._renderedComponent=null,this._instance=null,this._pendingStateQueue=null,this._pendingReplaceState=!1,this._pendingForceUpdate=!1,this._pendingCallbacks=null,this._pendingElement=null,this._context=null,this._rootNodeID=null,this._topLevelWrapper=null,u.remove(e)},_maskContext:function(e){var t=null,n=this._currentElement.type,r=n.contextTypes;if(!r)return h;t={};for(var o in r)t[o]=e[o];return t},_processContext:function(e){var t=this._maskContext(e);return t},_processChildContext:function(e){var t=this._currentElement.type,n=this._instance,r=n.getChildContext&&n.getChildContext();if(r){"object"!=typeof t.childContextTypes?m(!1):void 0;for(var o in r)o in t.childContextTypes?void 0:m(!1);return p({},e,r)}return e},_processProps:function(e){return e},_checkPropTypes:function(e,t,n){var o=this.getName();for(var i in e)if(e.hasOwnProperty(i)){var a;try{"function"!=typeof e[i]?m(!1):void 0,a=e[i](t,i,o,n)}catch(s){a=s}if(a instanceof Error){r(this);n===c.prop}}},receiveComponent:function(e,t,n){var r=this._currentElement,o=this._context;this._pendingElement=null,this.updateComponent(t,r,e,o,n)},performUpdateIfNecessary:function(e){null!=this._pendingElement&&f.receiveComponent(this,this._pendingElement||this._currentElement,e,this._context),(null!==this._pendingStateQueue||this._pendingForceUpdate)&&this.updateComponent(e,this._currentElement,this._currentElement,this._context,this._context)},updateComponent:function(e,t,n,r,o){var i,a=this._instance,s=this._context===o?a.context:this._processContext(o);t===n?i=n.props:(i=this._processProps(n.props),a.componentWillReceiveProps&&a.componentWillReceiveProps(i,s));var u=this._processPendingState(i,s),l=this._pendingForceUpdate||!a.shouldComponentUpdate||a.shouldComponentUpdate(i,u,s);l?(this._pendingForceUpdate=!1,this._performComponentUpdate(n,i,u,s,e,o)):(this._currentElement=n,this._context=o,a.props=i,a.state=u,a.context=s)},_processPendingState:function(e,t){var n=this._instance,r=this._pendingStateQueue,o=this._pendingReplaceState;if(this._pendingReplaceState=!1,this._pendingStateQueue=null,!r)return n.state;if(o&&1===r.length)return r[0];for(var i=p({},o?r[0]:n.state),a=o?1:0;a=0||null!=t.is}function v(e){h(e),this._tag=e.toLowerCase(),this._renderedChildren=null,this._previousStyle=null,this._previousStyleCopy=null,this._rootNodeID=null,this._wrapperState=null,this._topLevelWrapper=null,this._nodeWithLegacyProperties=null}var g=n(263),y=n(265),b=n(29),x=n(62),A=n(16),w=n(44),k=n(64),P=n(278),C=n(281),T=n(282),E=n(118),N=n(285),M=n(8),S=n(290),O=n(12),L=n(67),j=n(4),R=n(49),D=n(50),I=n(1),z=(n(75),n(19)),H=n(51),W=n(76),F=(n(88),n(79),n(3),w.deleteListener),q=w.listenTo,U=w.registrationNameModules,X={string:!0,number:!0},V=z({children:null}),B=z({style:null}),Z=z({__html:null}),G=1,J={topAbort:"abort",topCanPlay:"canplay",topCanPlayThrough:"canplaythrough",topDurationChange:"durationchange",topEmptied:"emptied",topEncrypted:"encrypted",topEnded:"ended",topError:"error",topLoadedData:"loadeddata",topLoadedMetadata:"loadedmetadata",topLoadStart:"loadstart",topPause:"pause",topPlay:"play",topPlaying:"playing",topProgress:"progress",topRateChange:"ratechange",topSeeked:"seeked",topSeeking:"seeking",topStalled:"stalled",topSuspend:"suspend",topTimeUpdate:"timeupdate",topVolumeChange:"volumechange",topWaiting:"waiting"},K={area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0},Y={listing:!0,pre:!0,textarea:!0},Q=(j({menuitem:!0},K),/^[a-zA-Z][a-zA-Z:_\.\-\d]*$/),_={},$={}.hasOwnProperty;v.displayName="ReactDOMComponent",v.Mixin={construct:function(e){this._currentElement=e},mountComponent:function(e,t,n){this._rootNodeID=e;var r=this._currentElement.props;switch(this._tag){case"iframe":case"img":case"form":case"video":case"audio":this._wrapperState={listeners:null},t.getReactMountReady().enqueue(f,this);break;case"button":r=P.getNativeProps(this,r,n);break;case"input":C.mountWrapper(this,r,n),r=C.getNativeProps(this,r,n);break;case"option":T.mountWrapper(this,r,n),r=T.getNativeProps(this,r,n);break;case"select":E.mountWrapper(this,r,n),r=E.getNativeProps(this,r,n),n=E.processChildContext(this,r,n);break;case"textarea":N.mountWrapper(this,r,n),r=N.getNativeProps(this,r,n)}u(this,r);var o;if(t.useCreateElement){var i=n[M.ownerDocumentContextKey],a=i.createElement(this._currentElement.type);x.setAttributeForID(a,this._rootNodeID),M.getID(a),this._updateDOMProperties({},r,t,a),this._createInitialChildren(t,r,n,a),o=a}else{var s=this._createOpenTagMarkupAndPutListeners(t,r),l=this._createContentMarkup(t,r,n);o=!l&&K[this._tag]?s+"/>":s+">"+l+""}switch(this._tag){case"input":t.getReactMountReady().enqueue(d,this);case"button":case"select":case"textarea":r.autoFocus&&t.getReactMountReady().enqueue(g.focusDOMComponent,this)}return o},_createOpenTagMarkupAndPutListeners:function(e,t){var n="<"+this._currentElement.type;for(var r in t)if(t.hasOwnProperty(r)){var o=t[r];if(null!=o)if(U.hasOwnProperty(r))o&&l(this._rootNodeID,r,o,e);else{r===B&&(o&&(o=this._previousStyleCopy=j({},t.style)),o=y.createMarkupForStyles(o));var i=null;null!=this._tag&&m(this._tag,t)?r!==V&&(i=x.createMarkupForCustomAttribute(r,o)):i=x.createMarkupForProperty(r,o),i&&(n+=" "+i)}}if(e.renderToStaticMarkup)return n;var a=x.createMarkupForID(this._rootNodeID);return n+" "+a},_createContentMarkup:function(e,t,n){var r="",o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&(r=o.__html);else{var i=X[typeof t.children]?t.children:null,a=null!=i?null:t.children;if(null!=i)r=D(i);else if(null!=a){var s=this.mountChildren(a,e,n);r=s.join("")}}return Y[this._tag]&&"\n"===r.charAt(0)?"\n"+r:r},_createInitialChildren:function(e,t,n,r){var o=t.dangerouslySetInnerHTML;if(null!=o)null!=o.__html&&H(r,o.__html);else{var i=X[typeof t.children]?t.children:null,a=null!=i?null:t.children;if(null!=i)W(r,i);else if(null!=a)for(var s=this.mountChildren(a,e,n),u=0;ut.end?(n=t.end,r=t.start):(n=t.start,r=t.end),o.moveToElementText(e),o.moveStart("character",n),o.setEndPoint("EndToStart",o),o.moveEnd("character",r-n),o.select()}function s(e,t){if(window.getSelection){var n=window.getSelection(),r=e[c()].length,o=Math.min(t.start,r),i="undefined"==typeof t.end?o:Math.min(t.end,r);if(!n.extend&&o>i){var a=i;i=o,o=a}var s=l(e,o),u=l(e,i);if(s&&u){var f=document.createRange();f.setStart(s.node,s.offset),n.removeAllRanges(),o>i?(n.addRange(f),n.extend(u.node,u.offset)):(f.setEnd(u.node,u.offset),n.addRange(f))}}}var u=n(6),l=n(314),c=n(136),f=u.canUseDOM&&"selection"in document&&!("getSelection"in window),d={getOffsets:f?o:i,setOffsets:f?a:s};e.exports=d},function(e,t,n){"use strict";var r=n(121),o=n(295),i=n(68);r.inject();var a={renderToString:o.renderToString,renderToStaticMarkup:o.renderToStaticMarkup,version:i};e.exports=a},function(e,t,n){"use strict";function r(){this._rootNodeID&&c.updateWrapper(this)}function o(e){var t=this._currentElement.props,n=i.executeOnChange(t,e);return s.asap(r,this),n}var i=n(63),a=n(66),s=n(13),u=n(4),l=n(1),c=(n(3),{getNativeProps:function(e,t,n){null!=t.dangerouslySetInnerHTML?l(!1):void 0;var r=u({},t,{defaultValue:void 0,value:void 0,children:e._wrapperState.initialValue,onChange:e._wrapperState.onChange});return r},mountWrapper:function(e,t){var n=t.defaultValue,r=t.children;null!=r&&(null!=n?l(!1):void 0,Array.isArray(r)&&(r.length<=1?void 0:l(!1),r=r[0]),n=""+r),null==n&&(n="");var a=i.getValue(t);e._wrapperState={initialValue:""+(null!=a?a:n),onChange:o.bind(e)}},updateWrapper:function(e){var t=e._currentElement.props,n=i.getValue(t);null!=n&&a.updatePropertyByID(e._rootNodeID,"value",""+n)}});e.exports=c},function(e,t,n){"use strict";function r(e){o.enqueueEvents(e),o.processEventQueue(!1)}var o=n(32),i={handleTopLevel:function(e,t,n,i,a){var s=o.extractEvents(e,t,n,i,a);r(s)}};e.exports=i},function(e,t,n){"use strict";function r(e){var t=d.getID(e),n=f.getReactRootIDFromNodeID(t),r=d.findReactContainerForID(n),o=d.getFirstReactDOM(r);return o}function o(e,t){this.topLevelType=e,this.nativeEvent=t,this.ancestors=[]}function i(e){a(e)}function a(e){for(var t=d.getFirstReactDOM(m(e.nativeEvent))||window,n=t;n;)e.ancestors.push(n),n=r(n);for(var o=0;oo;){for(;oo;o++)n+=t+=e.charCodeAt(o);return t%=r,n%=r,t|n<<16}var r=65521;e.exports=n},function(e,t,n){"use strict";function r(e,t){var n=null==t||"boolean"==typeof t||""===t;if(n)return"";var r=isNaN(t);return r||0===t||i.hasOwnProperty(e)&&i[e]?""+t:("string"==typeof t&&(t=t.trim()),t+"px")}var o=n(110),i=o.isUnitlessNumber;e.exports=r},function(e,t,n){"use strict";function r(e,t,n,r,o){return o}n(4),n(3);e.exports=r},function(e,t,n){"use strict";function r(e,t,n){var r=e,o=void 0===r[n];o&&null!=t&&(r[n]=t)}function o(e){if(null==e)return e;var t={};return i(e,r,t),t}var i=n(78);n(3);e.exports=o},function(e,t,n){"use strict";function r(e){if(e.key){var t=i[e.key]||e.key;if("Unidentified"!==t)return t}if("keypress"===e.type){var n=o(e);return 13===n?"Enter":String.fromCharCode(n)}return"keydown"===e.type||"keyup"===e.type?a[e.keyCode]||"Unidentified":""}var o=n(70),i={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},a={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"};e.exports=r},function(e,t){"use strict";function n(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function r(e){for(;e;){if(e.nextSibling)return e.nextSibling;e=e.parentNode}}function o(e,t){for(var o=n(e),i=0,a=0;o;){if(3===o.nodeType){if(a=i+o.textContent.length,t>=i&&a>=t)return{node:o,offset:t-i};i=a}o=n(r(o))}}e.exports=o},function(e,t,n){"use strict";function r(e){return o.isValidElement(e)?void 0:i(!1),e}var o=n(11),i=n(1);e.exports=r},function(e,t,n){"use strict";function r(e){return'"'+o(e)+'"'}var o=n(50);e.exports=r},function(e,t,n){"use strict";var r=n(8);e.exports=r.renderSubtreeIntoContainer},function(e,t){"use strict";function n(){for(var e=arguments.length,t=Array(e),n=0;e>n;n++)t[n]=arguments[n];return function(e,n){return t.reduce(function(e,t){return t(e,n)},e)}}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t){"use strict";function n(e){return e}function r(e,t,r){var o="function"==typeof t?t:n;return function(){for(var t=arguments.length,n=Array(t),i=0;t>i;i++)n[i]=arguments[i];var a={type:e,payload:o.apply(void 0,n)};return 1===n.length&&n[0]instanceof Error&&(a.error=!0),"function"==typeof r&&(a.meta=r.apply(void 0,n)),a}}t.__esModule=!0,t["default"]=r,e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}function o(e,t){var n=u["default"](e).map(function(t){return a["default"](t,e[t])});return"undefined"!=typeof t?function(e,r){return void 0===e&&(e=t),c["default"].apply(void 0,n)(e,r)}:c["default"].apply(void 0,n)}t.__esModule=!0,t["default"]=o;var i=n(138),a=r(i),s=n(322),u=r(s),l=n(318),c=r(l);e.exports=t["default"]},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}t.__esModule=!0;var o=n(319),i=r(o),a=n(138),s=r(a),u=n(320),l=r(u);t.createAction=i["default"],t.handleAction=s["default"],t.handleActions=l["default"]},function(e,t){"use strict";function n(e){if("undefined"!=typeof Reflect&&"function"==typeof Reflect.ownKeys)return Reflect.ownKeys(e);var t=Object.getOwnPropertyNames(e);return"function"==typeof Object.getOwnPropertySymbols&&(t=t.concat(Object.getOwnPropertySymbols(e))),t}t.__esModule=!0,t["default"]=n,e.exports=t["default"]},function(e,t){"use strict";function n(e){return Promise.reject(e.message)}Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=function(e,t,r){return{load:function(){return new Promise(function(t){var n=localStorage.getItem(e);t(JSON.parse(n,r)||{})})["catch"](n)},save:function(r){return new Promise(function(n){var o=JSON.stringify(r,t);localStorage.setItem(e,o),n()})["catch"](n)}}}},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;t-1&&e%1==0&&t>e}function d(e){var t=-1,n=Array(e.size);return e.forEach(function(e,r){n[++t]=[r,e]}),n}function p(e){var t=-1,n=Array(e.size);return e.forEach(function(e){n[++t]=e}),n}function h(){}function m(e,t){return g(e,t)&&delete e[t]}function v(e,t){if(Dt){var n=e[t];return n===Te?void 0:n}return yt.call(e,t)?e[t]:void 0}function g(e,t){return Dt?void 0!==e[t]:yt.call(e,t)}function y(e,t,n){e[t]=Dt&&void 0===n?Te:n}function b(e){var t=-1,n=e?e.length:0;for(this.clear();++tn)return!1;var r=e.length-1;return n==r?e.pop():Et.call(e,n,1),!0}function L(e,t){var n=R(e,t);return 0>n?void 0:e[n][1]}function j(e,t){return R(e,t)>-1}function R(e,t){for(var n=e.length;n--;)if(pe(e[n][0],t))return n;return-1}function D(e,t,n){var r=R(e,t);0>r?e.push([t,n]):e[r][1]=n}function I(e,t,n){var r=e[t];yt.call(e,t)&&pe(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function z(e,t){return e&&$(t,ke(t),e)}function H(e,t,n,r,o,a,s){var u;if(r&&(u=a?r(e,o,a,s):r(e)),void 0!==u)return u;if(!be(e))return e;var l=Vt(e);if(l){if(u=ae(e),!t)return _(e,u)}else{var f=ie(e),d=f==je||f==Re;if(Bt(e))return V(e,t);if(f==ze||f==Ne||d&&!a){if(c(e))return a?e:{};if(u=se(d?{}:e),!t)return ee(e,z(u,e))}else{if(!it[f])return a?e:{};u=ue(e,f,H,t)}}s||(s=new C);var p=s.get(e);if(p)return p;if(s.set(e,u),!l)var h=n?te(e):ke(e);return i(h||e,function(o,i){h&&(i=o,o=e[i]),I(u,i,H(o,t,n,r,i,e,s))}),u}function W(e){return be(e)?Ct(e):{}}function F(e,t,n){var r=t(e);return Vt(e)?r:a(r,n(e))}function q(e,t){return yt.call(e,t)||"object"==typeof e&&t in e&&null===re(e)}function U(e){return Mt(Object(e))}function X(e){return function(t){return null==t?void 0:t[e]}}function V(e,t){if(t)return e.slice();var n=new e.constructor(e.length);return e.copy(n),n}function B(e){var t=new e.constructor(e.byteLength);return new kt(t).set(new kt(e)),t}function Z(e,t){var n=t?B(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.byteLength)}function G(e,t,n){var o=t?n(d(e),!0):d(e);return s(o,r,new e.constructor)}function J(e){var t=new e.constructor(e.source,nt.exec(e));return t.lastIndex=e.lastIndex,t}function K(e,t,n){var r=t?n(p(e),!0):p(e);return s(r,o,new e.constructor)}function Y(e){return Ut?Object(Ut.call(e)):{}}function Q(e,t){var n=t?B(e.buffer):e.buffer;return new e.constructor(n,e.byteOffset,e.length)}function _(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n-1&&e%1==0&&Ee>=e}function be(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function xe(e){return!!e&&"object"==typeof e}function Ae(e){if(!be(e))return!1;var t=ge(e)||c(e)?xt:rt;return t.test(de(e))}function we(e){return"string"==typeof e||!Vt(e)&&xe(e)&&bt.call(e)==qe}function ke(e){var t=fe(e);if(!t&&!me(e))return U(e);var n=le(e),r=!!n,o=n||[],i=o.length;for(var a in e)!q(e,a)||r&&("length"==a||f(a,i))||t&&"constructor"==a||o.push(a);return o}function Pe(e){return function(){return e}}var Ce=200,Te="__lodash_hash_undefined__",Ee=9007199254740991,Ne="[object Arguments]",Me="[object Array]",Se="[object Boolean]",Oe="[object Date]",Le="[object Error]",je="[object Function]",Re="[object GeneratorFunction]",De="[object Map]",Ie="[object Number]",ze="[object Object]",He="[object Promise]",We="[object RegExp]",Fe="[object Set]",qe="[object String]",Ue="[object Symbol]",Xe="[object WeakMap]",Ve="[object ArrayBuffer]",Be="[object DataView]",Ze="[object Float32Array]",Ge="[object Float64Array]",Je="[object Int8Array]",Ke="[object Int16Array]",Ye="[object Int32Array]",Qe="[object Uint8Array]",_e="[object Uint8ClampedArray]",$e="[object Uint16Array]",et="[object Uint32Array]",tt=/[\\^$.*+?()[\]{}|]/g,nt=/\w*$/,rt=/^\[object .+?Constructor\]$/,ot=/^(?:0|[1-9]\d*)$/,it={};it[Ne]=it[Me]=it[Ve]=it[Be]=it[Se]=it[Oe]=it[Ze]=it[Ge]=it[Je]=it[Ke]=it[Ye]=it[De]=it[Ie]=it[ze]=it[We]=it[Fe]=it[qe]=it[Ue]=it[Qe]=it[_e]=it[$e]=it[et]=!0,it[Le]=it[je]=it[Xe]=!1;var at={"function":!0,object:!0},st=at[typeof t]&&t&&!t.nodeType?t:void 0,ut=at[typeof e]&&e&&!e.nodeType?e:void 0,lt=ut&&ut.exports===st?st:void 0,ct=l(st&&ut&&"object"==typeof n&&n),ft=l(at[typeof self]&&self),dt=l(at[typeof window]&&window),pt=l(at[typeof this]&&this),ht=ct||dt!==(pt&&pt.window)&&dt||ft||pt||Function("return this")(),mt=Array.prototype,vt=Object.prototype,gt=Function.prototype.toString,yt=vt.hasOwnProperty,bt=vt.toString,xt=RegExp("^"+gt.call(yt).replace(tt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),At=lt?ht.Buffer:void 0,wt=ht.Symbol,kt=ht.Uint8Array,Pt=Object.getOwnPropertySymbols,Ct=Object.create,Tt=vt.propertyIsEnumerable,Et=mt.splice,Nt=Object.getPrototypeOf,Mt=Object.keys,St=ne(ht,"DataView"),Ot=ne(ht,"Map"),Lt=ne(ht,"Promise"),jt=ne(ht,"Set"),Rt=ne(ht,"WeakMap"),Dt=ne(Object,"create"),It=de(St),zt=de(Ot),Ht=de(Lt),Wt=de(jt),Ft=de(Rt),qt=wt?wt.prototype:void 0,Ut=qt?qt.valueOf:void 0;h.prototype=Dt?Dt(null):vt,b.prototype.clear=x,b.prototype["delete"]=A,b.prototype.get=w,b.prototype.has=k,b.prototype.set=P,C.prototype.clear=T,C.prototype["delete"]=E,C.prototype.get=N,C.prototype.has=M,C.prototype.set=S;var Xt=X("length");Pt||(oe=function(){return[]}),(St&&ie(new St(new ArrayBuffer(1)))!=Be||Ot&&ie(new Ot)!=De||Lt&&ie(Lt.resolve())!=He||jt&&ie(new jt)!=Fe||Rt&&ie(new Rt)!=Xe)&&(ie=function(e){var t=bt.call(e),n=t==ze?e.constructor:void 0,r=n?de(n):void 0;if(r)switch(r){case It:return Be;case zt:return De;case Ht:return He;case Wt:return Fe;case Ft:return Xe}return t});var Vt=Array.isArray,Bt=At?function(e){return e instanceof At}:Pe(!1);e.exports=H}).call(t,n(52)(e),function(){return this}())},function(e,t){var n=Array.isArray;e.exports=n},function(e,t){function n(e){var t=!1;if(null!=e&&"function"!=typeof e.toString)try{t=!!(e+"")}catch(n){}return t}function r(e){return d(Object(e))}function o(e){return!!e&&"object"==typeof e}function i(e){if(!o(e)||f.call(e)!=a||n(e))return!1;var t=r(e);if(null===t)return!0;var i=l.call(t,"constructor")&&t.constructor;return"function"==typeof i&&i instanceof i&&u.call(i)==c}var a="[object Object]",s=Object.prototype,u=Function.prototype.toString,l=s.hasOwnProperty,c=u.call(Object),f=s.toString,d=Object.getPrototypeOf;e.exports=i},function(e,t,n){(function(e,n){function r(e,t){for(var n=-1,r=Array(e);++n-1&&e%1==0&&t>e}function a(e){for(var t,n=[];!(t=e.next()).done;)n.push(t.value);return n}function s(e){e=null==e?e:Object(e);var t=[];for(var n in e)t.push(n);return t}function u(e){return function(t){return null==t?void 0:t[e]}}function l(e){var t=e?e.length:void 0;return m(t)&&(q(e)||y(e)||f(e))?r(t,String):null}function c(e){var t=e&&e.constructor,n="function"==typeof t&&t.prototype||R;return e===n}function f(e){return p(e)&&D.call(e,"callee")&&(!W.call(e,"callee")||I.call(e)==A)}function d(e){return null!=e&&m(F(e))&&!h(e)}function p(e){return g(e)&&d(e)}function h(e){var t=v(e)?I.call(e):"";return t==w||t==k}function m(e){return"number"==typeof e&&e>-1&&e%1==0&&x>=e}function v(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function g(e){return!!e&&"object"==typeof e}function y(e){return"string"==typeof e||!q(e)&&g(e)&&I.call(e)==P}function b(e){for(var t=-1,n=c(e),r=s(e),o=r.length,a=l(e),u=!!a,f=a||[],d=f.length;++t-1&&e%1==0&&t>e}function i(e,t,n){(void 0===n||h(e[t],n))&&("number"!=typeof t||void 0!==n||t in e)||(e[t]=n)}function a(e,t,n){var r=e[t];oe.call(e,t)&&h(r,n)&&(void 0!==n||t in e)||(e[t]=n)}function s(e,t,n,o,a){if(e!==t){if(!ue(t)&&!w(t))var l=E(t);r(l||t,function(r,c){if(l&&(c=r,r=t[c]),x(r))a||(a=new P),u(e,t,c,n,s,o,a);else{var f=o?o(e[c],r,c+"",e,t,a):void 0;void 0===f&&(f=r),i(e,c,f)}})}}function u(e,t,n,r,o,a,s){var u=e[n],l=t[n],f=s.get(l);if(f)return void i(e,n,f);var d=a?a(u,l,n+"",e,t,s):void 0,p=void 0===d;p&&(d=l,ue(l)||w(l)?ue(u)?d=u:g(u)?d=c(u):(p=!1,d=C(l,!0)):T(l)||m(l)?m(u)?d=k(u):!x(u)||r&&y(u)?(p=!1,d=C(l,!0)):d=u:p=!1),s.set(l,d),p&&o(d,l,r,a,s),s["delete"](l),i(e,n,d)}function l(e){return function(t){return null==t?void 0:t[e]}}function c(e,t){var n=-1,r=e.length;for(t||(t=Array(r));++n1?n[o-1]:void 0,a=o>2?n[2]:void 0;for(i="function"==typeof i?(o--,i):void 0,a&&p(n[0],n[1],a)&&(i=3>o?void 0:i,o=1),t=Object(t);++r-1&&e%1==0&&M>=e}function x(e){var t=typeof e;return!!e&&("object"==t||"function"==t)}function A(e){return!!e&&"object"==typeof e}function w(e){return A(e)&&b(e.length)&&!!ne[ie.call(e)]}function k(e){return f(e,E(e))}var P=n(215),C=n(325),T=n(327),E=n(328),N=n(221),M=9007199254740991,S="[object Arguments]",O="[object Array]",L="[object Boolean]",j="[object Date]",R="[object Error]",D="[object Function]",I="[object GeneratorFunction]",z="[object Map]",H="[object Number]",W="[object Object]",F="[object RegExp]",q="[object Set]",U="[object String]",X="[object WeakMap]",V="[object ArrayBuffer]",B="[object DataView]",Z="[object Float32Array]",G="[object Float64Array]",J="[object Int8Array]",K="[object Int16Array]",Y="[object Int32Array]",Q="[object Uint8Array]",_="[object Uint8ClampedArray]",$="[object Uint16Array]",ee="[object Uint32Array]",te=/^(?:0|[1-9]\d*)$/,ne={};ne[Z]=ne[G]=ne[J]=ne[K]=ne[Y]=ne[Q]=ne[_]=ne[$]=ne[ee]=!0,ne[S]=ne[O]=ne[V]=ne[L]=ne[B]=ne[j]=ne[R]=ne[D]=ne[z]=ne[H]=ne[W]=ne[F]=ne[q]=ne[U]=ne[X]=!1;var re=Object.prototype,oe=re.hasOwnProperty,ie=re.toString,ae=re.propertyIsEnumerable,se=l("length"),ue=Array.isArray,le=d(function(e,t,n){s(e,t,n)});e.exports=le},function(e,t,n){"use strict";function r(e){return e&&e.__esModule?e:{"default":e}}Object.defineProperty(t,"__esModule",{value:!0});var o=Object.assign||function(e){for(var t=1;tn;n++)t[n]=arguments[n];return function(e){return function(n,r,o){var a=e(n,r,o),u=a.dispatch,l=[],c={getState:a.getState,dispatch:function(e){return u(e)}};return l=t.map(function(e){return e(c)}),u=s["default"].apply(void 0,l)(a.dispatch),i({},a,{dispatch:u})}}}t.__esModule=!0;var i=Object.assign||function(e){for(var t=1;t0;)for(t=o.shift(),i.push(t),n=t.childNodes,r=0;r<",">"+t+"<")}function c(e,t){if("string"==typeof t)return t===e.nodeName.toLowerCase();if(Array.isArray(t))return-1!==t.indexOf(e.nodeName.toLowerCase());if("function"==typeof t)return t.call(h,e);throw new TypeError("`filter` needs to be a string, array, or function")}function f(e,t){var n,r,i;return"left"===e?(n=t.previousSibling,r=/ $/):(n=t.nextSibling,r=/^ /),n&&(3===n.nodeType?i=r.test(n.nodeValue):1!==n.nodeType||o(n)||(i=r.test(n.textContent))),i}function d(e){var t="",n="";if(!o(e)){var r=/^[ \r\n\t]/.test(e.innerHTML),i=/[ \r\n\t]$/.test(e.innerHTML);r&&!f("left",e)&&(t=" "),i&&!f("right",e)&&(n=" ")}return{leading:t,trailing:n}}function p(e){var t,n=u(e);if(!i(e)&&!/A|TH|TD/.test(e.nodeName)&&/^\s*$/i.test(n))return void(e._replacement=""); +for(var o=0;o=0;i--)p(o[i]);return n=u(r),n.replace(/^[\t\r\n]+|[\t\r\n\s]+$/g,"").replace(/\n\s+\n/g,"\n\n").replace(/\n{3,}/g,"\n\n")},h.isBlock=o,h.isVoid=i,h.trim=r,h.outer=l,e.exports=h},function(e,t){"use strict";function n(e,t){var n=Array.prototype.indexOf.call(t.parentNode.childNodes,t),r=" ";return 0===n&&(r="| "),r+e+" |"}var r=/highlight highlight-(\S+)/;e.exports=[{filter:"br",replacement:function(){return"\n"}},{filter:["del","s","strike"],replacement:function(e){return"~~"+e+"~~"}},{filter:function(e){return"checkbox"===e.type&&"LI"===e.parentNode.nodeName},replacement:function(e,t){return(t.checked?"[x]":"[ ]")+" "}},{filter:["th","td"],replacement:function(e,t){return n(e,t)}},{filter:"tr",replacement:function(e,t){var r="",o={left:":--",right:"--:",center:":-:"};if("THEAD"===t.parentNode.nodeName)for(var i=0;io;o++)r+="#";return"\n\n"+r+" "+e+"\n\n"}},{filter:"hr",replacement:function(){return"\n\n* * *\n\n"}},{filter:["em","i"],replacement:function(e){return"_"+e+"_"}},{filter:["strong","b"],replacement:function(e){return"**"+e+"**"}},{filter:function(e){var t=e.previousSibling||e.nextSibling,n="PRE"===e.parentNode.nodeName&&!t;return"CODE"===e.nodeName&&!n},replacement:function(e){return"`"+e+"`"}},{filter:function(e){return"A"===e.nodeName&&e.getAttribute("href")},replacement:function(e,t){var n=t.title?' "'+t.title+'"':"";return"["+e+"]("+t.getAttribute("href")+n+")"}},{filter:"img",replacement:function(e,t){var n=t.alt||"",r=t.getAttribute("src")||"",o=t.title||"",i=o?' "'+o+'"':"";return r?"!["+n+"]("+r+i+")":""}},{filter:function(e){return"PRE"===e.nodeName&&"CODE"===e.firstChild.nodeName},replacement:function(e,t){return"\n\n "+t.firstChild.textContent.replace(/\n/g,"\n ")+"\n\n"}},{filter:"blockquote",replacement:function(e){return e=this.trim(e),e=e.replace(/\n{3,}/g,"\n\n"),e=e.replace(/^/gm,"> "),"\n\n"+e+"\n\n"}},{filter:"li",replacement:function(e,t){e=e.replace(/^\s+/,"").replace(/\n/gm,"\n ");var n="* ",r=t.parentNode,o=Array.prototype.indexOf.call(r.children,t)+1;return n=/ol/i.test(r.nodeName)?o+". ":"* ",n+e}},{filter:["ul","ol"],replacement:function(e,t){for(var n=[],r=0;r-1?t:e}function c(e,t){t=t||{};var n=t.body;if(c.prototype.isPrototypeOf(e)){if(e.bodyUsed)throw new TypeError("Already read");this.url=e.url,this.credentials=e.credentials,t.headers||(this.headers=new r(e.headers)),this.method=e.method,this.mode=e.mode,n||(n=e._bodyInit,e.bodyUsed=!0)}else this.url=e;if(this.credentials=t.credentials||this.credentials||"omit",!t.headers&&this.headers||(this.headers=new r(t.headers)),this.method=l(t.method||this.method||"GET"),this.mode=t.mode||this.mode||null,this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&n)throw new TypeError("Body not allowed for GET or HEAD requests");this._initBody(n)}function f(e){var t=new FormData;return e.trim().split("&").forEach(function(e){if(e){var n=e.split("="),r=n.shift().replace(/\+/g," "),o=n.join("=").replace(/\+/g," ");t.append(decodeURIComponent(r),decodeURIComponent(o))}}),t}function d(e){var t=new r,n=e.getAllResponseHeaders().trim().split("\n");return n.forEach(function(e){var n=e.trim().split(":"),r=n.shift().trim(),o=n.join(":").trim();t.append(r,o)}),t}function p(e,t){t||(t={}),this.type="default",this.status=t.status,this.ok=this.status>=200&&this.status<300,this.statusText=t.statusText,this.headers=t.headers instanceof r?t.headers:new r(t.headers),this.url=t.url||"",this._initBody(e)}if(!e.fetch){r.prototype.append=function(e,r){e=t(e),r=n(r);var o=this.map[e];o||(o=[],this.map[e]=o),o.push(r)},r.prototype["delete"]=function(e){delete this.map[t(e)]},r.prototype.get=function(e){var n=this.map[t(e)];return n?n[0]:null},r.prototype.getAll=function(e){return this.map[t(e)]||[]},r.prototype.has=function(e){return this.map.hasOwnProperty(t(e))},r.prototype.set=function(e,r){this.map[t(e)]=[n(r)]},r.prototype.forEach=function(e,t){Object.getOwnPropertyNames(this.map).forEach(function(n){this.map[n].forEach(function(r){e.call(t,r,n,this)},this)},this)};var h={blob:"FileReader"in e&&"Blob"in e&&function(){try{return new Blob,!0}catch(e){return!1}}(),formData:"FormData"in e,arrayBuffer:"ArrayBuffer"in e},m=["DELETE","GET","HEAD","OPTIONS","POST","PUT"];c.prototype.clone=function(){return new c(this)},u.call(c.prototype),u.call(p.prototype),p.prototype.clone=function(){return new p(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new r(this.headers),url:this.url})},p.error=function(){var e=new p(null,{status:0,statusText:""});return e.type="error",e};var v=[301,302,303,307,308];p.redirect=function(e,t){if(-1===v.indexOf(t))throw new RangeError("Invalid status code");return new p(null,{status:t,headers:{location:e}})},e.Headers=r,e.Request=c,e.Response=p,e.fetch=function(e,t){return new Promise(function(n,r){function o(){return"responseURL"in a?a.responseURL:/^X-Request-URL:/m.test(a.getAllResponseHeaders())?a.getResponseHeader("X-Request-URL"):void 0}var i;i=c.prototype.isPrototypeOf(e)&&!t?e:new c(e,t);var a=new XMLHttpRequest;a.onload=function(){var e=1223===a.status?204:a.status;if(100>e||e>599)return void r(new TypeError("Network request failed"));var t={status:e,statusText:a.statusText,headers:d(a),url:o()},i="response"in a?a.response:a.responseText;n(new p(i,t))},a.onerror=function(){r(new TypeError("Network request failed"))},a.open(i.method,i.url,!0),"include"===i.credentials&&(a.withCredentials=!0),"responseType"in a&&h.blob&&(a.responseType="blob"),i.headers.forEach(function(e,t){a.setRequestHeader(t,e)}),a.send("undefined"==typeof i._bodyInit?null:i._bodyInit)})},e.fetch.polyfill=!0}}("undefined"!=typeof self?self:this)},function(e,t){}]); //# sourceMappingURL=bundle.js.map \ No newline at end of file diff --git a/dist/bundle.js.map b/dist/bundle.js.map index a9707c4b..713ae72a 100644 --- a/dist/bundle.js.map +++ b/dist/bundle.js.map @@ -1 +1 @@ -{"version":3,"file":"bundle.js","sources":["webpack:///bundle.js","webpack:///"],"mappings":"AAAA;ACi2GA;AAmhFA;AAw2GA;AA99DA;AAugFA;AAy4HA;;;;;;;;;;;;;;AA+uFA;AAguOA;AA3iLA;AA8+jBA;AA4uDA;;;;;AAwpCA;;;;;AAsDA;AA85DA;AA+nDA;AAo7GA;AAu1FA;AAghEA;AA8pEA;AA45GA;AA03HA;AAu8IA;AAu/EA;AAMA;AAMA;AAMA;AAMA","sourceRoot":""} \ No newline at end of file +{"version":3,"file":"bundle.js","sources":["webpack:///bundle.js","webpack:///"],"mappings":"AAAA;ACw2GA;AA6gFA;AAm2GA;AAp+DA;AAshFA;AAk2HA;;;;;;;;;;;;;;AAyiGA;AAgnOA;AA0yTA;AAstGA;AA8tFA;;;;;AAigDA;;;;;AAsDA;AAi6DA;AAs0BA;AAy0HA;AAkqBA;AA22FA;AAuhEA;AA4pEA;AAsjEA;AAwjIA;AA+mHA;AA21KA;AAmbA;AAMA;AAMA;AAMA;AAMA","sourceRoot":""} \ No newline at end of file diff --git a/index.html b/index.html index 28ed6cbe..eefcb81d 100644 --- a/index.html +++ b/index.html @@ -3,20 +3,19 @@ Beautiful Atlas -
    + \ No newline at end of file diff --git a/index.js b/index.js new file mode 100644 index 00000000..0ac7c2d0 --- /dev/null +++ b/index.js @@ -0,0 +1,13 @@ +require('./init'); +var app = require('./server').default; +var http = require('http'); + +var server = http.createServer(app.callback()); +server.listen(process.env.PORT || '3000'); +server.on('error', (err) => { + throw err; +}); +server.on('listening', () => { + var address = server.address(); + console.log('Listening on %s%s', address.address, address.port); +}); \ No newline at end of file diff --git a/init.js b/init.js new file mode 100644 index 00000000..9fc5df08 --- /dev/null +++ b/init.js @@ -0,0 +1,4 @@ +require('safestart')(__dirname); +require('babel-core/register') +require('babel-polyfill'); +require('localenv'); \ No newline at end of file diff --git a/package.json b/package.json index 88ad47ad..9de796ba 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,7 @@ "clean": "rimraf dist", "build:webpack": "cross-env NODE_ENV=production webpack --config webpack.config.prod.js --progress --colors", "build": "npm run clean && npm run build:webpack", - "start": "node server.js", + "start": "cross-env NODE_ENV=development DEBUG=1 ./node_modules/.bin/nodemon --watch server index.js", "lint": "eslint src" }, "repository": { @@ -21,19 +21,43 @@ }, "homepage": "https://github.com/jorilallo/atlas#readme", "dependencies": { - "express": "^4.13.4", - "react": "^0.14.7", - "react-dom": "^0.14.7", - "body-parser": "^1.15.0" - }, - "devDependencies": { "babel-core": "^6.4.5", "babel-eslint": "^4.1.8", "babel-loader": "^6.2.1", + "babel-polyfill": "^6.7.4", "babel-preset-es2015": "^6.3.13", "babel-preset-react": "^6.3.13", "babel-preset-react-hmre": "^1.0.1", "babel-preset-stage-0": "^6.5.0", + "debug": "^2.2.0", + "http-errors": "^1.4.0", + "isomorphic-fetch": "^2.2.1", + "jsonwebtoken": "^5.7.0", + "koa": "^2.0.0", + "koa-bodyparser": "^2.0.1", + "koa-compress": "^2.0.0", + "koa-connect": "^1.0.0", + "koa-helmet": "^1.0.0", + "koa-jwt": "^1.2.0", + "koa-logger": "^2.0.0", + "koa-mount": "^2.0.0", + "koa-router": "^7.0.1", + "koa-sendfile": "^2.0.0", + "koa-webpack-dev-middleware": "^1.2.0", + "localenv": "^0.2.2", + "pg": "^4.5.3", + "pg-hstore": "^2.3.2", + "querystring": "^0.2.0", + "react": "^0.14.7", + "react-dom": "^0.14.7", + "react-keyframes": "^0.1.4", + "safestart": "^0.8.0", + "sequelize": "^3.21.0", + "sequelize-cli": "^2.3.1", + "sequelize-encrypted": "^0.1.0", + "validator": "^5.2.0" + }, + "devDependencies": { "classnames": "^2.2.3", "codemirror": "^5.11.0", "cross-env": "^1.0.7", @@ -43,14 +67,20 @@ "eslint-config-airbnb": "^5.0.0", "eslint-plugin-react": "^3.16.1", "exports-loader": "^0.6.3", - "fetch": "^1.0.1", "file-loader": "^0.8.5", + "fsevents": "^1.0.11", "history": "^1.17.0", "imports-loader": "^0.6.5", "json-loader": "^0.5.4", + "koa-convert": "^1.2.0", + "koa-webpack-dev-middleware": "^1.2.0", + "koa-webpack-hot-middleware": "^1.0.3", + "localforage": "^1.4.0", "lodash": "^4.3.0", "marked": "^0.3.5", + "node-dev": "^3.1.0", "node-sass": "^3.4.2", + "nodemon": "^1.9.1", "normalize.css": "^3.0.3", "react": "^0.14.7", "react-codemirror": "^0.2.5", @@ -58,16 +88,19 @@ "react-medium-editor": "^1.6.2", "react-redux": "^4.4.0", "react-router": "^2.0.0", + "react-router-redux": "^4.0.4", "redux": "^3.3.1", + "redux-logger": "^2.6.1", + "redux-persist": "^3.0.1", "redux-storage": "^4.0.0", "redux-storage-engine-localstorage": "^1.0.0", - "sass-loader": "^3.1.2", + "redux-thunk": "^2.0.1", + "sass-loader": "^3.2.0", "style-loader": "^0.13.0", + "sw-toolbox": "^3.1.1", "to-markdown": "^2.0.1", "url-loader": "^0.5.7", "webpack": "^1.12.12", - "webpack-dev-middleware": "^1.5.1", - "webpack-hot-middleware": "^2.6.4", - "whatwg-fetch": "^0.11.0" + "webpack-koa-hot-middleware": "^0.1.2" } } diff --git a/server.js b/server.js deleted file mode 100644 index dd1e7285..00000000 --- a/server.js +++ /dev/null @@ -1,83 +0,0 @@ -var path = require('path'); -var express = require('express'); - -var app = express(); -var port = process.env.PORT || 3000; - -if (process.env.NODE_ENV !== 'production') { - var webpack = require('webpack'); - var config = require('./webpack.config.dev'); - var compiler = webpack(config); - - app.use(require('webpack-dev-middleware')(compiler, { - noInfo: true, - publicPath: config.output.publicPath - })); - app.use(require('webpack-hot-middleware')(compiler)); -} else { - app.use('/static', express.static('dist')); -} - -// API stubs - Feel free to tear these down in favor of rolling out proper APIs -// Also `body-parser` module is included only for this -var router = express.Router(); - -var validJwtToken = 'eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9'; -function isAuthenticated(req, res, next) { - // Authenticate with JWT - if (req.headers.authorization) { - var tokenParts = req.headers.authorization.split(" "); - if (tokenParts.length === 2 && - tokenParts[0].trim().toUpperCase() === "JWT" && - tokenParts[1].trim() === validJwtToken - ) { - return next(); - } - } - - // Return 401 with invalid credentials - res.status(401).json({ - 'error': 'Invalid JWT token' - }); -} - -router.post('/authenticate', function(req, res) { - if (req.body.email === 'user1@example.com' && - req.body.password === 'test123!') { - res.json({ - 'jwt_token': validJwtToken, - }); - } else { - res.status(400).json({ - 'error': 'Invalid credentials' - }); - } -}); - -router.get('/user', isAuthenticated, function(req, res) { - res.json({ - id: '93c3a6d6-3958-44c9-a668-59711befb25c', - email: 'user1@example.com', - name: 'Test User' - }); -}); - - -// Register API -var bodyParser = require('body-parser'); -app.use(bodyParser.json()); -app.use('/api', router); - -// Frontend -app.get('*', function(req, res) { - res.sendFile(path.join(__dirname, 'index.html')); -}); - -app.listen(port, function(err) { - if (err) { - console.log(err); - return; - } - - console.log('Listening at ' + port); -}); diff --git a/server/api/auth.js b/server/api/auth.js new file mode 100644 index 00000000..fe9210ba --- /dev/null +++ b/server/api/auth.js @@ -0,0 +1,73 @@ +import Router from 'koa-router'; +import httpErrors from 'http-errors'; +import fetch from 'isomorphic-fetch'; +var querystring = require('querystring'); + +import { presentUser, presentTeam } from '../presenters'; +import { User, Team } from '../models'; + +const router = new Router(); + +router.post('auth.slack', async (ctx) => { + const { code } = ctx.request.body; + + ctx.assertPresent(code, 'code is required'); + + const body = { + client_id: process.env.SLACK_KEY, + client_secret: process.env.SLACK_SECRET, + code: code, + redirect_uri: process.env.SLACK_REDIRECT_URI, + } + + let data; + try { + const response = await fetch('https://slack.com/api/oauth.access?' + querystring.stringify(body)); + data = await response.json(); + } catch(e) { + throw httpErrors.BadRequest(); + } + + if (!data.ok) throw httpErrors.BadRequest(data.error); + + // User + let userData; + let user = await User.findOne({ slackId: data.user_id }); + if (user) { + user.slackAccessToken = data.access_token; + user.save(); + } else { + // Find existing user + const userParams = { token: data.access_token, user: data.user_id } + const response = await fetch('https://slack.com/api/users.info?' + querystring.stringify(userParams)); + userData = await response.json(); + user = await User.create({ + slackId: data.user_id, + username: userData.user.name, + name: userData.user.profile.real_name, + email: userData.user.profile.email, + slackData: userData.user, + slackAccessToken: data.access_token, + }); + } + + // Team + let team = await Team.findOne({ slackId: data.team_id }); + if (!team) { + team = await Team.create({ + slackId: data.team_id, + name: data.team_name, + }); + } + + // Add to correct team + user.setTeam(team); + + ctx.body = { data: { + user: presentUser(user), + team: presentTeam(team), + accessToken: user.getJwtToken(), + }}; +}); + +export default router; diff --git a/server/api/authentication.js b/server/api/authentication.js new file mode 100644 index 00000000..6cc82e93 --- /dev/null +++ b/server/api/authentication.js @@ -0,0 +1,61 @@ +import httpErrors from 'http-errors'; +import JWT from 'jsonwebtoken'; + +import { User } from '../models'; + +export default function auth({ require = true } = {}) { + return async function authMiddleware(ctx, next) { + let token; + + const authorizationHeader = ctx.request.get('authorization'); + if (authorizationHeader) { + const parts = authorizationHeader.split(' '); + if (parts.length == 2) { + const scheme = parts[0]; + const credentials = parts[1]; + + if (/^Bearer$/i.test(scheme)) { + token = credentials; + } + } else { + if (require) { + throw httpErrors.Unauthorized('Bad Authorization header format. Format is "Authorization: Bearer "\n'); + } + } + } else if (ctx.request.query.token) { + token = ctx.request.query.token; + } + + if (!token && require) { + throw httpErrors.Unauthorized('Authentication required'); + } + + // Get user without verifying payload signature + let payload; + try { + payload = JWT.decode(token); + } catch(_e) { + throw httpErrors.Unauthorized('Unable to decode JWT token'); + } + console.log(payload) + const user = await User.findOne({ + where: { id: payload.id }, + }); + + try { + JWT.verify(token, user.jwtSecret); + } catch(e) { + throw httpErrors.Unauthorized('Invalid token'); + } + + ctx.state.token = token; + ctx.state.user = user; + + return next(); + }; +}; + +// Export JWT methods as a convenience +export const sign = JWT.sign; +export const verify = JWT.verify; +export const decode = JWT.decode; diff --git a/server/api/index.js b/server/api/index.js new file mode 100644 index 00000000..14b55ed3 --- /dev/null +++ b/server/api/index.js @@ -0,0 +1,55 @@ +import bodyParser from 'koa-bodyparser'; +import httpErrors from 'http-errors'; +import Koa from 'koa'; +import Router from 'koa-router'; +import Sequelize from 'sequelize'; + +import auth from './auth'; +import user from './user'; + +import validation from './validation'; + +const api = new Koa(); +const router = new Router(); + +// API error handler +api.use(async (ctx, next) => { + try { + await next(); + } catch (err) { + ctx.status = err.status || 500; + let message = err.message || err.name; + + if (err instanceof Sequelize.ValidationError) { + // super basic form error handling + ctx.status = 400; + if (err.errors && err.errors[0]) { + message = `${err.errors[0].message} (${err.errors[0].path})`; + } + } + + if (ctx.status === 500) { + message = 'Internal Server Error'; + ctx.app.emit('error', err, ctx); + } + + ctx.body = { message }; + } +}); + +api.use(bodyParser()); +api.use(validation()); + +router.use('/', auth.routes()); +router.use('/', user.routes()); + +// Router is embedded in a Koa application wrapper, because koa-router does not +// allow middleware to catch any routes which were not explicitly defined. +api.use(router.routes()); + +// API 404 handler +api.use(async () => { + throw httpErrors.NotFound(); +}); + +export default api; \ No newline at end of file diff --git a/server/api/user.js b/server/api/user.js new file mode 100644 index 00000000..a23cf783 --- /dev/null +++ b/server/api/user.js @@ -0,0 +1,13 @@ +import Router from 'koa-router'; + +import auth from './authentication'; +import { presentUser } from '../presenters'; +import { User } from '../models'; + +const router = new Router(); + +router.post('user.info', auth(), async (ctx) => { + ctx.body = { data: presentUser(ctx.state.user) }; +}); + +export default router; \ No newline at end of file diff --git a/server/api/validation.js b/server/api/validation.js new file mode 100644 index 00000000..7fc7ce0e --- /dev/null +++ b/server/api/validation.js @@ -0,0 +1,26 @@ +import httpErrors from 'http-errors'; +import validator from 'validator'; + +export default function validation() { + return function validationMiddleware(ctx, next) { + ctx.assertPresent = function assertPresent(value, message) { + if (value === undefined || value === null || value === '') { + throw httpErrors.BadRequest(message); + } + }; + + ctx.assertEmail = function assertEmail(value, message) { + if (!validator.isEmail(value)) { + throw httpErrors.BadRequest(message); + } + }; + + ctx.assertUuid = function assertUuid(value, message) { + if (!validator.isUUID(value)) { + throw httpErrors.BadRequest(message); + } + }; + + return next(); + }; +} \ No newline at end of file diff --git a/server/index.js b/server/index.js new file mode 100644 index 00000000..90059b83 --- /dev/null +++ b/server/index.js @@ -0,0 +1,66 @@ +import compress from 'koa-compress'; +import helmet from 'koa-helmet'; +import logger from 'koa-logger'; +import mount from 'koa-mount'; +import Koa from 'koa'; + +import api from './api'; +import routes from './routes'; + +const app = new Koa(); + +app.use(compress()); + +if (process.env.NODE_ENV === 'development') { + const convert = require('koa-convert') + const webpack = require('webpack'); + const devMiddleware = require('koa-webpack-dev-middleware'); + const hotMiddleware = require('koa-webpack-hot-middleware'); + const config = require('../webpack.config.dev'); + const compile = webpack(config); + + app.use(convert(devMiddleware(compile, { + // display no info to console (only warnings and errors) + noInfo: false, + + // display nothing to the console + quiet: false, + + // switch into lazy mode + // that means no watching, but recompilation on every request + lazy: false, + + // // watch options (only lazy: false) + // watchOptions: { + // aggregateTimeout: 300, + // poll: true + // }, + + // public path to bind the middleware to + // use the same as in webpack + publicPath: config.output.publicPath, + + // options for formating the statistics + stats: { + colors: true + } + }))); + app.use(convert(hotMiddleware(compile, { + log: console.log, + path: '/__webpack_hmr', + heartbeat: 10 * 1000 + }))); + app.use(logger()); +} + +app.use(mount('/api', api)); +app.use(mount(routes)); + +app.use(helmet.csp({ + directives: { + defaultSrc: ['\'self\''], + styleSrc: ['\'self\'', '\'unsafe-inline\''], + }, +})); + +export default app; \ No newline at end of file diff --git a/server/models/Atlas.js b/server/models/Atlas.js new file mode 100644 index 00000000..4476c403 --- /dev/null +++ b/server/models/Atlas.js @@ -0,0 +1,14 @@ +import { + DataTypes, + sequelize, +} from '../sequelize'; +import Team from './Team'; + +const Atlas = sequelize.define('atlas', { + id: { type: DataTypes.UUID, defaultValue: DataTypes.UUIDV4, primaryKey: true }, + name: DataTypes.STRING, +}); + +Atlas.belongsTo(Team); + +export default Atlas; diff --git a/server/models/Document.js b/server/models/Document.js new file mode 100644 index 00000000..f810dec4 --- /dev/null +++ b/server/models/Document.js @@ -0,0 +1,17 @@ +import { + DataTypes, + sequelize, +} from '../sequelize'; +import Atlas from './Atlas'; +import Team from './Team'; + +const Document = sequelize.define('document', { + id: { type: DataTypes.UUID, defaultValue: DataTypes.UUIDV4, primaryKey: true }, + name: DataTypes.STRING, + content: DataTypes.STRING, +}); + +Document.belongsTo(Atlas); +Document.belongsTo(Team); + +export default Atlas; diff --git a/server/models/Team.js b/server/models/Team.js new file mode 100644 index 00000000..9c933d25 --- /dev/null +++ b/server/models/Team.js @@ -0,0 +1,20 @@ +import { + DataTypes, + sequelize, +} from '../sequelize'; + +const Team = sequelize.define('team', { + id: { type: DataTypes.UUID, defaultValue: DataTypes.UUIDV4, primaryKey: true }, + name: DataTypes.STRING, + slackId: { type: DataTypes.STRING, unique: true }, + slackData: DataTypes.JSONB, +}, { + indexes: [ + { + unique: true, + fields: ['slackId'] + }, + ], +}); + +export default Team; diff --git a/server/models/User.js b/server/models/User.js new file mode 100644 index 00000000..40964152 --- /dev/null +++ b/server/models/User.js @@ -0,0 +1,44 @@ +import crypto from 'crypto'; +import { + DataTypes, + sequelize, + encryptedFields +} from '../sequelize'; +import Team from './Team'; + +import JWT from 'jsonwebtoken'; + +const User = sequelize.define('user', { + id: { type: DataTypes.UUID, defaultValue: DataTypes.UUIDV4, primaryKey: true }, + email: DataTypes.STRING, + username: DataTypes.STRING, + name: DataTypes.STRING, + isAdmin: DataTypes.BOOLEAN, + slackAccessToken: encryptedFields.vault('slackAccessToken'), + slackId: { type: DataTypes.STRING, unique: true }, + slackData: DataTypes.JSONB, + jwtSecret: encryptedFields.vault('jwtSecret'), +}, { + instanceMethods: { + getJwtToken() { + return JWT.sign({ id: this.id }, this.jwtSecret); + }, + }, + indexes: [ + { + unique: true, + fields: ['email'] + }, + ], +}); + +const setRandomJwtSecret = (model) => { + model.jwtSecret = crypto.randomBytes(64).toString('hex'); +}; + +User.beforeCreate(setRandomJwtSecret); +User.belongsTo(Team); + +sequelize.sync(); + +export default User; diff --git a/server/models/index.js b/server/models/index.js new file mode 100644 index 00000000..c154204d --- /dev/null +++ b/server/models/index.js @@ -0,0 +1,6 @@ +import User from './User'; +import Team from './Team'; +import Atlas from './Atlas'; +import Document from './Document'; + +export { User, Team, Atlas, Document }; \ No newline at end of file diff --git a/server/presenters.js b/server/presenters.js new file mode 100644 index 00000000..e3abf59a --- /dev/null +++ b/server/presenters.js @@ -0,0 +1,16 @@ +export function presentUser(user) { + return { + id: user.id, + name: user.name, + username: user.username, + email: user.email, + avatarUrl: user.slackData.profile.image_192, + }; +} + +export function presentTeam(team) { + return { + id: team.id, + name: team.name, + }; +} diff --git a/server/routes.js b/server/routes.js new file mode 100644 index 00000000..a83dc4e1 --- /dev/null +++ b/server/routes.js @@ -0,0 +1,39 @@ +const path = require('path'); +import httpErrors from 'http-errors'; +import Koa from 'koa'; +import Router from 'koa-router'; +import sendfile from 'koa-sendfile'; + +const koa = new Koa(); +const router = new Router(); + +// // error handler +// koa.use(async (ctx, next) => { +// try { +// await next(); +// } catch (err) { +// ctx.status = err.status || 500; +// ctx.body = err.message; +// } +// }); + +// Frontend +router.get('/service-worker.js', async (ctx) => { + ctx.set('Content-Type', 'application/javascript'); + const stats = await sendfile(ctx, path.join(__dirname, 'static/service-worker.js')); + if (!ctx.status) ctx.throw(httpErrors.NotFound()); +}); + +router.get('*', async (ctx) => { + const stats = await sendfile(ctx, path.join(__dirname, 'static/index.html')); + if (!ctx.status) ctx.throw(httpErrors.NotFound()); +}); + +koa.use(router.routes()); + +// 404 handler +koa.use(async () => { + throw httpErrors.NotFound(); +}); + +export default koa; \ No newline at end of file diff --git a/server/sequelize.js b/server/sequelize.js new file mode 100644 index 00000000..4c676f7d --- /dev/null +++ b/server/sequelize.js @@ -0,0 +1,13 @@ +import Sequelize from 'sequelize'; +import EncryptedField from 'sequelize-encrypted'; +import debug from 'debug'; + +const secretKey = process.env.SEQUELIZE_SECRET; +export const encryptedFields = EncryptedField(Sequelize, secretKey); + +export const DataTypes = Sequelize; + +export const sequelize = new Sequelize(process.env.DATABASE_URL, { + logging: debug('sql'), + typeValidation: true, +}); diff --git a/server/static/index.html b/server/static/index.html new file mode 100644 index 00000000..eefcb81d --- /dev/null +++ b/server/static/index.html @@ -0,0 +1,21 @@ + + + + Beautiful Atlas + + + +
    + + + + \ No newline at end of file diff --git a/server/static/service-worker.js b/server/static/service-worker.js new file mode 100644 index 00000000..6055deeb --- /dev/null +++ b/server/static/service-worker.js @@ -0,0 +1,84 @@ +/* + Copyright 2014 Google Inc. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.toolbox = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;or.value[TIMESTAMP_PROPERTY]){var t=r.value[URL_PROPERTY];u.push(t),s["delete"](t),r["continue"]()}},c.oncomplete=function(){t(u)},c.onabort=o}):Promise.resolve([])}function expireExtraEntries(e,r){return r?new Promise(function(n,t){var o=[],i=e.transaction(STORE_NAME,"readwrite"),u=i.objectStore(STORE_NAME),c=u.index(TIMESTAMP_PROPERTY),s=c.count();c.count().onsuccess=function(){var e=s.result;e>r&&(c.openCursor().onsuccess=function(n){var t=n.target.result;if(t){var i=t.value[URL_PROPERTY];o.push(i),u["delete"](i),e-o.length>r&&t["continue"]()}})},i.oncomplete=function(){n(o)},i.onabort=t}):Promise.resolve([])}function expireEntries(e,r,n,t){return expireOldEntries(e,n,t).then(function(n){return expireExtraEntries(e,r).then(function(e){return n.concat(e)})})}var DB_PREFIX="sw-toolbox-",DB_VERSION=1,STORE_NAME="store",URL_PROPERTY="url",TIMESTAMP_PROPERTY="timestamp",cacheNameToDbPromise={};module.exports={getDb:getDb,setTimestampForUrl:setTimestampForUrl,expireEntries:expireEntries}; +},{}],3:[function(require,module,exports){ +"use strict";var scope;scope=self.registration?self.registration.scope:self.scope||new URL("./",self.location).href,module.exports={cache:{name:"$$$toolbox-cache$$$"+scope+"$$$",maxAgeSeconds:null,maxEntries:null},debug:!1,networkTimeoutSeconds:null,preCacheItems:[],successResponses:/^0|([123]\d\d)|(40[14567])|410$/}; +},{}],4:[function(require,module,exports){ +"use strict";var url=new URL("./",self.location),basePath=url.pathname,pathRegexp=require("path-to-regexp"),Route=function(e,t,i,s){t instanceof RegExp?this.fullUrlRegExp=t:(0!==t.indexOf("/")&&(t=basePath+t),this.keys=[],this.regexp=pathRegexp(t,this.keys)),this.method=e,this.options=s,this.handler=i};Route.prototype.makeHandler=function(e){var t;if(this.regexp){var i=this.regexp.exec(e);t={},this.keys.forEach(function(e,s){t[e.name]=i[s+1]})}return function(e){return this.handler(e,t,this.options)}.bind(this)},module.exports=Route; +},{"path-to-regexp":13}],5:[function(require,module,exports){ +"use strict";function regexEscape(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var Route=require("./route"),keyMatch=function(e,t){for(var r=e.entries(),o=r.next();!o.done;){var n=new RegExp(o.value[0]);if(n.test(t))return o.value[1];o=r.next()}return null},Router=function(){this.routes=new Map,this["default"]=null};["get","post","put","delete","head","any"].forEach(function(e){Router.prototype[e]=function(t,r,o){return this.add(e,t,r,o)}}),Router.prototype.add=function(e,t,r,o){o=o||{};var n;t instanceof RegExp?n=RegExp:(n=o.origin||self.location.origin,n=n instanceof RegExp?n.source:regexEscape(n)),e=e.toLowerCase();var u=new Route(e,t,r,o);this.routes.has(n)||this.routes.set(n,new Map);var a=this.routes.get(n);a.has(e)||a.set(e,new Map);var s=a.get(e),i=u.regexp||u.fullUrlRegExp;s.set(i.source,u)},Router.prototype.matchMethod=function(e,t){var r=new URL(t),o=r.origin,n=r.pathname;return this._match(e,keyMatch(this.routes,o),n)||this._match(e,this.routes.get(RegExp),t)},Router.prototype._match=function(e,t,r){if(t){var o=t.get(e.toLowerCase());if(o){var n=keyMatch(o,r);if(n)return n.makeHandler(r)}}return null},Router.prototype.match=function(e){return this.matchMethod(e.method,e.url)||this.matchMethod("any",e.url)},module.exports=new Router; +},{"./route":4}],6:[function(require,module,exports){ +"use strict";function cacheFirst(e,r,t){return helpers.debug("Strategy: cache first ["+e.url+"]",t),helpers.openCache(t).then(function(r){return r.match(e).then(function(r){return r?r:helpers.fetchAndCache(e,t)})})}var helpers=require("../helpers");module.exports=cacheFirst; +},{"../helpers":1}],7:[function(require,module,exports){ +"use strict";function cacheOnly(e,r,c){return helpers.debug("Strategy: cache only ["+e.url+"]",c),helpers.openCache(c).then(function(r){return r.match(e)})}var helpers=require("../helpers");module.exports=cacheOnly; +},{"../helpers":1}],8:[function(require,module,exports){ +"use strict";function fastest(e,n,t){return helpers.debug("Strategy: fastest ["+e.url+"]",t),new Promise(function(r,s){var c=!1,o=[],a=function(e){o.push(e.toString()),c?s(new Error('Both cache and network failed: "'+o.join('", "')+'"')):c=!0},h=function(e){e instanceof Response?r(e):a("No result returned")};helpers.fetchAndCache(e.clone(),t).then(h,a),cacheOnly(e,n,t).then(h,a)})}var helpers=require("../helpers"),cacheOnly=require("./cacheOnly");module.exports=fastest; +},{"../helpers":1,"./cacheOnly":7}],9:[function(require,module,exports){ +module.exports={networkOnly:require("./networkOnly"),networkFirst:require("./networkFirst"),cacheOnly:require("./cacheOnly"),cacheFirst:require("./cacheFirst"),fastest:require("./fastest")}; +},{"./cacheFirst":6,"./cacheOnly":7,"./fastest":8,"./networkFirst":10,"./networkOnly":11}],10:[function(require,module,exports){ +"use strict";function networkFirst(e,r,t){t=t||{};var s=t.successResponses||globalOptions.successResponses,n=t.networkTimeoutSeconds||globalOptions.networkTimeoutSeconds;return helpers.debug("Strategy: network first ["+e.url+"]",t),helpers.openCache(t).then(function(r){var o,u,c=[];if(n){var i=new Promise(function(t){o=setTimeout(function(){r.match(e).then(function(e){e&&t(e)})},1e3*n)});c.push(i)}var a=helpers.fetchAndCache(e,t).then(function(e){if(o&&clearTimeout(o),s.test(e.status))return e;throw helpers.debug("Response was an HTTP error: "+e.statusText,t),u=e,new Error("Bad response")})["catch"](function(){return helpers.debug("Network or response error, fallback to cache ["+e.url+"]",t),r.match(e).then(function(e){return e||u})});return c.push(a),Promise.race(c)})}var globalOptions=require("../options"),helpers=require("../helpers");module.exports=networkFirst; +},{"../helpers":1,"../options":3}],11:[function(require,module,exports){ +"use strict";function networkOnly(e,r,t){return helpers.debug("Strategy: network only ["+e.url+"]",t),fetch(e)}var helpers=require("../helpers");module.exports=networkOnly; +},{"../helpers":1}],12:[function(require,module,exports){ +"use strict";function cache(e,t){return helpers.openCache(t).then(function(t){return t.add(e)})}function uncache(e,t){return helpers.openCache(t).then(function(t){return t["delete"](e)})}function precache(e){Array.isArray(e)||(e=[e]),options.preCacheItems=options.preCacheItems.concat(e)}require("serviceworker-cache-polyfill");var options=require("./options"),router=require("./router"),helpers=require("./helpers"),strategies=require("./strategies");helpers.debug("Service Worker Toolbox is loading");var flatten=function(e){return e.reduce(function(e,t){return e.concat(t)},[])};self.addEventListener("install",function(e){var t=options.cache.name+"$$$inactive$$$";helpers.debug("install event fired"),helpers.debug("creating cache ["+t+"]"),e.waitUntil(helpers.openCache({cache:{name:t}}).then(function(e){return Promise.all(options.preCacheItems).then(flatten).then(function(t){return helpers.debug("preCache list: "+(t.join(", ")||"(none)")),e.addAll(t)})}))}),self.addEventListener("activate",function(e){helpers.debug("activate event fired");var t=options.cache.name+"$$$inactive$$$";e.waitUntil(helpers.renameCache(t,options.cache.name))}),self.addEventListener("fetch",function(e){var t=router.match(e.request);t?e.respondWith(t(e.request)):router["default"]&&"GET"===e.request.method&&e.respondWith(router["default"](e.request))}),module.exports={networkOnly:strategies.networkOnly,networkFirst:strategies.networkFirst,cacheOnly:strategies.cacheOnly,cacheFirst:strategies.cacheFirst,fastest:strategies.fastest,router:router,options:options,cache:cache,uncache:uncache,precache:precache}; +},{"./helpers":1,"./options":3,"./router":5,"./strategies":9,"serviceworker-cache-polyfill":15}],13:[function(require,module,exports){ +function parse(e){for(var t,r=[],n=0,o=0,p="";null!=(t=PATH_REGEXP.exec(e));){var a=t[0],i=t[1],s=t.index;if(p+=e.slice(o,s),o=s+a.length,i)p+=i[1];else{p&&(r.push(p),p="");var u=t[2],c=t[3],l=t[4],f=t[5],g=t[6],x=t[7],h="+"===g||"*"===g,m="?"===g||"*"===g,y=u||"/",T=l||f||(x?".*":"[^"+y+"]+?");r.push({name:c||n++,prefix:u||"",delimiter:y,optional:m,repeat:h,pattern:escapeGroup(T)})}}return o { + 'use strict'; + + // Turn on debug logging, visible in the Developer Tools' console. + global.toolbox.options.debug = true; + + // Set up a handler for HTTP GET requests: + // - /\.ytimg\.com\// will match any requests whose URL contains 'ytimg.com'. + // A narrower RegExp could be used, but just checking for ytimg.com anywhere + // in the URL should be fine for this sample. + // - toolbox.cacheFirst let us to use the predefined cache strategy for those + // requests. + global.toolbox.router.get(/\.ytimg\.com\//, global.toolbox.cacheFirst, { + // Use a dedicated cache for the responses, separate from the default cache. + cache: { + name: 'youtube-thumbnails', + // Store up to 10 entries in that cache. + maxEntries: 10, + // Expire any entries that are older than 30 seconds. + maxAgeSeconds: 30 + } + }); + + // By default, all requests that don't match our custom handler will use the + // toolbox.networkFirst cache strategy, and their responses will be stored in + // the default cache. + global.toolbox.router.default = global.toolbox.networkFirst; + + // Boilerplate to ensure our service worker takes control of the page as soon + // as possible. + global.addEventListener('install', + event => event.waitUntil(global.skipWaiting())); + global.addEventListener('activate', + event => event.waitUntil(global.clients.claim())); +})(self); \ No newline at end of file diff --git a/service-worker.js b/service-worker.js new file mode 100644 index 00000000..6055deeb --- /dev/null +++ b/service-worker.js @@ -0,0 +1,84 @@ +/* + Copyright 2014 Google Inc. All Rights Reserved. + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. +*/ + +(function(f){if(typeof exports==="object"&&typeof module!=="undefined"){module.exports=f()}else if(typeof define==="function"&&define.amd){define([],f)}else{var g;if(typeof window!=="undefined"){g=window}else if(typeof global!=="undefined"){g=global}else if(typeof self!=="undefined"){g=self}else{g=this}g.toolbox = f()}})(function(){var define,module,exports;return (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;or.value[TIMESTAMP_PROPERTY]){var t=r.value[URL_PROPERTY];u.push(t),s["delete"](t),r["continue"]()}},c.oncomplete=function(){t(u)},c.onabort=o}):Promise.resolve([])}function expireExtraEntries(e,r){return r?new Promise(function(n,t){var o=[],i=e.transaction(STORE_NAME,"readwrite"),u=i.objectStore(STORE_NAME),c=u.index(TIMESTAMP_PROPERTY),s=c.count();c.count().onsuccess=function(){var e=s.result;e>r&&(c.openCursor().onsuccess=function(n){var t=n.target.result;if(t){var i=t.value[URL_PROPERTY];o.push(i),u["delete"](i),e-o.length>r&&t["continue"]()}})},i.oncomplete=function(){n(o)},i.onabort=t}):Promise.resolve([])}function expireEntries(e,r,n,t){return expireOldEntries(e,n,t).then(function(n){return expireExtraEntries(e,r).then(function(e){return n.concat(e)})})}var DB_PREFIX="sw-toolbox-",DB_VERSION=1,STORE_NAME="store",URL_PROPERTY="url",TIMESTAMP_PROPERTY="timestamp",cacheNameToDbPromise={};module.exports={getDb:getDb,setTimestampForUrl:setTimestampForUrl,expireEntries:expireEntries}; +},{}],3:[function(require,module,exports){ +"use strict";var scope;scope=self.registration?self.registration.scope:self.scope||new URL("./",self.location).href,module.exports={cache:{name:"$$$toolbox-cache$$$"+scope+"$$$",maxAgeSeconds:null,maxEntries:null},debug:!1,networkTimeoutSeconds:null,preCacheItems:[],successResponses:/^0|([123]\d\d)|(40[14567])|410$/}; +},{}],4:[function(require,module,exports){ +"use strict";var url=new URL("./",self.location),basePath=url.pathname,pathRegexp=require("path-to-regexp"),Route=function(e,t,i,s){t instanceof RegExp?this.fullUrlRegExp=t:(0!==t.indexOf("/")&&(t=basePath+t),this.keys=[],this.regexp=pathRegexp(t,this.keys)),this.method=e,this.options=s,this.handler=i};Route.prototype.makeHandler=function(e){var t;if(this.regexp){var i=this.regexp.exec(e);t={},this.keys.forEach(function(e,s){t[e.name]=i[s+1]})}return function(e){return this.handler(e,t,this.options)}.bind(this)},module.exports=Route; +},{"path-to-regexp":13}],5:[function(require,module,exports){ +"use strict";function regexEscape(e){return e.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&")}var Route=require("./route"),keyMatch=function(e,t){for(var r=e.entries(),o=r.next();!o.done;){var n=new RegExp(o.value[0]);if(n.test(t))return o.value[1];o=r.next()}return null},Router=function(){this.routes=new Map,this["default"]=null};["get","post","put","delete","head","any"].forEach(function(e){Router.prototype[e]=function(t,r,o){return this.add(e,t,r,o)}}),Router.prototype.add=function(e,t,r,o){o=o||{};var n;t instanceof RegExp?n=RegExp:(n=o.origin||self.location.origin,n=n instanceof RegExp?n.source:regexEscape(n)),e=e.toLowerCase();var u=new Route(e,t,r,o);this.routes.has(n)||this.routes.set(n,new Map);var a=this.routes.get(n);a.has(e)||a.set(e,new Map);var s=a.get(e),i=u.regexp||u.fullUrlRegExp;s.set(i.source,u)},Router.prototype.matchMethod=function(e,t){var r=new URL(t),o=r.origin,n=r.pathname;return this._match(e,keyMatch(this.routes,o),n)||this._match(e,this.routes.get(RegExp),t)},Router.prototype._match=function(e,t,r){if(t){var o=t.get(e.toLowerCase());if(o){var n=keyMatch(o,r);if(n)return n.makeHandler(r)}}return null},Router.prototype.match=function(e){return this.matchMethod(e.method,e.url)||this.matchMethod("any",e.url)},module.exports=new Router; +},{"./route":4}],6:[function(require,module,exports){ +"use strict";function cacheFirst(e,r,t){return helpers.debug("Strategy: cache first ["+e.url+"]",t),helpers.openCache(t).then(function(r){return r.match(e).then(function(r){return r?r:helpers.fetchAndCache(e,t)})})}var helpers=require("../helpers");module.exports=cacheFirst; +},{"../helpers":1}],7:[function(require,module,exports){ +"use strict";function cacheOnly(e,r,c){return helpers.debug("Strategy: cache only ["+e.url+"]",c),helpers.openCache(c).then(function(r){return r.match(e)})}var helpers=require("../helpers");module.exports=cacheOnly; +},{"../helpers":1}],8:[function(require,module,exports){ +"use strict";function fastest(e,n,t){return helpers.debug("Strategy: fastest ["+e.url+"]",t),new Promise(function(r,s){var c=!1,o=[],a=function(e){o.push(e.toString()),c?s(new Error('Both cache and network failed: "'+o.join('", "')+'"')):c=!0},h=function(e){e instanceof Response?r(e):a("No result returned")};helpers.fetchAndCache(e.clone(),t).then(h,a),cacheOnly(e,n,t).then(h,a)})}var helpers=require("../helpers"),cacheOnly=require("./cacheOnly");module.exports=fastest; +},{"../helpers":1,"./cacheOnly":7}],9:[function(require,module,exports){ +module.exports={networkOnly:require("./networkOnly"),networkFirst:require("./networkFirst"),cacheOnly:require("./cacheOnly"),cacheFirst:require("./cacheFirst"),fastest:require("./fastest")}; +},{"./cacheFirst":6,"./cacheOnly":7,"./fastest":8,"./networkFirst":10,"./networkOnly":11}],10:[function(require,module,exports){ +"use strict";function networkFirst(e,r,t){t=t||{};var s=t.successResponses||globalOptions.successResponses,n=t.networkTimeoutSeconds||globalOptions.networkTimeoutSeconds;return helpers.debug("Strategy: network first ["+e.url+"]",t),helpers.openCache(t).then(function(r){var o,u,c=[];if(n){var i=new Promise(function(t){o=setTimeout(function(){r.match(e).then(function(e){e&&t(e)})},1e3*n)});c.push(i)}var a=helpers.fetchAndCache(e,t).then(function(e){if(o&&clearTimeout(o),s.test(e.status))return e;throw helpers.debug("Response was an HTTP error: "+e.statusText,t),u=e,new Error("Bad response")})["catch"](function(){return helpers.debug("Network or response error, fallback to cache ["+e.url+"]",t),r.match(e).then(function(e){return e||u})});return c.push(a),Promise.race(c)})}var globalOptions=require("../options"),helpers=require("../helpers");module.exports=networkFirst; +},{"../helpers":1,"../options":3}],11:[function(require,module,exports){ +"use strict";function networkOnly(e,r,t){return helpers.debug("Strategy: network only ["+e.url+"]",t),fetch(e)}var helpers=require("../helpers");module.exports=networkOnly; +},{"../helpers":1}],12:[function(require,module,exports){ +"use strict";function cache(e,t){return helpers.openCache(t).then(function(t){return t.add(e)})}function uncache(e,t){return helpers.openCache(t).then(function(t){return t["delete"](e)})}function precache(e){Array.isArray(e)||(e=[e]),options.preCacheItems=options.preCacheItems.concat(e)}require("serviceworker-cache-polyfill");var options=require("./options"),router=require("./router"),helpers=require("./helpers"),strategies=require("./strategies");helpers.debug("Service Worker Toolbox is loading");var flatten=function(e){return e.reduce(function(e,t){return e.concat(t)},[])};self.addEventListener("install",function(e){var t=options.cache.name+"$$$inactive$$$";helpers.debug("install event fired"),helpers.debug("creating cache ["+t+"]"),e.waitUntil(helpers.openCache({cache:{name:t}}).then(function(e){return Promise.all(options.preCacheItems).then(flatten).then(function(t){return helpers.debug("preCache list: "+(t.join(", ")||"(none)")),e.addAll(t)})}))}),self.addEventListener("activate",function(e){helpers.debug("activate event fired");var t=options.cache.name+"$$$inactive$$$";e.waitUntil(helpers.renameCache(t,options.cache.name))}),self.addEventListener("fetch",function(e){var t=router.match(e.request);t?e.respondWith(t(e.request)):router["default"]&&"GET"===e.request.method&&e.respondWith(router["default"](e.request))}),module.exports={networkOnly:strategies.networkOnly,networkFirst:strategies.networkFirst,cacheOnly:strategies.cacheOnly,cacheFirst:strategies.cacheFirst,fastest:strategies.fastest,router:router,options:options,cache:cache,uncache:uncache,precache:precache}; +},{"./helpers":1,"./options":3,"./router":5,"./strategies":9,"serviceworker-cache-polyfill":15}],13:[function(require,module,exports){ +function parse(e){for(var t,r=[],n=0,o=0,p="";null!=(t=PATH_REGEXP.exec(e));){var a=t[0],i=t[1],s=t.index;if(p+=e.slice(o,s),o=s+a.length,i)p+=i[1];else{p&&(r.push(p),p="");var u=t[2],c=t[3],l=t[4],f=t[5],g=t[6],x=t[7],h="+"===g||"*"===g,m="?"===g||"*"===g,y=u||"/",T=l||f||(x?".*":"[^"+y+"]+?");r.push({name:c||n++,prefix:u||"",delimiter:y,optional:m,repeat:h,pattern:escapeGroup(T)})}}return o { + 'use strict'; + + // Turn on debug logging, visible in the Developer Tools' console. + global.toolbox.options.debug = true; + + // Set up a handler for HTTP GET requests: + // - /\.ytimg\.com\// will match any requests whose URL contains 'ytimg.com'. + // A narrower RegExp could be used, but just checking for ytimg.com anywhere + // in the URL should be fine for this sample. + // - toolbox.cacheFirst let us to use the predefined cache strategy for those + // requests. + global.toolbox.router.get(/\.ytimg\.com\//, global.toolbox.cacheFirst, { + // Use a dedicated cache for the responses, separate from the default cache. + cache: { + name: 'youtube-thumbnails', + // Store up to 10 entries in that cache. + maxEntries: 10, + // Expire any entries that are older than 30 seconds. + maxAgeSeconds: 30 + } + }); + + // By default, all requests that don't match our custom handler will use the + // toolbox.networkFirst cache strategy, and their responses will be stored in + // the default cache. + global.toolbox.router.default = global.toolbox.networkFirst; + + // Boilerplate to ensure our service worker takes control of the page as soon + // as possible. + global.addEventListener('install', + event => event.waitUntil(global.skipWaiting())); + global.addEventListener('activate', + event => event.waitUntil(global.clients.claim())); +})(self); \ No newline at end of file diff --git a/src/Actions/index.js b/src/Actions/index.js index cbf7928b..0373d54a 100644 --- a/src/Actions/index.js +++ b/src/Actions/index.js @@ -9,6 +9,10 @@ export const TOGGLE_EDITORS = 'TOGGLE_EDITORS'; export const ADD_REVISION = 'ADD_REVISION'; export const REPLACE_TEXT= 'REPLACE_TEXT'; +export const SLACK_AUTH_PENDING = 'SLACK_AUTH_PENDING'; +export const SLACK_AUTH_SUCCESS = 'SLACK_AUTH_SUCCESS'; +export const SLACK_AUTH_FAILURE = 'SLACK_AUTH_FAILURE'; + /* * Other Constants */ diff --git a/src/Components/Header/Header.js b/src/Components/Header/Header.js index 62713532..88f33ce9 100644 --- a/src/Components/Header/Header.js +++ b/src/Components/Header/Header.js @@ -1,13 +1,10 @@ import React from 'react'; -import MarkdownIcon from '../../Components/Icons/Markdown'; - import styles from './Header.scss'; import classNames from 'classnames/bind'; const cx = classNames.bind(styles); const Header = ({ - activeEditors, toggleEditors, }) => { return ( @@ -17,16 +14,7 @@ const Header = ({ className={ cx('headerItem', 'editorToggle') } style={{ display: 'flex', justifyContent: 'flex-end', alignItems: 'center' }} > -
    - -
    -
    +
    Aa
    diff --git a/src/Components/Header/Header.scss b/src/Components/Header/Header.scss index 901f03aa..e2c6971a 100644 --- a/src/Components/Header/Header.scss +++ b/src/Components/Header/Header.scss @@ -19,7 +19,7 @@ width: 150px; padding: 12px 22px; - font-size: 13px; + font-size: 15px; font-weight: 300; font-family: "Atlas Grotesk", "Helvetica Neue", sans-serif; text-align: center; diff --git a/src/Components/MarkdownEditor/MarkdownEditor.js b/src/Components/MarkdownEditor/MarkdownEditor.js index a1d2a0bd..98f34e2d 100644 --- a/src/Components/MarkdownEditor/MarkdownEditor.js +++ b/src/Components/MarkdownEditor/MarkdownEditor.js @@ -3,12 +3,13 @@ import Codemirror from 'react-codemirror'; import 'codemirror/mode/gfm/gfm'; import 'codemirror/mode/javascript/javascript'; import 'codemirror/addon/edit/continuelist'; +import 'codemirror/addon/display/placeholder.js'; import Dropzone from 'react-dropzone'; import styles from './MarkdownEditor.scss'; -import './codemirror.css'; +import './codemirror.scss'; -import { client } from '../../Utils/ApiClient'; +import { client } from '../../utils/ApiClient'; class MarkdownAtlas extends React.Component { static propTypes = { @@ -97,6 +98,7 @@ class MarkdownAtlas extends React.Component { extraKeys: { Enter: 'newlineAndIndentContinueMarkdownList', }, + placeholder: "# Start with a title...", }; // http://codepen.io/lubelski/pen/fnGae diff --git a/src/Components/MarkdownEditor/codemirror.css b/src/Components/MarkdownEditor/codemirror.css deleted file mode 100644 index 3fb8a692..00000000 --- a/src/Components/MarkdownEditor/codemirror.css +++ /dev/null @@ -1,65 +0,0 @@ -/* - - Name: Base16 Default Light - Author: Chris Kempson (http://chriskempson.com) - - CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) - Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) - -*/ - -@import url(https://fonts.googleapis.com/css?family=Cousine:400,700,700italic,400italic); - -/* Custom styling */ -.cm-s-atlas.CodeMirror { - background: #ffffff; - color: #202020; - font-family: 'Atlas Typewriter', 'Cousine', 'Monaco', monospace; - font-weight: 300; - height: auto; -} -.cm-s-atlas div.CodeMirror-selected { - background: #90CAF9; -} - -/* Disable ondrag cursor for file uploads */ -.cm-s-atlas div.CodeMirror-dragcursors { - visibility: hidden; -} - -.cm-s-atlas .CodeMirror-line::selection, -.cm-s-atlas .CodeMirror-line > span::selection, -.cm-s-atlas .CodeMirror-line > span > span::selection { - background: #90CAF9; -} - -.cm-s-atlas .CodeMirror-line::-moz-selection, .cm-s-atlas .CodeMirror-line > span::-moz-selection, .cm-s-atlas .CodeMirror-line > span > span::-moz-selection { background: #e0e0e0; } -.cm-s-atlas .CodeMirror-gutters { background: #f5f5f5; border-right: 0px; } -.cm-s-atlas .CodeMirror-guttermarker { color: #ac4142; } -.cm-s-atlas .CodeMirror-guttermarker-subtle { color: #b0b0b0; } -.cm-s-atlas .CodeMirror-linenumber { color: #b0b0b0; } -.cm-s-atlas .CodeMirror-cursor { - border-left: 2px solid #2196F3; -} - -.cm-s-atlas span.cm-quote { - font-style: italic; -} -.cm-s-atlas span.cm-comment { color: #8f5536; } -.cm-s-atlas span.cm-atom { color: #aa759f; } -.cm-s-atlas span.cm-number { color: #aa759f; } - -.cm-s-atlas span.cm-property, .cm-s-atlas span.cm-attribute { color: #90a959; } -.cm-s-atlas span.cm-keyword { color: #ac4142; } -.cm-s-atlas span.cm-string { color: #f4bf75; } - -.cm-s-atlas span.cm-variable { color: #90a959; } -.cm-s-atlas span.cm-variable-2 { color: #788696; } -.cm-s-atlas span.cm-def { color: #d28445; } -.cm-s-atlas span.cm-bracket { color: #202020; } -.cm-s-atlas span.cm-tag { color: #ac4142; } -.cm-s-atlas span.cm-link { color: #aa759f; } -.cm-s-atlas span.cm-error { background: #ac4142; color: #505050; } - -.cm-s-atlas .CodeMirror-activeline-background { background: #DDDCDC; } -.cm-s-atlas .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; } \ No newline at end of file diff --git a/src/Constants.js b/src/Constants.js index 197b82f6..ffdcd216 100644 --- a/src/Constants.js +++ b/src/Constants.js @@ -11,9 +11,7 @@ const keys = keyMirror({ // Constant values const constants = { API_USER_AGENT: `${name}/${version}`, - API_BASE_URL: 'http://localhost:8000/api', - LOGIN_PATH: '/login', - LOGIN_SUCCESS_PATH: '/dashboard', + API_BASE_URL: 'http://localhost:3000/api', }; export default Object.assign(keys, constants); diff --git a/src/Reducers/index.js b/src/Reducers/index.js index 634dbdbc..27b8bc45 100644 --- a/src/Reducers/index.js +++ b/src/Reducers/index.js @@ -7,8 +7,8 @@ import { TOGGLE_HISTORY_SIDEBAR, ADD_REVISION, REPLACE_TEXT, - ActiveEditors, -} from '../Actions'; + ActiveEditors +} from '../actions'; const activeEditors = (state = [ActiveEditors.MARKDOWN, ActiveEditors.TEXT], action) => { switch (action.type) { @@ -103,8 +103,13 @@ const text = (state = textDefaultState, action) => { } }; +import team from './team'; +import user from './user'; + export default combineReducers({ activeEditors, historySidebar, text, + user, + team, }); diff --git a/src/Utils/ApiClient.js b/src/Utils/ApiClient.js index c32c79f9..427e8d86 100644 --- a/src/Utils/ApiClient.js +++ b/src/Utils/ApiClient.js @@ -1,12 +1,12 @@ import _ from 'lodash'; -import Auth from './Auth'; -import Constants from '../Constants'; +import auth from './auth'; +import constants from '../constants'; class ApiClient { constructor(options = {}) { - this.baseUrl = options.baseUrl || Constants.API_BASE_URL; - this.userAgent = options.userAgent || Constants.API_USER_AGENT; + this.baseUrl = options.baseUrl || constants.API_BASE_URL; + this.userAgent = options.userAgent || constants.API_USER_AGENT; } fetch = (path, method, data) => { @@ -25,8 +25,8 @@ class ApiClient { 'Content-Type': 'application/json', 'User-Agent': this.userAgent, }); - if (Auth.getToken()) { - headers.set('Authorization', `JWT ${Auth.getToken()}`); + if (auth.getToken()) { + headers.set('Authorization', `Bearer ${auth.getToken()}`); } // Construct request @@ -48,7 +48,7 @@ class ApiClient { // Handle 401, log out user if (response.status === 401) { - Auth.logout(); + auth.logout(); // replace with dispatch+action } // Handle failed responses @@ -81,18 +81,6 @@ class ApiClient { return this.fetch(path, 'POST', data); } - put = (path, data) => { - return this.fetch(path, 'PUT', data); - } - - get = (path, data) => { - return this.fetch(path, 'GET', data); - } - - delete = (path, data) => { - return this.fetch(path, 'DELETE', data); - } - // Helpers constructQueryString = (data) => { diff --git a/src/Utils/Auth.js b/src/Utils/Auth.js index 72853546..02f8cadf 100644 --- a/src/Utils/Auth.js +++ b/src/Utils/Auth.js @@ -1,42 +1,19 @@ -// Inspired by https://github.com/reactjs/react-router/blob/master/examples/auth-flow/auth.js -import Constants from '../Constants'; -import History from './History'; - -import { client } from './ApiClient'; +import constants from '../constants'; export default { - login(email, password) { - return new Promise((resolve, reject) => { - client.post('/authenticate', { - email, - password, - }) - .then((data) => { - localStorage.setItem(Constants.JWT_STORE_KEY, data.jwt_token); - this.onChange(true); - resolve(data); - }) - .catch((error) => { - reject(error); - }); - }); + setToken(token) { + localStorage.setItem(constants.JWT_STORE_KEY, token); }, getToken() { - return localStorage.getItem(Constants.JWT_STORE_KEY); + return localStorage.getItem(constants.JWT_STORE_KEY); }, logout() { - localStorage.removeItem(Constants.JWT_STORE_KEY); - History.push(Constants.LOGIN_PATH); - this.onChange(false); + localStorage.removeItem(constants.JWT_STORE_KEY); }, loggedIn() { - return !!localStorage.getItem(Constants.JWT_STORE_KEY); - }, - - onChange() { - // This is overriden with a callback function in `Views/App/App.js` + return !!localStorage.getItem(constants.JWT_STORE_KEY); }, }; diff --git a/src/Views/Dashboard/Dashboard.js b/src/Views/Dashboard/Dashboard.js deleted file mode 100644 index a09d8787..00000000 --- a/src/Views/Dashboard/Dashboard.js +++ /dev/null @@ -1,89 +0,0 @@ -import React, { Component } from 'react'; -import { connect } from 'react-redux'; - -import MarkdownEditor from '../../Components/MarkdownEditor'; -import TextEditor from '../../Components/TextEditor'; - -import { toMarkdown } from '../../Utils/Markdown'; -import { - updateText, - replaceText, -} from '../../Actions'; - -import Constants from '../../Constants'; - -import styles from './Dashboard.scss'; - -class Dashboard extends Component { - static propTypes = { - editMarkdown: React.PropTypes.func.isRequired, - editText: React.PropTypes.func.isRequired, - text: React.PropTypes.string, - replaceText: React.PropTypes.func.isRequired, - activeEditors: React.PropTypes.arrayOf(React.PropTypes.string), - showHistorySidebar: React.PropTypes.bool.isRequired, - } - - render() { - const activeEditors = this.props.activeEditors; - - return ( -
    - { - activeEditors.includes('MARKDOWN') ? ( -
    1 ? - styles.panel : styles.fullscreen} ${styles.markdown}`} - > - -
    - ) : null - } - { - activeEditors.includes('TEXT') ? ( -
    1 ? - styles.panel : styles.fullscreen} ${styles.text}`} - > - -
    - ) : null - } -
    - ); - } -} - -const mapStateToProps = (state) => { - return { - text: state.text.text, - editor: state.editor, - activeEditors: state.activeEditors, - showHistorySidebar: state.historySidebar.visible, - revisions: state.text.revisions, - }; -}; - -const mapDispatchToProps = (dispatch) => { - return { - editMarkdown: (text) => { - dispatch(updateText(text, 'markdown')); - }, - editText: (html) => { - const text = toMarkdown(html); - dispatch(updateText(text, 'text')); - }, - replaceText: (originalText, replacedText) => { - dispatch(replaceText(originalText, replacedText)); - }, - }; -}; - -Dashboard = connect( - mapStateToProps, - mapDispatchToProps, -)(Dashboard); - -export default Dashboard; diff --git a/src/Views/Login/Login.js b/src/Views/Login/Login.js deleted file mode 100644 index 00191dfa..00000000 --- a/src/Views/Login/Login.js +++ /dev/null @@ -1,75 +0,0 @@ -import React, { Component } from 'react'; - -import Auth from '../../Utils/Auth'; - -export default class Login extends Component { - static propTypes = { - location: React.PropTypes.object, - } - - static contextTypes = { - router: React.PropTypes.object.isRequired, - } - - state = { - email: '', - password: '', - error: null, - } - - handleEmailChange = (event) => { - this.setState({ email: event.target.value }); - } - - handlePasswordChange = (event) => { - this.setState({ password: event.target.value }); - } - - handleSubmit = (event) => { - event.preventDefault(); - - Auth.login(this.state.email, this.state.password) - .then(() => { - const { location } = this.props; - - if (location.state && location.state.nextPathname) { - this.context.router.replace(location.state.nextPathname); - } else { - this.context.router.replace('/dashboard'); - } - }) - .catch((err) => { - this.setState({ error: err.error }); - }); - } - - render() { - return ( -
    -

    Login

    -
    - {this.state.error && ( -

    { this.state.error }

    - )} - -
    - -
    -
    - -
    -
    - -
    -
    -
    - ); - } -} diff --git a/src/Views/Login/index.js b/src/Views/Login/index.js deleted file mode 100644 index 189be5f0..00000000 --- a/src/Views/Login/index.js +++ /dev/null @@ -1,2 +0,0 @@ -import Login from './Login'; -export default Login; diff --git a/src/actions/EditorActions.js b/src/actions/EditorActions.js new file mode 100644 index 00000000..1418dbce --- /dev/null +++ b/src/actions/EditorActions.js @@ -0,0 +1,5 @@ +import makeActionCreator from '../utils/actions'; + +export const TOGGLE_PREVIEW = 'TOGGLE_PREVIEW'; + +const togglePreview = makeActionCreator(TOGGLE_PREVIEW); diff --git a/src/actions/SlackAuthAction.js b/src/actions/SlackAuthAction.js new file mode 100644 index 00000000..f827e81a --- /dev/null +++ b/src/actions/SlackAuthAction.js @@ -0,0 +1,34 @@ +import makeActionCreator from '../utils/actions'; +import { push } from 'react-router-redux'; +import { client } from 'utils/ApiClient'; +import auth from 'utils/auth'; + +import { updateUser } from './UserActions'; +import { updateTeam } from './TeamActions'; + +export const SLACK_AUTH_PENDING = 'SLACK_AUTH_PENDING'; +export const SLACK_AUTH_SUCCESS = 'SLACK_AUTH_SUCCESS'; +export const SLACK_AUTH_FAILURE = 'SLACK_AUTH_FAILURE'; + +const slackAuthPending = makeActionCreator(SLACK_AUTH_PENDING); +const slackAuthSuccess = makeActionCreator(SLACK_AUTH_SUCCESS, 'user'); +const slackAuthFailure = makeActionCreator(SLACK_AUTH_FAILURE, 'error'); + +export function slackAuthAsync(code) { + return (dispatch) => { + dispatch(slackAuthPending()); + + client.post('/auth.slack', { + code: code, + }) + .then(data => { + auth.setToken(data.data.accessToken); + dispatch(updateUser(data.data.user)); + dispatch(updateTeam(data.data.team)); + dispatch(push('/dashboard')); + }) + // .catch((err) => { + // dispatch(push('/error')); + // }) + }; +}; \ No newline at end of file diff --git a/src/actions/TeamActions.js b/src/actions/TeamActions.js new file mode 100644 index 00000000..15eeafc3 --- /dev/null +++ b/src/actions/TeamActions.js @@ -0,0 +1,5 @@ +import makeActionCreator from '../utils/actions'; + +export const UPDATE_TEAM = 'UPDATE_TEAM'; + +export const updateTeam = makeActionCreator(UPDATE_TEAM, 'team'); diff --git a/src/actions/UserActions.js b/src/actions/UserActions.js new file mode 100644 index 00000000..1ccb4c47 --- /dev/null +++ b/src/actions/UserActions.js @@ -0,0 +1,5 @@ +import makeActionCreator from '../utils/actions'; + +export const UPDATE_USER = 'UPDATE_USER'; + +export const updateUser = makeActionCreator(UPDATE_USER, 'user'); diff --git a/src/Views/Login/Login.scss b/src/components/Button/Button.js similarity index 100% rename from src/Views/Login/Login.scss rename to src/components/Button/Button.js diff --git a/src/components/Button/Button.scss b/src/components/Button/Button.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/components/Button/index.js b/src/components/Button/index.js new file mode 100644 index 00000000..fbb219ae --- /dev/null +++ b/src/components/Button/index.js @@ -0,0 +1,2 @@ +import Button from './Button'; +export default Button; \ No newline at end of file diff --git a/src/components/Editor/Editor.js b/src/components/Editor/Editor.js new file mode 100644 index 00000000..8fbafa54 --- /dev/null +++ b/src/components/Editor/Editor.js @@ -0,0 +1,60 @@ +import React, { Component } from 'react'; +import { connect } from 'react-redux'; + +import MarkdownEditor from '../../components/MarkdownEditor'; + +import { + updateText, + replaceText, +} from '../../actions'; + +import constants from '../../constants'; + +import styles from './Editor.scss'; + +class Editor extends Component { + static propTypes = { + editMarkdown: React.PropTypes.func.isRequired, + text: React.PropTypes.string, + replaceText: React.PropTypes.func.isRequired, + showHistorySidebar: React.PropTypes.bool.isRequired, + } + + render() { + return ( +
    +
    + +
    +
    + ); + } +} + +const mapStateToProps = (state) => { + return { + text: state.text.text, + editor: state.editor, + showHistorySidebar: state.historySidebar.visible, + revisions: state.text.revisions, + }; +}; + +const mapDispatchToProps = (dispatch) => { + return { + editMarkdown: (text) => { + dispatch(updateText(text, 'markdown')); + }, + }; +}; + +Editor = connect( + mapStateToProps, + mapDispatchToProps, +)(Editor); + +export default Editor; diff --git a/src/Views/Dashboard/Dashboard.scss b/src/components/Editor/Editor.scss similarity index 100% rename from src/Views/Dashboard/Dashboard.scss rename to src/components/Editor/Editor.scss diff --git a/src/components/Editor/index.js b/src/components/Editor/index.js new file mode 100644 index 00000000..5e0bb9a7 --- /dev/null +++ b/src/components/Editor/index.js @@ -0,0 +1,2 @@ +import Editor from './Editor'; +export default Editor; diff --git a/src/components/Layout/Layout.js b/src/components/Layout/Layout.js new file mode 100644 index 00000000..e8e149e0 --- /dev/null +++ b/src/components/Layout/Layout.js @@ -0,0 +1,34 @@ +import React from 'react'; +import { connect } from 'react-redux'; + +import styles from './Layout.scss'; + +class Layout extends React.Component { + static propTypes = { + + } + + render() { + return ( +
    +
    +
    Coinbase
    +
    + +
    +
    +
    + { this.props.children } +
    +
    + ); + } +} + +const mapStateToProps = (state) => { + return { + avatarUrl: state.user ? state.user.avatarUrl : null, + } +}; + +export default connect(mapStateToProps)(Layout); \ No newline at end of file diff --git a/src/components/Layout/Layout.scss b/src/components/Layout/Layout.scss new file mode 100644 index 00000000..15052061 --- /dev/null +++ b/src/components/Layout/Layout.scss @@ -0,0 +1,35 @@ +.container { + display: flex; + flex: 1; + flex-direction: column; + + width: 100%; +} + +.header { + display: flex; + justify-content: space-between; + align-items: center; + padding: 0 20px; + + height: 42px; + border-bottom: 1px solid #eee; +} + +.teamName { + font-family: 'Atlas Grotesk'; + font-weight: bold; +} + +.user { + + img { + height: 24px; + width: 24px; + border-radius: 12px; + } +} + +.content { + flex: 1; +} \ No newline at end of file diff --git a/src/components/Layout/index.js b/src/components/Layout/index.js new file mode 100644 index 00000000..c396df43 --- /dev/null +++ b/src/components/Layout/index.js @@ -0,0 +1,2 @@ +import Layout from './Layout'; +export default Layout; \ No newline at end of file diff --git a/src/components/MarkdownEditor/codemirror.scss b/src/components/MarkdownEditor/codemirror.scss new file mode 100644 index 00000000..399e885d --- /dev/null +++ b/src/components/MarkdownEditor/codemirror.scss @@ -0,0 +1,66 @@ +/* + + Name: Base16 Default Light + Author: Chris Kempson (http://chriskempson.com) + + CodeMirror template by Jan T. Sott (https://github.com/idleberg/base16-codemirror) + Original Base16 color scheme by Chris Kempson (https://github.com/chriskempson/base16) + +*/ + +:global { + /* Custom styling */ + .cm-s-atlas.CodeMirror { + background: #ffffff; + color: #202020; + font-family: 'Atlas Typewriter', 'Cousine', 'Monaco', monospace; + font-weight: 300; + height: auto; + } + .cm-s-atlas div.CodeMirror-selected { + background: #90CAF9; + } + + /* Disable ondrag cursor for file uploads */ + .cm-s-atlas div.CodeMirror-dragcursors { + visibility: hidden; + } + + .cm-s-atlas .CodeMirror-line::selection, + .cm-s-atlas .CodeMirror-line > span::selection, + .cm-s-atlas .CodeMirror-line > span > span::selection { + background: #90CAF9; + } + + .cm-s-atlas .CodeMirror-line::-moz-selection, .cm-s-atlas .CodeMirror-line > span::-moz-selection, .cm-s-atlas .CodeMirror-line > span > span::-moz-selection { background: #e0e0e0; } + .cm-s-atlas .CodeMirror-gutters { background: #f5f5f5; border-right: 0px; } + .cm-s-atlas .CodeMirror-guttermarker { color: #ac4142; } + .cm-s-atlas .CodeMirror-guttermarker-subtle { color: #b0b0b0; } + .cm-s-atlas .CodeMirror-linenumber { color: #b0b0b0; } + .cm-s-atlas .CodeMirror-cursor { + border-left: 2px solid #2196F3; + } + + .cm-s-atlas span.cm-quote { + font-style: italic; + } + .cm-s-atlas span.cm-comment { color: #8f5536; } + .cm-s-atlas span.cm-atom { color: #aa759f; } + .cm-s-atlas span.cm-number { color: #aa759f; } + + .cm-s-atlas span.cm-property, .cm-s-atlas span.cm-attribute { color: #90a959; } + .cm-s-atlas span.cm-keyword { color: #ac4142; } + .cm-s-atlas span.cm-string { color: #f4bf75; } + + .cm-s-atlas span.cm-variable { color: #90a959; } + .cm-s-atlas span.cm-variable-2 { color: #788696; } + .cm-s-atlas span.cm-def { color: #d28445; } + .cm-s-atlas span.cm-bracket { color: #202020; } + .cm-s-atlas span.cm-tag { color: #ac4142; } + .cm-s-atlas span.cm-link { color: #aa759f; } + .cm-s-atlas span.cm-error { background: #ac4142; color: #505050; } + + .cm-s-atlas .CodeMirror-activeline-background { background: #DDDCDC; } + .cm-s-atlas .CodeMirror-matchingbracket { text-decoration: underline; color: white !important; } + .cm-s-atlas .CodeMirror-placeholder { color: rgba(0, 0, 0, 0.5); font-weight: bold; } +} \ No newline at end of file diff --git a/src/components/Preview/Preview.js b/src/components/Preview/Preview.js new file mode 100644 index 00000000..e69de29b diff --git a/src/components/Preview/index.js b/src/components/Preview/index.js new file mode 100644 index 00000000..1f98dc6f --- /dev/null +++ b/src/components/Preview/index.js @@ -0,0 +1,2 @@ +import Preview from './Preview'; +export default Preview; diff --git a/src/components/SlackAuthLink/SlackAuthLink.js b/src/components/SlackAuthLink/SlackAuthLink.js new file mode 100644 index 00000000..3f79ba5c --- /dev/null +++ b/src/components/SlackAuthLink/SlackAuthLink.js @@ -0,0 +1,43 @@ +import React from 'react'; + +import styles from './SlackAuthLink.scss'; + +export default class SlackAuthLink extends React.Component { + static propTypes = { + scopes: React.PropTypes.arrayOf(React.PropTypes.string), + } + + state = { + oauthState: Math.random().toString(36).substring(7), + } + + static defaultProps = { + scopes: ['identify'] + } + + componentDidMount = () => { + localStorage.oauthState = this.state.oauthState; + } + + slackUrl = () => { + const baseUrl = 'https://slack.com/oauth/authorize'; + const params = { + client_id: '30086650419.30130733398', + scope: this.props.scopes.join(" "), + redirect_uri: 'http://localhost:3000/auth/slack/', + state: this.state.oauthState, + }; + + const urlParams = Object.keys(params).map(function(key) { + return key + '=' + encodeURIComponent(params[key]); + }).join('&'); + + return `${baseUrl}?${urlParams}`; + } + + render() { + return ( +
    Authorize /w Slack + ) + } +} diff --git a/src/components/SlackAuthLink/SlackAuthLink.scss b/src/components/SlackAuthLink/SlackAuthLink.scss new file mode 100644 index 00000000..d1045d93 --- /dev/null +++ b/src/components/SlackAuthLink/SlackAuthLink.scss @@ -0,0 +1,6 @@ +.link { + text-decoration: none; + background: no-repeat left/10% url(./assets/slack_icon.svg); + padding: 5px 0 4px 36px; + font-size: 1.4em; +} \ No newline at end of file diff --git a/src/components/SlackAuthLink/assets/slack_icon.svg b/src/components/SlackAuthLink/assets/slack_icon.svg new file mode 100644 index 00000000..fc10280f --- /dev/null +++ b/src/components/SlackAuthLink/assets/slack_icon.svg @@ -0,0 +1,20 @@ + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/src/components/SlackAuthLink/index.js b/src/components/SlackAuthLink/index.js new file mode 100644 index 00000000..5dd283ab --- /dev/null +++ b/src/components/SlackAuthLink/index.js @@ -0,0 +1,2 @@ +import SlackAuthLink from './SlackAuthLink'; +export default SlackAuthLink; diff --git a/src/index.js b/src/index.js index a4230e86..851e6dfa 100644 --- a/src/index.js +++ b/src/index.js @@ -1,40 +1,46 @@ import React from 'react'; import { render } from 'react-dom'; import { Provider } from 'react-redux'; -import { Router, Route } from 'react-router'; +import { Router, Route, IndexRoute } from 'react-router'; import { createStore, applyMiddleware } from 'redux'; +import { routerMiddleware } from 'react-router-redux'; +import { persistStore, autoRehydrate } from 'redux-persist'; +import thunkMiddleware from 'redux-thunk'; import * as storage from 'redux-storage'; import createEngine from 'redux-storage-engine-localstorage'; -import History from './Utils/History'; +import createLogger from 'redux-logger'; +import History from 'utils/History'; -import Auth from './Utils/Auth'; +import auth from 'utils/auth'; -import reducers from './Reducers'; +import reducers from 'reducers'; -import App from './Views/App'; -import Login from './Views/Login'; -import Dashboard from './Views/Dashboard'; +import 'utils/base-styles.scss'; + +import Home from 'scenes/Home'; +import App from 'scenes/App'; +import Dashboard from 'scenes/Dashboard'; +import SlackAuth from 'scenes/SlackAuth'; // Redux const reducer = storage.reducer(reducers); -const engine = createEngine('atlas-store'); -const storageMiddleware = storage.createMiddleware(engine); +const loggerMiddleware = createLogger(); +const routerMiddlewareWithHistory = routerMiddleware(History); -const createStoreWithMiddleware = applyMiddleware(storageMiddleware)(createStore); -const store = createStoreWithMiddleware(reducer); +const createStoreWithMiddleware = (createStore); -const load = storage.createLoader(engine); -load(store); -// .then((newState) => console.log('Loaded state:', newState)); -// .catch(() => console.log('Failed to load previous state')); - -// React router +const store = createStore(reducer, applyMiddleware( + thunkMiddleware, + routerMiddlewareWithHistory, + loggerMiddleware, +), autoRehydrate()); +persistStore(store); function requireAuth(nextState, replace) { - if (!Auth.loggedIn()) { + if (!auth.loggedIn()) { replace({ - pathname: '/login', + pathname: '/', state: { nextPathname: nextState.location.pathname }, }); } @@ -43,7 +49,14 @@ function requireAuth(nextState, replace) { render(( - + + + + + + + + ), document.getElementById('root')); diff --git a/src/reducers/EditorReducer.js b/src/reducers/EditorReducer.js new file mode 100644 index 00000000..a610c8b7 --- /dev/null +++ b/src/reducers/EditorReducer.js @@ -0,0 +1,62 @@ +const defaultTest = `# Welcome to Beautiful Atlas + +This is just a small preview here's what you can do: + +- Write markdown or rich text, you choose +- Dont' worry about saving +- One document for now +- More to come +` + +const state = { + previousTest: null, + text: null, + unsavedChanges: false, +}; + +const text = (state = state, action) => { + + switch (action.type) { + case UPDATE_TEXT: { + let unsavedChanges = false; + if (lastRevision && lastRevision.text !== state.text) { + unsavedChanges = true; + } + return { + ...state, + unsavedChanges, + text: action.text, + }; + } + case ADD_REVISION: { + // Create new revision if it differs from the previous one + if (!lastRevision || lastRevision.text !== state.text) { + const lastId = lastRevision ? lastRevision.id : 0; + return { + ...state, + revisions: [ + ...state.revisions, + { + id: lastId + 1, + text: state.text, + created_at: action.createdAt, + }, + ], + unsavedChanges: false, + }; + } else { + return state; + } + } + case REPLACE_TEXT: { + const newText = state.text.replace(action.originalText, action.replacedText); + + return { + ...state, + text: newText, + }; + } + default: + return state; + } +}; \ No newline at end of file diff --git a/src/reducers/team.js b/src/reducers/team.js new file mode 100644 index 00000000..8b822db1 --- /dev/null +++ b/src/reducers/team.js @@ -0,0 +1,15 @@ +import { UPDATE_TEAM } from 'actions/TeamActions'; + +const team = (state = null, action) => { + switch (action.type) { + case UPDATE_TEAM: { + return { + ...action.team, + }; + } + default: + return state; + } +}; + +export default team; \ No newline at end of file diff --git a/src/reducers/user.js b/src/reducers/user.js new file mode 100644 index 00000000..4c502677 --- /dev/null +++ b/src/reducers/user.js @@ -0,0 +1,15 @@ +import { UPDATE_USER } from 'actions/UserActions'; + +const user = (state = null, action) => { + switch (action.type) { + case UPDATE_USER: { + return { + ...action.user, + }; + } + default: + return state; + } +}; + +export default user; \ No newline at end of file diff --git a/src/Views/App/App.js b/src/scenes/App/App.js similarity index 57% rename from src/Views/App/App.js rename to src/scenes/App/App.js index 44e89e36..288d0d32 100644 --- a/src/Views/App/App.js +++ b/src/scenes/App/App.js @@ -8,52 +8,28 @@ import styles from './App.scss'; import { toggleEditors, addRevision, - } from '../../Actions'; + } from '../../actions'; -import Header from '../../Components/Header'; -import Dashboard from '../Dashboard'; - -import Auth from '../../Utils/Auth'; +import Header from '../../components/Header'; +import Editor from '../../components/Editor'; class App extends Component { static propTypes = { children: React.PropTypes.element, - activeEditors: React.PropTypes.array.isRequired, - toggleEditors: React.PropTypes.func.isRequired, addRevision: React.PropTypes.func.isRequired, unsavedChanges: React.PropTypes.bool.isRequired, } - state = { - loggedIn: Auth.loggedIn(), - } - - componentWillMount = () => { - Auth.onChange = this.updateAuth; - } - - updateAuth = (loggedIn) => { - this.setState({ - loggedIn, - }); - } - - logout = () => { - // TODO: Replace with Redux actions - Auth.logout(); - } - render() { return (
    - +
    ); @@ -69,9 +45,6 @@ const mapStateToProps = (state) => { const mapDispatchToProps = (dispatch) => { return { - toggleEditors: (toggledEditor) => { - dispatch(toggleEditors(toggledEditor)); - }, addRevision: () => { dispatch(addRevision()); }, @@ -84,9 +57,3 @@ App = connect( )(App); export default App; - -// {this.state.loggedIn ? ( -// Logout -// ) : ( -// Login -// )} diff --git a/src/Views/App/App.scss b/src/scenes/App/App.scss similarity index 100% rename from src/Views/App/App.scss rename to src/scenes/App/App.scss diff --git a/src/Views/App/index.js b/src/scenes/App/index.js similarity index 100% rename from src/Views/App/index.js rename to src/scenes/App/index.js diff --git a/src/scenes/Dashboard/Dashboard.js b/src/scenes/Dashboard/Dashboard.js new file mode 100644 index 00000000..ef26cecd --- /dev/null +++ b/src/scenes/Dashboard/Dashboard.js @@ -0,0 +1,33 @@ +import React from 'react'; +import { connect } from 'react-redux'; +import { bindActionCreators } from 'redux'; +import { replace } from 'react-router-redux'; + +import { client } from 'utils/ApiClient'; + +import Layout from 'components/Layout'; +import styles from './Dashboard.scss'; + +class Dashboard extends React.Component { + static propTypes = { + replace: React.PropTypes.func.isRequired, + } + + render() { + return ( + header!} + > + holla! + + ); + } +} + +const mapDispatchToProps = (dispatch) => { + return bindActionCreators({ replace }, dispatch) +} + +export default connect( + null, mapDispatchToProps +)(Dashboard); diff --git a/src/scenes/Dashboard/Dashboard.scss b/src/scenes/Dashboard/Dashboard.scss new file mode 100644 index 00000000..e69de29b diff --git a/src/Views/Dashboard/index.js b/src/scenes/Dashboard/index.js similarity index 58% rename from src/Views/Dashboard/index.js rename to src/scenes/Dashboard/index.js index e5cb98c3..fcf5a0c0 100644 --- a/src/Views/Dashboard/index.js +++ b/src/scenes/Dashboard/index.js @@ -1,2 +1,2 @@ import Dashboard from './Dashboard'; -export default Dashboard; +export default Dashboard; \ No newline at end of file diff --git a/src/scenes/Home/Home.js b/src/scenes/Home/Home.js new file mode 100644 index 00000000..016113f8 --- /dev/null +++ b/src/scenes/Home/Home.js @@ -0,0 +1,63 @@ +import React from 'react'; +import { connect } from 'react-redux'; +import { bindActionCreators } from 'redux'; +import { replace } from 'react-router-redux'; + +import auth from '../../utils/auth'; + +import SlackAuthLink from '../../components/SlackAuthLink'; + +import styles from './Home.scss'; + +class Home extends React.Component { + static propTypes = { + replace: React.PropTypes.func.isRequired, + } + + componentDidMount = () => { + if (auth.loggedIn()) { + this.props.replace('/dashboard'); + } + } + + render() { + return ( +
    +
    +
    +

    + Hi there, +

    +

    + We're building the best place for engineers, designers and teams to + share ideas, tell stories and build knowledge. +

    +

    + **Atlas** can start as a wiki, but it's really + up to you what you want to make of it: +

    +

    + - Write documentation in _markdown_
    + - Build a blog around the API
    + - Hack the frontend for your needs (coming!)
    +

    +

    + We're just getting started. +

    +
    +
    + +
    +
    +
    + ); + } +} + +const mapDispatchToProps = (dispatch) => { + return bindActionCreators({ replace }, dispatch) +} + +export default connect( + null, mapDispatchToProps +)(Home); \ No newline at end of file diff --git a/src/scenes/Home/Home.scss b/src/scenes/Home/Home.scss new file mode 100644 index 00000000..52a2f6d5 --- /dev/null +++ b/src/scenes/Home/Home.scss @@ -0,0 +1,17 @@ +.container { + display: flex; + flex: 1; + justify-content: space-around; +} + +.content { + margin: 40px; + max-width: 640px; +} + +.intro { + font-family: "Atlas Typewriter", Monaco, monospace; + font-size: 1.4em; + line-height: 1.6em; + margin-bottom: 40px; +} \ No newline at end of file diff --git a/src/scenes/Home/animation.js b/src/scenes/Home/animation.js new file mode 100644 index 00000000..63be3a5f --- /dev/null +++ b/src/scenes/Home/animation.js @@ -0,0 +1,26 @@ +import React from 'react'; +import { Frame } from 'react-keyframes'; + +let frames = []; +const p = (node) => frames.push(node); +const E = (props) => { + return ({ props.children }); +}; + +const line1 = (

    Hi there,

    ); +const line2 = (

    We're excited to share what we’re building.

    ); +const line3 = (

    We **love** Markdown,

    ); +const line4 = (

    but we also get that it's not for everyone.

    ); +const line5 = (

    Together with you,

    ); +const line6 = (

    we want to build the best place to

    ); +const line7 = (

    share ideas,

    ); +const line8 = (

    tell stories,

    ); +const line9 = (

    and build knowledge.

    ); +const line10 = (

    We're just getting started.

    ); +const line11 = (

    Welcome to Beautiful Atlas.

    ); + +p({line1}{line2}{line3}{line4}{line5}{line6}{line7}{line8}{line9}{line10}{line11}); + +// Hmms leaving this here for now, would be nice to something + +export default frames; \ No newline at end of file diff --git a/src/scenes/Home/index.js b/src/scenes/Home/index.js new file mode 100644 index 00000000..50b4d64a --- /dev/null +++ b/src/scenes/Home/index.js @@ -0,0 +1,2 @@ +import Home from './Home'; +export default Home; \ No newline at end of file diff --git a/src/scenes/SlackAuth/SlackAuth.js b/src/scenes/SlackAuth/SlackAuth.js new file mode 100644 index 00000000..9a7cb83a --- /dev/null +++ b/src/scenes/SlackAuth/SlackAuth.js @@ -0,0 +1,35 @@ +import React from 'react'; +import { connect } from 'react-redux'; +import { bindActionCreators } from 'redux'; + +import { slackAuthAsync } from '../../actions/SlackAuthAction'; + +import { client } from '../../utils/ApiClient'; + +class SlackAuth extends React.Component { + componentDidMount = () => { + const { query } = this.props.location + + // Validate OAuth2 state param + if (localStorage.oauthState != query.state) { + return; + } + + this.props.slackAuthAsync(query.code); + } + + render() { + return ( +
    Loading...
    + ); + } +} + +const mapDispactcToProps = (dispatch) => { + return bindActionCreators({ slackAuthAsync }, dispatch); +}; + +export default connect( + null, + mapDispactcToProps +)(SlackAuth); \ No newline at end of file diff --git a/src/scenes/SlackAuth/index.js b/src/scenes/SlackAuth/index.js new file mode 100644 index 00000000..1e94b5c2 --- /dev/null +++ b/src/scenes/SlackAuth/index.js @@ -0,0 +1,2 @@ +import SlackAuth from './SlackAuth'; +export default SlackAuth; diff --git a/src/utils/actions.js b/src/utils/actions.js new file mode 100644 index 00000000..dea6f1bf --- /dev/null +++ b/src/utils/actions.js @@ -0,0 +1,9 @@ +export default (type, ...argNames) => { + return function(...args) { + let action = { type } + argNames.forEach((arg, index) => { + action[argNames[index]] = args[index] + }) + return action + } +} diff --git a/src/utils/base-styles.scss b/src/utils/base-styles.scss new file mode 100644 index 00000000..8b6a0ea3 --- /dev/null +++ b/src/utils/base-styles.scss @@ -0,0 +1,23 @@ +* { + box-sizing: border-box; +} + +html, body, .viewport { + width: 100%; + height: 100%; + margin: 0; +} + +html, body { + font-family: 'Atlas Grotesk', 'Helvetica Neue', sans-serif; +} + +a { + color: #0C77F8; +} + +:global { + .Codemirror { + height: auto; + } +} \ No newline at end of file diff --git a/webpack.config.dev.js b/webpack.config.dev.js index d2656ab7..d64cdbc3 100644 --- a/webpack.config.dev.js +++ b/webpack.config.dev.js @@ -1,17 +1,19 @@ var path = require('path'); var webpack = require('webpack'); -commonWebpackConfig = require('./webpack.config'); +const commonWebpackConfig = require('./webpack.config'); -developmentWebpackConfig = Object.assign(commonWebpackConfig, { +const developmentWebpackConfig = Object.assign(commonWebpackConfig, { cache: true, devtool: 'eval', entry: [ + 'babel-polyfill', 'webpack-hot-middleware/client', './src/index', ], }); +developmentWebpackConfig.plugins.push(new webpack.optimize.OccurenceOrderPlugin()); developmentWebpackConfig.plugins.push(new webpack.HotModuleReplacementPlugin()); developmentWebpackConfig.plugins.push(new webpack.NoErrorsPlugin()); diff --git a/webpack.config.js b/webpack.config.js index 9a2ace63..244e0ab5 100644 --- a/webpack.config.js +++ b/webpack.config.js @@ -23,20 +23,20 @@ module.exports = { include: path.join(__dirname, 'src') }, { test: /\.json$/, loader: 'json-loader' }, - { test: /\.scss$/, loader: 'style!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!sass?sourceMap' }, - { test: /\.css$/, loader: 'style!css-loader' }, - { test: /\.(png|jpg)$/, loader: 'url-loader?limit=8192' }, // inline base64 URLs for <=8k images, direct URLs for the rest + { test: /\.s?css$/, loader: 'style!css-loader?modules&importLoaders=1&localIdentName=[name]__[local]___[hash:base64:5]!sass?sourceMap' }, + { test: /\.(png|jpg|svg)$/, loader: 'url-loader' }, // inline base64 URLs for <=8k images, direct URLs for the rest { test: /\.woff$/, loader: 'url-loader?limit=65000&mimetype=application/font-woff&name=public/fonts/[name].[ext]' }, ] }, resolve: { + root: path.resolve('./src'), // you can now require('file') instead of require('file.json') extensions: ['', '.js', '.json'] }, plugins: [ definePlugin, new webpack.ProvidePlugin({ - 'fetch': 'imports?this=>global!exports?global.fetch!whatwg-fetch' + 'fetch': 'imports?this=>global!exports?global.fetch!isomorphic-fetch' }), ] }; \ No newline at end of file diff --git a/webpack.config.prod.js b/webpack.config.prod.js index 16d9efb4..3ed91f64 100644 --- a/webpack.config.prod.js +++ b/webpack.config.prod.js @@ -6,7 +6,10 @@ commonWebpackConfig = require('./webpack.config'); productionWebpackConfig = Object.assign(commonWebpackConfig, { cache: true, devtool: 'cheap-module-source-map', - entry: './src/index', + entry: [ + 'babel-polyfill', + './src/index', + ], output: { path: path.join(__dirname, 'dist'), filename: 'bundle.js',