text: (window.webpackJsonp=window.webpackJsonp||[]).push([[4],{1062:function(e,t,n){"use strict";(function(e){var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(69).withStorySource,i=n(0),d=n(199),l=n(198),s=n(131),c=function(e){function t(t){var n=e.call(this,t)||this;return n.handleValueChange=function(e){n.setState({mdeState:e})},n.state={mdeState:{markdown:"**Hello world!**"}},n.converter=new d.Converter({tables:!0,simplifiedAutoLink:!0,strikethrough:!0,tasklists:!0}),n}return o(t,e),t.prototype.render=function(){var e=this;return i.createElement(l.default,{layout:"noPreview",onChange:this.handleValueChange,editorState:this.state.mdeState,generateMarkdownPreview:function(t){return Promise.resolve(e.converter.makeHtml(t))}})},t}(i.Component);s.storiesOf("Layouts",e).addDecorator(a("import * as React from 'react';\nimport * as Showdown from 'showdown';\nimport ReactMde, { ReactMdeTypes } from '../../../src/index';\nimport { storiesOf } from '@storybook/react';\n\ninterface VerticalLayoutStoryComponentState {\n  mdeState: ReactMdeTypes.MdeState;\n}\n\nclass VerticalLayoutStoryComponent extends React.Component<{}, VerticalLayoutStoryComponentState> {\n  converter: Showdown.Converter;\n\n  constructor(props) {\n    super(props);\n    this.state = {\n      mdeState: {\n        markdown: '**Hello world!**',\n      },\n    };\n    this.converter = new Showdown.Converter({\n      tables: true,\n      simplifiedAutoLink: true,\n      strikethrough: true,\n      tasklists: true,\n    });\n  }\n\n  handleValueChange = (mdeState: ReactMdeTypes.MdeState) => {\n    this.setState({ mdeState });\n  };\n\n  render() {\n    return (\n      <ReactMde\n        layout=\"noPreview\"\n        onChange={this.handleValueChange}\n        editorState={this.state.mdeState}\n        generateMarkdownPreview={markdown => Promise.resolve(this.converter.makeHtml(markdown))}\n      />\n    );\n  }\n}\n\nstoriesOf('Layouts', module).add('noPreview', () => <VerticalLayoutStoryComponent />);\n",{"Layouts@noPreview":{startLoc:{col:33,line:44},endLoc:{col:84,line:44}}})).add("noPreview",function(){return i.createElement(c,null)})}).call(this,n(70)(e))},1063:function(e,t,n){"use strict";(function(e){var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(69).withStorySource,i=n(0),d=n(199),l=n(198),s=n(131),c=function(e){function t(t){var n=e.call(this,t)||this;return n.handleValueChange=function(e){n.setState({mdeState:e})},n.state={mdeState:{markdown:"**Hello world!**"}},n.converter=new d.Converter({tables:!0,simplifiedAutoLink:!0,strikethrough:!0,tasklists:!0}),n}return o(t,e),t.prototype.render=function(){var e=this;return i.createElement(l.default,{layout:"tabbed",onChange:this.handleValueChange,editorState:this.state.mdeState,generateMarkdownPreview:function(t){return Promise.resolve(e.converter.makeHtml(t))}})},t}(i.Component);s.storiesOf("Layouts",e).addDecorator(a("import * as React from 'react';\nimport * as Showdown from 'showdown';\nimport ReactMde, { ReactMdeTypes } from '../../../src/index';\nimport { storiesOf } from '@storybook/react';\n\ninterface VerticalLayoutStoryComponentState {\n  mdeState: ReactMdeTypes.MdeState;\n}\n\nclass VerticalLayoutStoryComponent extends React.Component<{}, VerticalLayoutStoryComponentState> {\n  converter: Showdown.Converter;\n\n  constructor(props) {\n    super(props);\n    this.state = {\n      mdeState: {\n        markdown: '**Hello world!**',\n      },\n    };\n    this.converter = new Showdown.Converter({\n      tables: true,\n      simplifiedAutoLink: true,\n      strikethrough: true,\n      tasklists: true,\n    });\n  }\n\n  handleValueChange = (mdeState: ReactMdeTypes.MdeState) => {\n    this.setState({ mdeState });\n  };\n\n  render() {\n    return (\n      <ReactMde\n        layout=\"tabbed\"\n        onChange={this.handleValueChange}\n        editorState={this.state.mdeState}\n        generateMarkdownPreview={markdown => Promise.resolve(this.converter.makeHtml(markdown))}\n      />\n    );\n  }\n}\n\nstoriesOf('Layouts', module).add('tabbed', () => <VerticalLayoutStoryComponent />);\n",{"Layouts@tabbed":{startLoc:{col:33,line:44},endLoc:{col:81,line:44}}})).add("tabbed",function(){return i.createElement(c,null)})}).call(this,n(70)(e))},1064:function(e,t,n){"use strict";(function(e){var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(69).withStorySource,i=n(0),d=n(199),l=n(198),s=n(131),c=function(e){function t(t){var n=e.call(this,t)||this;return n.handleValueChange=function(e){n.setState({mdeState:e})},n.state={mdeState:{markdown:"**Hello world!**"}},n.converter=new d.Converter({tables:!0,simplifiedAutoLink:!0,strikethrough:!0,tasklists:!0}),n}return o(t,e),t.prototype.render=function(){var e=this;return i.createElement(l.default,{layout:"horizontal",onChange:this.handleValueChange,editorState:this.state.mdeState,generateMarkdownPreview:function(t){return Promise.resolve(e.converter.makeHtml(t))}})},t}(i.Component);s.storiesOf("Layouts",e).addDecorator(a("import * as React from 'react';\nimport * as Showdown from 'showdown';\nimport ReactMde, { ReactMdeTypes } from '../../../src/index';\nimport { storiesOf } from '@storybook/react';\n\ninterface VerticalLayoutStoryComponentState {\n  mdeState: ReactMdeTypes.MdeState;\n}\n\nclass VerticalLayoutStoryComponent extends React.Component<{}, VerticalLayoutStoryComponentState> {\n  converter: Showdown.Converter;\n\n  constructor(props) {\n    super(props);\n    this.state = {\n      mdeState: {\n        markdown: '**Hello world!**',\n      },\n    };\n    this.converter = new Showdown.Converter({\n      tables: true,\n      simplifiedAutoLink: true,\n      strikethrough: true,\n      tasklists: true,\n    });\n  }\n\n  handleValueChange = (mdeState: ReactMdeTypes.MdeState) => {\n    this.setState({ mdeState });\n  };\n\n  render() {\n    return (\n      <ReactMde\n        layout=\"horizontal\"\n        onChange={this.handleValueChange}\n        editorState={this.state.mdeState}\n        generateMarkdownPreview={markdown => Promise.resolve(this.converter.makeHtml(markdown))}\n      />\n    );\n  }\n}\n\nstoriesOf('Layouts', module).add('horizontal', () => <VerticalLayoutStoryComponent />);\n",{"Layouts@horizontal":{startLoc:{col:33,line:44},endLoc:{col:85,line:44}}})).add("horizontal",function(){return i.createElement(c,null)})}).call(this,n(70)(e))},1065:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(486),o=function(){return function(){this.vertical=r.VerticalLayout,this.noPreview=r.NoPreviewLayout,this.horizontal=r.HorizontalLayout,this.tabbed=r.TabbedLayout}}();t.LayoutMap=o;var a=new o;t.layoutMap=a},1066:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,a){function i(e){try{l(r.next(e))}catch(e){a(e)}}function d(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(i,d)}l((r=r.apply(e,t||[])).next())})},i=this&&this.__generator||function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:d(0),throw:d(1),return:d(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function d(a){return function(d){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,d])}}};Object.defineProperty(t,"__esModule",{value:!0});var d=n(0),l=n(260),s=n(1065),c=n(259),u=n(33),m=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleOnChange=function(e){var n=e.markdown,r=e.html,o=e.draftEditorState;(0,t.props.onChange)({markdown:n,html:r,draftEditorState:o})},t.handleDraftStateChange=function(e){var n=t.props.generateMarkdownPreview;u.getMdeStateFromDraftState(e,n).then(function(n){t.handleOnChange({html:n.html,markdown:n.markdown,draftEditorState:e})})},t.onCommand=function(e){if(e.execute){var n=t.props.editorState.draftEditorState,r=e.execute(n);if("Promise"===r.constructor.name)return r.then(function(e){return t.handleDraftStateChange(e)});var o=r;return t.handleDraftStateChange(o)}},t}return o(t,e),t.prototype.componentDidMount=function(){return a(this,void 0,void 0,function(){var e,t,n,r,o;return i(this,function(a){switch(a.label){case 0:return e=this.props,t=e.editorState,n=e.generateMarkdownPreview,!t||t.draftEditorState?[2]:!(r={html:t.html,markdown:t.markdown,draftEditorState:c.EditorState.createWithContent(c.ContentState.createFromText(t.markdown))}).markdown||r.html||null==n?[3,2]:(o=r,[4,n(r.markdown)]);case 1:o.html=a.sent(),a.label=2;case 2:return this.handleOnChange(r),[2]}})})},t.prototype.render=function(){var e=s.layoutMap[this.props.layout],t=this.props,n=t.commands,r=t.layoutOptions,o=t.className,a=t.emptyPreviewHtml,i=t.readOnly,l=this.props.editorState;return l&&l.draftEditorState||(l={html:"",markdown:"",draftEditorState:c.EditorState.createEmpty()}),d.createElement("div",{className:"react-mde "+(o||"")},d.createElement(e,{onChange:this.handleDraftStateChange,onCommand:this.onCommand,commands:n,layoutOptions:r,mdeEditorState:l,emptyPreviewHtml:a,readOnly:i}))},t.defaultProps={commands:l.getDefaultCommands(),layout:"vertical",emptyPreviewHtml:"<p>&nbsp;</p>",readOnly:!1},t}(d.Component);t.ReactMde=m},1067:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),i=n(26);t.TAB_CODE="TAB_CODE",t.TAB_PREVIEW="TAB_PREVIEW";var d=function(e){function n(){var n=null!==e&&e.apply(this,arguments)||this;return n.state={tab:t.TAB_CODE},n.handleMdeStateChange=function(e){(0,n.props.onChange)(e)},n.handleCommand=function(e){(0,n.props.onCommand)(e)},n}return o(n,e),n.prototype.render=function(){var e=this,n=this.props,r=n.commands,o=n.mdeEditorState,d=n.emptyPreviewHtml,l=n.readOnly,s="mde-tab",c="mde-tab";switch(this.state.tab){case t.TAB_CODE:s+=" mde-tab-activated";break;case t.TAB_PREVIEW:c+=" mde-tab-activated"}return a.createElement("div",{className:"react-mde-tabbed-layout"},a.createElement(i.MdeToolbar,{commands:r,onCommand:this.handleCommand,readOnly:l},a.createElement("div",{className:"mde-tabs"},a.createElement("button",{type:"button",className:s,onClick:function(){return e.setState({tab:t.TAB_CODE})}},"Code"),a.createElement("button",{type:"button",className:c,onClick:function(){return e.setState({tab:t.TAB_PREVIEW})}},"Preview"))),this.state.tab===t.TAB_CODE?a.createElement(i.MdeEditor,{editorRef:function(t){return e.editorRef=t},onChange:this.handleMdeStateChange,editorState:o,readOnly:l}):a.createElement(i.MdePreview,{previewRef:function(t){return e.previewRef=t},html:o?o.html:"",emptyPreviewHtml:d}))},n}(a.Component);t.TabbedLayout=d},1068:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),d=n(26),l=n(194),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleMdeStateChange=function(e){(0,t.props.onChange)(e)},t.handleCommand=function(e){(0,t.props.onCommand)(e)},t}return o(t,e),t.prototype.render=function(){var e=this,t=this.props,n=t.commands,r=t.mdeEditorState,o=t.layoutOptions,s=t.emptyPreviewHtml,c=t.readOnly,u=o?a({},o):{};return i.createElement("div",{className:"react-mde-horizontal-layout"},i.createElement(d.MdeToolbar,{commands:n,onCommand:this.handleCommand,readOnly:c}),i.createElement("div",{className:"mde-content"},i.createElement(d.MdeEditor,{className:l(u.editorClassName),editorRef:function(t){return e.editorRef=t},onChange:this.handleMdeStateChange,editorState:r,readOnly:c}),i.createElement(d.MdePreview,{className:l(u.editorClassName),previewRef:function(t){return e.previewRef=t},html:r?r.html:"",emptyPreviewHtml:s})))},t}(i.Component);t.HorizontalLayout=s},1069:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),i=n(26),d=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleMdeStateChange=function(e){(0,t.props.onChange)(e)},t.handleCommand=function(e){(0,t.props.onCommand)(e)},t}return o(t,e),t.prototype.render=function(){var e=this,t=this.props,n=t.commands,r=t.mdeEditorState,o=t.readOnly;return a.createElement("div",{className:"react-mde-no-preview-layout"},a.createElement(i.MdeToolbar,{commands:n,onCommand:this.handleCommand,readOnly:o}),a.createElement(i.MdeEditor,{editorRef:function(t){return e.editorRef=t},onChange:this.handleMdeStateChange,editorState:r,readOnly:o}))},t}(a.Component);t.NoPreviewLayout=d},1070:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),d=n(26),l=n(194),s=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleMdeStateChange=function(e){(0,t.props.onChange)(e)},t.handleCommand=function(e){(0,t.props.onCommand)(e)},t}return o(t,e),t.prototype.render=function(){var e=this,t=this.props,n=t.commands,r=t.mdeEditorState,o=t.layoutOptions,s=t.emptyPreviewHtml,c=t.readOnly,u=o?a({},o):{};return i.createElement("div",{className:"react-mde-vertical-layout"},i.createElement(d.MdeToolbar,{commands:n,onCommand:this.handleCommand,readOnly:c}),i.createElement("div",{className:"react-mde-content"},i.createElement(d.MdeEditor,{className:l(u.editorClassName),editorRef:function(t){return e.editorRef=t},onChange:this.handleMdeStateChange,editorState:r,readOnly:c}),i.createElement(d.MdePreview,{className:l(u.previewClassName),previewRef:function(t){return e.previewRef=t},html:r?r.html:"",emptyPreviewHtml:s})))},t}(i.Component);t.VerticalLayout=s},1071:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0})},1072:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(39),o=n(33);t.tabCommand={buttonContent:null,buttonProps:null,execute:function(e,t){var n=o.getMarkdownStateFromDraftState(e);return n=r.onTab(n,t),o.buildNewDraftState(e,n)}}},1073:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(39),a=n(33),i=n(26);t.checkListCommand={buttonContent:r.createElement(i.MdeToolbarIcon,{icon:"tasks"}),buttonProps:{"aria-label":"Insert checklist"},execute:function(e){var t=a.getMarkdownStateFromDraftState(e);return t=o.makeList(t,"- [ ] "),a.buildNewDraftState(e,t)}}},1074:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(39),a=n(33),i=n(26);t.unorderedListCommand={buttonContent:r.createElement(i.MdeToolbarIcon,{icon:"list-ul"}),buttonProps:{"aria-label":"Insert a bulleted list"},execute:function(e){var t=a.getMarkdownStateFromDraftState(e);return t=o.makeList(t,"- "),a.buildNewDraftState(e,t)}}},1075:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(39),a=n(33),i=n(26);t.quoteCommand={buttonContent:r.createElement(i.MdeToolbarIcon,{icon:"quote-right"}),buttonProps:{"aria-label":"Insert a quote"},execute:function(e){var t,n=a.getMarkdownStateFromDraftState(e),r=n.text,i=n.selection;return i=o.selectWordIfCaretIsInsideOne({text:r,selection:i}),r=(t=o.insertBreaksBeforeSoThatThereIsAnEmptyLineBefore({text:r,selection:i})).newText,i=t.newSelection,r=(t=o.insertBefore(r,"> ",i,!1)).newText,i=t.newSelection,r=(t=o.insertBreaksAfterSoThatThereIsAnEmptyLineAfter({text:r,selection:i})).newText,i=t.newSelection,a.buildNewDraftState(e,{text:r,selection:i})}}},1076:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(39),a=n(33),i=n(26);t.orderedListCommand={buttonContent:r.createElement(i.MdeToolbarIcon,{icon:"list-ol"}),buttonProps:{"aria-label":"Insert numbered list"},execute:function(e){var t=a.getMarkdownStateFromDraftState(e);return t=o.makeList(t,function(e,t){return t+1+". "}),a.buildNewDraftState(e,t)}}},1077:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(39),a=n(33),i=n(26);t.linkCommand={buttonContent:r.createElement(i.MdeToolbarIcon,{icon:"link"}),buttonProps:{"aria-label":"Insert a link"},execute:function(e){var t=a.getMarkdownStateFromDraftState(e),n=t.text,r=t.selection,i=o.selectWordIfCaretIsInsideOne({text:n,selection:r}),d=o.insertText(n,"[",i.start),l=d.newText,s=d.insertionLength,c=o.insertText(l,"](url)",i.end+s).newText;return a.buildNewDraftState(e,{text:c,selection:{start:i.start+s,end:i.end+s}})}}},1078:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(39),a=n(33),i=n(26);t.strikethroughCommand={buttonContent:r.createElement(i.MdeToolbarIcon,{icon:"strikethrough"}),buttonProps:{"aria-label":"Add strikethrough text"},execute:function(e){var t=a.getMarkdownStateFromDraftState(e);return t=o.insertBeforeAndAfter(t,"~~"),a.buildNewDraftState(e,t)}}},1079:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(39),a=n(33),i=n(26);t.italicCommand={buttonContent:r.createElement(i.MdeToolbarIcon,{icon:"italic"}),buttonProps:{"aria-label":"Add italic text"},execute:function(e){var t=a.getMarkdownStateFromDraftState(e);return t=o.insertBeforeAndAfter(t,"_"),a.buildNewDraftState(e,t)}}},1080:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(39),a=n(33),i=n(26);t.imageCommand={buttonContent:r.createElement(i.MdeToolbarIcon,{icon:"image"}),buttonProps:{"aria-label":"Insert a picture"},execute:function(e){var t=a.getMarkdownStateFromDraftState(e),n=t.text,r=t.selection,i=o.insertText(n,"![",r.start),d=i.newText,l=i.insertionLength,s=o.insertText(d,"](image-url)",r.end+l).newText;return a.buildNewDraftState(e,{text:s,selection:{start:r.start+l,end:r.end+l}})}}},1081:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(39),a=n(33),i=n(26);function d(e,t){var n=a.getMarkdownStateFromDraftState(e);return n=o.makeHeader(n,t),a.buildNewDraftState(e,n)}t.headerCommand={buttonContent:r.createElement(i.MdeToolbarIcon,{icon:"heading"}),buttonProps:{"aria-label":"Add header"},children:[{buttonContent:r.createElement("p",{className:"header-1"},"Header 1"),execute:function(e){return d(e,"# ")}},{buttonContent:r.createElement("p",{className:"header-2"},"Header 2"),execute:function(e){return d(e,"## ")}},{buttonContent:r.createElement("p",{className:"header-3"},"Header 3"),execute:function(e){return d(e,"### ")}},{buttonContent:r.createElement("p",{className:"header-4"},"Header 4"),execute:function(e){return d(e,"#### ")}}]}},1082:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(39),a=n(33),i=n(26);t.codeCommand={buttonContent:r.createElement(i.MdeToolbarIcon,{icon:"code"}),buttonProps:{"aria-label":"Insert code"},execute:function(e){var t,n=a.getMarkdownStateFromDraftState(e),r=n.text,i=n.selection;if(i=o.selectWordIfCaretIsInsideOne({text:r,selection:i}),-1===r.slice(i.start,i.end).indexOf("\n")){var d=o.insertBeforeAndAfter({text:r,selection:i},"`");return a.buildNewDraftState(e,d)}return r=(t=o.insertBreaksBeforeSoThatThereIsAnEmptyLineBefore({text:r,selection:i})).newText,i=t.newSelection,r=(t=o.insertBefore(r,"```\n",i,!1)).newText,i=t.newSelection,r=(t=o.insertAfter(r,"\n```",i)).newText,i=t.newSelection,r=(t=o.insertBreaksAfterSoThatThereIsAnEmptyLineAfter({text:r,selection:i})).newText,i=t.newSelection,a.buildNewDraftState(e,{text:r,selection:i})}}},1083:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(488),a=n(487),i=n(244);t.MdeToolbar=function(e){var t=e.children,n=e.commands,d=e.onCommand,l=e.readOnly;return n&&0!==n.length||t?r.createElement("div",{className:"mde-header"},n.map(function(e,t){return r.createElement(o.MdeToolbarButtonGroup,{key:t},e.map(function(e,t){return e.children?r.createElement(a.MdeToolbarDropdown,{key:t,buttonProps:e.buttonProps,buttonContent:e.buttonContent,commands:e.children,onCommand:function(e){return d(e)},readOnly:l}):r.createElement(i.MdeToolbarButton,{key:t,buttonContent:e.buttonContent,buttonProps:e.buttonProps,onClick:function(){return d(e)},readOnly:l})}))}),r.createElement("div",{className:"mde-toolbar-children"},t)):null}},1084:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),i=n(259),d=n(260),l=function(e){function t(){var t=null!==e&&e.apply(this,arguments)||this;return t.handleOnChange=function(e){(0,t.props.onChange)(e)},t.executeCastAsEditorState=function(e,t,n){return e.execute(t,n)},t.handleKeyCommand=function(e,n){var r=t.props.onChange;switch(e){case"bold":return r(t.executeCastAsEditorState(d.boldCommand,n)),"handled";case"italic":return r(t.executeCastAsEditorState(d.italicCommand,n)),"handled";case"code":return r(t.executeCastAsEditorState(d.codeCommand,n)),"handled";default:return"not-handled"}},t.handleTab=function(e){e.preventDefault();var n=t.props,r=n.editorState.draftEditorState;(0,n.onChange)(t.executeCastAsEditorState(d.tabCommand,r,e.shiftKey))},t}return o(t,e),t.prototype.render=function(){var e=this,t=this.props,n=t.editorState.draftEditorState,r=t.className,o=t.readOnly;return a.createElement("div",{className:"mde-text "+(r||"")},a.createElement(i.Editor,{ref:function(t){return e.editorRef=t},stripPastedStyles:!0,editorState:n,onChange:this.handleOnChange,onTab:this.handleTab,handleKeyCommand:this.handleKeyCommand,readOnly:o}))},t}(a.Component);t.MdeEditor=l},1085:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(0),i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.render=function(){var e=this,t=this.props,n=t.html,r=t.className;return a.createElement("div",{className:"mde-preview "+(r||"")},a.createElement("div",{className:"mde-preview-content",dangerouslySetInnerHTML:{__html:n||"<p>&nbsp;</p>"},ref:function(t){return e.previewRef=t}}))},t}(a.Component);t.MdePreview=i},1086:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);t.MdeToolbarIcon=function(e){var t=e.icon;return r.createElement("i",{className:"fas fa-"+t,"aria-hidden":"true"})}},1171:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0),o=n(39),a=n(33),i=n(26);t.boldCommand={buttonContent:r.createElement(i.MdeToolbarIcon,{icon:"bold"}),buttonProps:{"aria-label":"Add bold text"},execute:function(e){var t=a.getMarkdownStateFromDraftState(e);return t=o.insertBeforeAndAfter(t,"**"),a.buildNewDraftState(e,t)}}},1172:function(e,t,n){"use strict";(function(e){var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)});Object.defineProperty(t,"__esModule",{value:!0});var a=n(69).withStorySource,i=n(0),d=n(199),l=n(198),s=n(131),c=function(e){function t(t){var n=e.call(this,t)||this;return n.handleValueChange=function(e){n.setState({mdeState:e})},n.state={mdeState:{markdown:"**Hello world!**"}},n.converter=new d.Converter({tables:!0,simplifiedAutoLink:!0,strikethrough:!0,tasklists:!0}),n}return o(t,e),t.prototype.render=function(){var e=this;return i.createElement(l.default,{layout:"vertical",onChange:this.handleValueChange,editorState:this.state.mdeState,generateMarkdownPreview:function(t){return Promise.resolve(e.converter.makeHtml(t))}})},t}(i.Component);s.storiesOf("Layouts",e).addDecorator(a("import * as React from 'react';\nimport * as Showdown from 'showdown';\nimport ReactMde, { ReactMdeTypes } from '../../../src/index';\nimport { storiesOf } from '@storybook/react';\n\ninterface VerticalLayoutStoryComponentState {\n  mdeState: ReactMdeTypes.MdeState;\n}\n\nclass VerticalLayoutStoryComponent extends React.Component<{}, VerticalLayoutStoryComponentState> {\n  converter: Showdown.Converter;\n\n  constructor(props) {\n    super(props);\n    this.state = {\n      mdeState: {\n        markdown: '**Hello world!**',\n      },\n    };\n    this.converter = new Showdown.Converter({\n      tables: true,\n      simplifiedAutoLink: true,\n      strikethrough: true,\n      tasklists: true,\n    });\n  }\n\n  handleValueChange = (mdeState: ReactMdeTypes.MdeState) => {\n    this.setState({ mdeState });\n  };\n\n  render() {\n    return (\n      <ReactMde\n        layout=\"vertical\"\n        onChange={this.handleValueChange}\n        editorState={this.state.mdeState}\n        generateMarkdownPreview={markdown => Promise.resolve(this.converter.makeHtml(markdown))}\n      />\n    );\n  }\n}\n\nstoriesOf('Layouts', module).add('vertical', () => <VerticalLayoutStoryComponent />);\n",{"Layouts@vertical":{startLoc:{col:33,line:44},endLoc:{col:83,line:44}}})).add("vertical",function(){return i.createElement(c,null)})}).call(this,n(70)(e))},1173:function(e,t,n){(e.exports=n(263)(!0)).push([e.i,"body {\n  font-size: 14px;\n  font-family: sans-serif; }\n","",{version:3,sources:["D:/Git/react-mde/.storybook/styles/.storybook/styles/demo.scss"],names:[],mappings:"AAEA;EACI,gBAAe;EACf,wBAAuB,EAC1B",file:"demo.scss",sourcesContent:["@import 'variables.scss';\n\nbody {\n    font-size: 14px;\n    font-family: sans-serif;\n}"],sourceRoot:""}])},1174:function(e,t,n){var r=n(1173);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(262)(r,o);r.locals&&(e.exports=r.locals)},1175:function(e,t,n){(e.exports=n(263)(!0)).push([e.i,'.mde-header {\n  flex-shrink: 0;\n  display: flex;\n  flex-wrap: wrap;\n  align-items: stretch;\n  border-bottom: 1px solid #c8ccd0;\n  border-radius: 2px 2px 0 0;\n  background: #f9f9f9; }\n  .mde-header .mde-toolbar-children {\n    flex-grow: 1;\n    display: flex;\n    justify-content: flex-end;\n    align-items: stretch; }\n  .mde-header button:focus {\n    outline: 0; }\n  .mde-header ul.mde-header-group {\n    margin: 0;\n    padding: 10px;\n    list-style: none;\n    display: flex;\n    flex-wrap: nowrap; }\n    .mde-header ul.mde-header-group li.mde-header-item {\n      display: inline-block;\n      position: relative;\n      margin: 0 4px; }\n      .mde-header ul.mde-header-group li.mde-header-item button {\n        text-align: left;\n        cursor: pointer;\n        height: 22px;\n        padding: 4px;\n        margin: 0;\n        border: none;\n        background: none;\n        color: #242729; }\n\n@keyframes tooltip-appear {\n  from {\n    opacity: 0; }\n  to {\n    opacity: 1; } }\n        .mde-header ul.mde-header-group li.mde-header-item button.tooltipped:hover::before {\n          animation-name: tooltip-appear;\n          animation-duration: 0.2s;\n          animation-delay: 0.5s;\n          animation-fill-mode: forwards;\n          opacity: 0;\n          position: absolute;\n          z-index: 1000001;\n          width: 0;\n          height: 0;\n          color: rgba(0, 0, 0, 0.8);\n          pointer-events: none;\n          content: "";\n          border: 5px solid transparent;\n          top: -5px;\n          right: 50%;\n          bottom: auto;\n          margin-right: -5px;\n          border-top-color: rgba(0, 0, 0, 0.8); }\n        .mde-header ul.mde-header-group li.mde-header-item button.tooltipped:hover::after {\n          animation-name: tooltip-appear;\n          animation-duration: 0.2s;\n          animation-delay: 0.5s;\n          animation-fill-mode: forwards;\n          font-size: 11px;\n          opacity: 0;\n          position: absolute;\n          z-index: 1000000;\n          padding: 5px 8px;\n          color: #fff;\n          pointer-events: none;\n          content: attr(aria-label);\n          background: rgba(0, 0, 0, 0.8);\n          border-radius: 3px;\n          right: 50%;\n          bottom: 100%;\n          transform: translateX(50%);\n          margin-bottom: 5px;\n          white-space: nowrap; }\n      .mde-header ul.mde-header-group li.mde-header-item ul.react-mde-dropdown {\n        position: absolute;\n        left: 0;\n        top: 30px;\n        background-color: white;\n        border: 1px solid #c8ccd0;\n        padding: 5px;\n        z-index: 2;\n        transform: translateX(-9px); }\n        .mde-header ul.mde-header-group li.mde-header-item ul.react-mde-dropdown li {\n          margin: 0;\n          white-space: nowrap;\n          list-style: none;\n          display: block; }\n          .mde-header ul.mde-header-group li.mde-header-item ul.react-mde-dropdown li button {\n            display: block;\n            height: auto; }\n            .mde-header ul.mde-header-group li.mde-header-item ul.react-mde-dropdown li button p {\n              display: block;\n              margin: 0;\n              padding: 0;\n              font-weight: bold;\n              line-height: 1em;\n              background: none;\n              border: 0;\n              text-align: left; }\n              .mde-header ul.mde-header-group li.mde-header-item ul.react-mde-dropdown li button p:hover {\n                color: #4078c0; }\n              .mde-header ul.mde-header-group li.mde-header-item ul.react-mde-dropdown li button p.header-1 {\n                font-size: 20px; }\n              .mde-header ul.mde-header-group li.mde-header-item ul.react-mde-dropdown li button p.header-2 {\n                font-size: 18px; }\n              .mde-header ul.mde-header-group li.mde-header-item ul.react-mde-dropdown li button p.header-3 {\n                font-size: 14px; }\n              .mde-header ul.mde-header-group li.mde-header-item ul.react-mde-dropdown li button p.header-4 {\n                font-size: 12px; }\n        .mde-header ul.mde-header-group li.mde-header-item ul.react-mde-dropdown::before {\n          position: absolute;\n          content: "";\n          width: 0;\n          height: 0;\n          border: 8px solid transparent;\n          border-bottom-color: rgba(0, 0, 0, 0.15);\n          top: -16px;\n          left: 3px;\n          transform: translateX(50%); }\n        .mde-header ul.mde-header-group li.mde-header-item ul.react-mde-dropdown::after {\n          position: absolute;\n          content: "";\n          width: 0;\n          height: 0;\n          border: 7px solid transparent;\n          border-bottom-color: white;\n          top: -14px;\n          left: 5px;\n          transform: translateX(50%); }\n\n.mde-text .public-DraftEditor-content {\n  width: 100%;\n  min-height: 200px;\n  padding: 10px; }\n\n.mde-preview {\n  min-height: 200px; }\n  .mde-preview .mde-preview-content {\n    padding: 10px; }\n    .mde-preview .mde-preview-content p, .mde-preview .mde-preview-content blockquote, .mde-preview .mde-preview-content ul, .mde-preview .mde-preview-content ol, .mde-preview .mde-preview-content dl, .mde-preview .mde-preview-content table, .mde-preview .mde-preview-content pre {\n      margin-top: 0;\n      margin-bottom: 16px; }\n    .mde-preview .mde-preview-content h1, .mde-preview .mde-preview-content h2, .mde-preview .mde-preview-content h3 {\n      margin-top: 24px;\n      margin-bottom: 16px;\n      font-weight: 600;\n      line-height: 1.25;\n      border-bottom: 1px solid #eee;\n      padding-bottom: 0.3em; }\n    .mde-preview .mde-preview-content h1 {\n      font-size: 1.6em; }\n    .mde-preview .mde-preview-content h2 {\n      font-size: 1.4em; }\n    .mde-preview .mde-preview-content h3 {\n      font-size: 1.2em; }\n    .mde-preview .mde-preview-content ul, .mde-preview .mde-preview-content ol {\n      padding-left: 2em; }\n    .mde-preview .mde-preview-content blockquote {\n      margin-left: 0;\n      padding: 0 1em;\n      color: #777;\n      border-left: 0.25em solid #ddd; }\n      .mde-preview .mde-preview-content blockquote > :first-child {\n        margin-top: 0; }\n      .mde-preview .mde-preview-content blockquote > :last-child {\n        margin-bottom: 0; }\n    .mde-preview .mde-preview-content code {\n      padding: 0.2em 0 0.2em 0;\n      margin: 0;\n      font-size: 90%;\n      background-color: rgba(0, 0, 0, 0.04);\n      border-radius: 3px; }\n      .mde-preview .mde-preview-content code::before, .mde-preview .mde-preview-content code::after {\n        letter-spacing: -0.2em;\n        content: "\\A0"; }\n    .mde-preview .mde-preview-content pre {\n      padding: 16px;\n      overflow: auto;\n      font-size: 85%;\n      line-height: 1.45;\n      background-color: #f7f7f7;\n      border-radius: 3px; }\n      .mde-preview .mde-preview-content pre code {\n        display: inline;\n        padding: 0;\n        margin: 0;\n        overflow: visible;\n        line-height: inherit;\n        word-wrap: normal;\n        background-color: transparent;\n        border: 0; }\n        .mde-preview .mde-preview-content pre code::before, .mde-preview .mde-preview-content pre code::after {\n          content: none; }\n      .mde-preview .mde-preview-content pre > code {\n        padding: 0;\n        margin: 0;\n        font-size: 100%;\n        word-break: normal;\n        white-space: pre;\n        background: transparent;\n        border: 0; }\n    .mde-preview .mde-preview-content a {\n      color: #4078c0;\n      text-decoration: none; }\n      .mde-preview .mde-preview-content a:hover {\n        text-decoration: underline; }\n    .mde-preview .mde-preview-content > *:first-child {\n      margin-top: 0 !important; }\n    .mde-preview .mde-preview-content > *:last-child {\n      margin-bottom: 0 !important; }\n    .mde-preview .mde-preview-content::after {\n      display: table;\n      clear: both;\n      content: ""; }\n    .mde-preview .mde-preview-content table {\n      display: block;\n      width: 100%;\n      border-spacing: 0;\n      border-collapse: collapse; }\n      .mde-preview .mde-preview-content table thead th {\n        font-weight: bold; }\n      .mde-preview .mde-preview-content table th, .mde-preview .mde-preview-content table td {\n        padding: 6px 13px;\n        border: 1px solid #c8ccd0; }\n\n* {\n  box-sizing: border-box; }\n\n.react-mde {\n  border: 1px solid #c8ccd0;\n  border-radius: 2px; }\n\n.react-mde-vertical-layout {\n  display: flex;\n  flex-direction: column; }\n  .react-mde-vertical-layout .mde-tabs {\n    display: flex;\n    align-items: stretch; }\n    .react-mde-vertical-layout .mde-tabs .mde-tab {\n      border: none;\n      border-left: 1px solid #c8ccd0;\n      padding: 10px;\n      background: none; }\n  .react-mde-vertical-layout .react-mde-content {\n    display: flex;\n    flex-direction: column; }\n    .react-mde-vertical-layout .react-mde-content .mde-text {\n      min-height: 200px;\n      height: auto;\n      overflow-y: auto; }\n    .react-mde-vertical-layout .react-mde-content .mde-preview {\n      min-height: 0;\n      height: auto;\n      overflow-y: auto;\n      border-top: 1px solid #c8ccd0; }\n\n.react-mde-no-preview-layout {\n  height: 100%;\n  display: flex;\n  flex-direction: column; }\n  .react-mde-no-preview-layout .mde-text {\n    overflow-y: auto; }\n\n.react-mde-horizontal-layout {\n  height: 100%;\n  display: flex;\n  flex-direction: column; }\n  .react-mde-horizontal-layout .mde-tabs {\n    display: flex;\n    align-items: stretch; }\n    .react-mde-horizontal-layout .mde-tabs .mde-tab {\n      border: none;\n      border-left: 1px solid #c8ccd0;\n      padding: 10px;\n      background: none; }\n    .react-mde-horizontal-layout .mde-tabs .mde-tab:hover {\n      cursor: pointer; }\n  .react-mde-horizontal-layout .mde-content {\n    display: flex;\n    height: 100%; }\n    .react-mde-horizontal-layout .mde-content .mde-text {\n      min-width: 50%;\n      overflow-y: auto;\n      border-radius: 0; }\n    .react-mde-horizontal-layout .mde-content .mde-preview {\n      min-width: 50%;\n      border-left: 1px solid #c8ccd0;\n      overflow-y: auto; }\n\n.react-mde-tabbed-layout {\n  height: 100%;\n  display: flex;\n  flex-direction: column; }\n  .react-mde-tabbed-layout .mde-tabs {\n    display: flex;\n    align-items: flex-end; }\n    .react-mde-tabbed-layout .mde-tabs .mde-tab {\n      position: relative;\n      top: 1px;\n      border: 1px solid #f9f9f9;\n      border-bottom: none;\n      border-top-left-radius: 2px;\n      border-top-right-radius: 2px;\n      margin-right: 10px;\n      padding: 10px;\n      background: none; }\n    .react-mde-tabbed-layout .mde-tabs .mde-tab:hover {\n      border-color: #c8ccd0;\n      cursor: pointer; }\n    .react-mde-tabbed-layout .mde-tabs .mde-tab-activated {\n      border-color: #c8ccd0;\n      background: white; }\n  .react-mde-tabbed-layout .mde-text {\n    overflow-y: auto; }\n  .react-mde-tabbed-layout .mde-preview {\n    overflow-y: auto; }\n',"",{version:3,sources:["D:/Git/react-mde/src/styles/src/styles/react-mde-toolbar.scss","D:/Git/react-mde/src/styles/src/styles/variables.scss","D:/Git/react-mde/src/styles/src/styles/react-mde-editor.scss","D:/Git/react-mde/src/styles/src/styles/react-mde-preview.scss","D:/Git/react-mde/src/styles/src/styles/react-mde.scss","D:/Git/react-mde/src/styles/src/styles/react-mde-vertical-layout.scss","D:/Git/react-mde/src/styles/src/styles/react-mde-no-preview-layout.scss","D:/Git/react-mde/src/styles/src/styles/react-mde-horizontal-layout.scss","D:/Git/react-mde/src/styles/src/styles/react-mde-tabbed-layout.scss"],names:[],mappings:"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",file:"react-mde-all.scss",sourcesContent:['@import "variables.scss";\n\n.mde-header {\n  flex-shrink: 0;\n  display: flex;\n  flex-wrap: wrap;\n  align-items: stretch;\n  border-bottom: 1px solid $mde-border-color;\n  border-radius: $mde-border-radius $mde-border-radius 0 0;\n  background: $mde-toolbar-color;\n\n  .mde-toolbar-children {\n    flex-grow: 1;\n    display: flex;\n    justify-content: flex-end;\n    align-items: stretch;\n  }\n\n  button:focus {\n    outline: 0;\n  }\n\n  ul.mde-header-group {\n    margin: 0;\n    padding: $mde-toolbar-padding;\n    list-style: none;\n    display: flex;\n    flex-wrap: nowrap;\n\n    li.mde-header-item {\n      display: inline-block;\n      position: relative;\n      margin: 0 4px;\n      button {\n        text-align: left;\n        cursor: pointer;\n        height: 22px;\n        padding: 4px;\n        margin: 0;\n        border: none;\n        background: none;\n        color: $mde-button-color;\n        @keyframes tooltip-appear {\n          from {\n            opacity: 0;\n          }\n          to {\n            opacity: 1;\n          }\n        }\n        @mixin tooltip-animation {\n          animation-name: tooltip-appear;\n          animation-duration: 0.2s;\n          animation-delay: 0.5s;\n          animation-fill-mode: forwards;\n        }\n        &.tooltipped {\n          &:hover::before {\n            @include tooltip-animation();\n            opacity: 0;\n            position: absolute;\n            z-index: 1000001;\n            width: 0;\n            height: 0;\n            color: rgba(0, 0, 0, 0.8);\n            pointer-events: none;\n            content: "";\n            border: 5px solid transparent;\n            top: -5px;\n            right: 50%;\n            bottom: auto;\n            margin-right: -5px;\n            border-top-color: rgba(0, 0, 0, 0.8);\n          }\n          &:hover::after {\n            @include tooltip-animation();\n            font-size: 11px;\n            opacity: 0;\n            position: absolute;\n            z-index: 1000000;\n            padding: 5px 8px;\n            color: #fff;\n            pointer-events: none;\n            content: attr(aria-label);\n            background: rgba(0, 0, 0, 0.8);\n            border-radius: 3px;\n            right: 50%;\n            bottom: 100%;\n            transform: translateX(50%);\n            margin-bottom: 5px;\n            white-space: nowrap;\n          }\n        }\n\n      }\n      ul.react-mde-dropdown {\n        position: absolute;\n        left: 0;\n        top: 30px;\n        background-color: white;\n        border: 1px solid $mde-border-color;\n        padding: 5px;\n        z-index: 2;\n        transform: translateX(-9px);\n        li {\n          margin: 0;\n          white-space: nowrap;\n          list-style: none;\n          display: block;\n          button {\n            display: block;\n            height: auto;\n            p {\n              display: block;\n              margin: 0;\n              padding: 0;\n              font-weight: bold;\n              line-height: 1em;\n              background: none;\n              border: 0;\n              text-align: left;\n              &:hover {\n                color: #4078c0;\n              }\n              &.header-1 {\n                font-size: 20px;\n              }\n              &.header-2 {\n                font-size: 18px;\n              }\n              &.header-3 {\n                font-size: 14px;\n              }\n              &.header-4 {\n                font-size: 12px;\n              }\n            }\n          }\n\n        }\n        &::before {\n          position: absolute;\n          content: "";\n          width: 0;\n          height: 0;\n          border: 8px solid transparent;\n          border-bottom-color: rgba(0, 0, 0, 0.15);\n          top: -16px;\n          left: 3px;\n          transform: translateX(50%);\n        }\n        &::after {\n          position: absolute;\n          content: "";\n          width: 0;\n          height: 0;\n          border: 7px solid transparent;\n          border-bottom-color: white;\n          top: -14px;\n          left: 5px;\n          transform: translateX(50%);\n        }\n      }\n    }\n  }\n}\n\n',"//General\n\n$mde-border-radius:                 2px !default;\n$mde-border-color:                  #c8ccd0 !default;\n$mde-button-color:                  #242729 !default;\n$mde-toolbar-color:                 #f9f9f9 !default;\n$mde-toolbar-padding:               10px !default;\n$mde-editor-default-min-height:     200px !default;\n$mde-editor-default-height:         auto !default;\n$mde-editor-padding:                10px !default;\n$mde-preview-horizontal-padding:    10px !default;\n$mde-preview-padding:               10px !default;\n$mde-preview-default-min-height:    $mde-editor-default-min-height !default;\n$mde-preview-default-height:        auto !default;\n\n\n// Layout specific variables\n\n$mde-editor-vertical-min-height:    $mde-editor-default-min-height !default;\n$mde-editor-vertical-height:        auto !default;\n$mde-preview-vertical-min-height:   0 !default;\n$mde-preview-vertical-height:       auto !default;",'@import "variables.scss";\n\n.mde-text {\n\n  .public-DraftEditor-content {\n    width: 100%;\n    min-height: $mde-editor-default-min-height;\n    padding: $mde-editor-padding;\n  }\n}\n','@import "variables.scss";\n\n.mde-preview {\n  min-height: $mde-preview-default-min-height;\n  .mde-preview-content {\n    padding: $mde-preview-padding;\n\n    p, blockquote, ul, ol, dl, table, pre {\n      margin-top: 0;\n      margin-bottom: 16px;\n    }\n\n    h1, h2, h3 {\n      margin-top: 24px;\n      margin-bottom: 16px;\n      font-weight: 600;\n      line-height: 1.25;\n      border-bottom: 1px solid #eee;\n      padding-bottom: 0.3em;\n    }\n    h1 {\n      font-size: 1.6em;\n    }\n    h2 {\n      font-size: 1.4em;\n    }\n    h3 {\n      font-size: 1.2em;\n    }\n    ul, ol {\n      padding-left: 2em;\n    }\n    blockquote {\n      margin-left: 0;\n      padding: 0 1em;\n      color: #777;\n      border-left: 0.25em solid #ddd;\n      & > :first-child {\n        margin-top: 0;\n      }\n      & > :last-child {\n        margin-bottom: 0;\n      }\n    }\n\n    code {\n      padding: 0.2em 0 0.2em 0;\n      margin: 0;\n      font-size: 90%;\n      background-color: rgba(0, 0, 0, 0.04);\n      border-radius: 3px;\n      &::before, &::after {\n        letter-spacing: -0.2em;\n        content: "\\00a0";\n      }\n    }\n\n    pre {\n      padding: 16px;\n      overflow: auto;\n      font-size: 85%;\n      line-height: 1.45;\n      background-color: #f7f7f7;\n      border-radius: 3px;\n\n      code {\n        display: inline;\n        padding: 0;\n        margin: 0;\n        overflow: visible;\n        line-height: inherit;\n        word-wrap: normal;\n        background-color: transparent;\n        border: 0;\n        &::before, &::after {\n          content: none;\n        }\n      }\n\n      > code {\n        padding: 0;\n        margin: 0;\n        font-size: 100%;\n        word-break: normal;\n        white-space: pre;\n        background: transparent;\n        border: 0;\n      }\n    }\n\n    a {\n      color: #4078c0;\n      text-decoration: none;\n      &:hover {\n        text-decoration: underline;\n      }\n    }\n    & > *:first-child {\n      margin-top: 0 !important;\n    }\n    & > *:last-child {\n      margin-bottom: 0 !important;\n    }\n    &::after {\n      display: table;\n      clear: both;\n      content: "";\n    }\n\n    table {\n      display: block;\n      width: 100%;\n      border-spacing: 0;\n      border-collapse: collapse;\n      thead {\n        th {\n          font-weight: bold;\n        }\n      }\n      th, td {\n        padding: 6px 13px;\n        border: 1px solid $mde-border-color;\n      }\n    }\n  }\n}\n\n','@import "variables.scss";\n\n* {\n    box-sizing: border-box;\n}\n\n.react-mde {\n    border: 1px solid $mde-border-color;\n    border-radius: $mde-border-radius;\n}\n','@import "variables.scss";\n\n.react-mde-vertical-layout {\n    display: flex;\n    flex-direction: column;\n\n    .mde-tabs {\n        display: flex;\n        align-items: stretch;\n\n        .mde-tab {\n            border: none;\n            border-left: 1px solid $mde-border-color;\n            padding: 10px;\n            background: none;\n        }\n    }\n\n    .react-mde-content {\n        display: flex;\n        flex-direction: column;\n\n        .mde-text {\n            min-height: $mde-editor-vertical-min-height;\n            height: $mde-editor-vertical-height;\n            overflow-y: auto;\n        }\n\n        .mde-preview {\n            min-height: $mde-preview-vertical-min-height;\n            height: $mde-preview-vertical-height;\n            overflow-y: auto;\n            border-top: 1px solid $mde-border-color;\n        }\n    }\n}\n','@import "variables.scss";\n\n.react-mde-no-preview-layout {\n  height: 100%;\n  display: flex;\n  flex-direction: column;\n\n  .mde-text {\n    overflow-y: auto;\n  }\n}\n','@import "variables.scss";\n\n.react-mde-horizontal-layout {\n    height: 100%;\n    display: flex;\n    flex-direction: column;\n\n    .mde-tabs {\n        display: flex;\n        align-items: stretch;\n\n        .mde-tab {\n            border: none;\n            border-left: 1px solid $mde-border-color;\n            padding: 10px;\n            background: none;\n        }\n\n        .mde-tab:hover {\n            cursor: pointer;\n        }\n    }\n\n    .mde-content {\n        display: flex;\n        height: 100%;\n\n        .mde-text {\n            min-width: 50%;\n            overflow-y: auto;\n            border-radius: 0;\n        }\n\n        .mde-preview {\n            min-width: 50%;\n            border-left: 1px solid $mde-border-color;\n            overflow-y: auto;\n        }\n    }\n}\n','@import "variables.scss";\n\n.react-mde-tabbed-layout {\n    height: 100%;\n    display: flex;\n    flex-direction: column;\n\n    .mde-tabs {\n        display: flex;\n        align-items: flex-end;\n\n        .mde-tab {\n            position: relative;\n            top: 1px;\n            border: 1px solid $mde-toolbar-color;\n            border-bottom: none;\n            border-top-left-radius: $mde-border-radius;\n            border-top-right-radius: $mde-border-radius;\n            margin-right: 10px;\n            padding: 10px;\n            background: none;\n        }\n\n        .mde-tab:hover {\n            border-color: $mde-border-color;\n            cursor: pointer;\n        }\n\n        .mde-tab-activated {\n            border-color: $mde-border-color;\n            background: white;\n        }\n    }\n\n    .mde-text {\n        overflow-y: auto;\n    }\n\n    .mde-preview {\n        overflow-y: auto;\n    }\n}\n'],sourceRoot:""}])},1176:function(e,t,n){var r=n(1175);"string"==typeof r&&(r=[[e.i,r,""]]);var o={hmr:!0,transform:void 0,insertInto:void 0};n(262)(r,o);r.locals&&(e.exports=r.locals)},1197:function(e,t,n){"use strict";n.r(t),function(e){var t=n(131);n(1179),n(1176),n(1174);Object(t.configure)(function(){n(1172),n(1064),n(1063),n(1062)},e)}.call(this,n(519)(e))},1199:function(e,t,n){n(403),n(1198),e.exports=n(1197)},198:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(260);t.ReactMdeCommands=r;var o=n(1071);t.ReactMdeTypes=o;var a=n(26);t.ReactMdeComponents=a;var i=n(486);t.ReactMdeLayoutComponents=i;var d=n(33);t.DraftUtil=d;var l=n(39);t.MarkdownUtil=l;var s=n(1066);t.default=s.ReactMde},244:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var o=n(0);t.MdeToolbarButton=function(e){var t=e.buttonContent,n=e.buttonProps,a=e.onClick,i=e.readOnly;return o.createElement("li",{className:"mde-header-item"},o.createElement("button",r({type:"button"},n,{onClick:a,disabled:i}),t))}},26:function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(488)),r(n(244)),r(n(487)),r(n(1086)),r(n(1085)),r(n(1084)),r(n(1083))},260:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1171);t.boldCommand=r.boldCommand;var o=n(1082);t.codeCommand=o.codeCommand;var a=n(1081);t.headerCommand=a.headerCommand;var i=n(1080);t.imageCommand=i.imageCommand;var d=n(1079);t.italicCommand=d.italicCommand;var l=n(1078);t.strikethroughCommand=l.strikethroughCommand;var s=n(1077);t.linkCommand=s.linkCommand;var c=n(1076);t.orderedListCommand=c.orderedListCommand;var u=n(1075);t.quoteCommand=u.quoteCommand;var m=n(1074);t.unorderedListCommand=m.unorderedListCommand;var p=n(1073);t.checkListCommand=p.checkListCommand;var A=n(1072);t.tabCommand=A.tabCommand;t.getDefaultCommands=function(){return[[a.headerCommand,r.boldCommand,d.italicCommand,l.strikethroughCommand],[s.linkCommand,u.quoteCommand,o.codeCommand,i.imageCommand],[m.unorderedListCommand,c.orderedListCommand,p.checkListCommand]]}},33:function(e,t,n){"use strict";var r=this&&this.__awaiter||function(e,t,n,r){return new(n||(n=Promise))(function(o,a){function i(e){try{l(r.next(e))}catch(e){a(e)}}function d(e){try{l(r.throw(e))}catch(e){a(e)}}function l(e){e.done?o(e.value):new n(function(t){t(e.value)}).then(i,d)}l((r=r.apply(e,t||[])).next())})},o=this&&this.__generator||function(e,t){var n,r,o,a,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return a={next:d(0),throw:d(1),return:d(2)},"function"==typeof Symbol&&(a[Symbol.iterator]=function(){return this}),a;function d(a){return function(d){return function(a){if(n)throw new TypeError("Generator is already executing.");for(;i;)try{if(n=1,r&&(o=2&a[0]?r.return:a[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,a[1])).done)return o;switch(r=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return i.label++,{value:a[1],done:!1};case 5:i.label++,r=a[1],a=[0];continue;case 7:a=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===a[0]||2===a[0])){i=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){i.label=a[1];break}if(6===a[0]&&i.label<o[1]){i.label=o[1],o=a;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(a);break}o[2]&&i.ops.pop(),i.trys.pop();continue}a=t.call(e,i)}catch(e){a=[6,e],r=0}finally{n=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,d])}}};Object.defineProperty(t,"__esModule",{value:!0});var a=n(259);function i(e,t){for(var n,r=0,o=t;n=e.getCurrentContent().getBlockBefore(o);)r+=n.getText().length+1,o=n.getKey();return r}function d(e){var t=e.getSelection(),n=t.getStartKey(),r=t.getStartOffset(),o=t.getEndKey(),a=t.getEndOffset(),d=i(e,n);return{start:r+d,end:r+l(e,n,r,o,a)+d}}function l(e,t,n,r,o){if(t===r)return o-n;for(var a,i=e.getCurrentContent().getBlockForKey(t).getText().length-n,d=t;(a=e.getCurrentContent().getBlockAfter(d))&&a.getKey()!==r;)i+=a.getText().length+1,d=a.getKey();return i+=o+1}function s(e){return e.getCurrentContent().getPlainText("\n")}t.getContentLengthOfAllBlocksBefore=i,t.getSelection=d,t.getContentLengthBetween=l,t.getPlainText=s;var c=function(e,t,n,r,o){return!t||e<n+r?null:e>n+t.getText().length?c(e,o.getBlockAfter(t.getKey()),n+t.getText().length+1,0,o):{block:t,globalOffset:n,blockOffset:e-n}};function u(e,t){var n=e.getFirstBlock();if(null===n)return null;var r=c(t.start,n,0,0,e);if(null===r)return null;var o=c(t.end,r.block,r.globalOffset,r.blockOffset,e);return null===o?null:a.SelectionState.createEmpty(r.block.getKey()).merge({anchorKey:r.block.getKey(),anchorOffset:r.blockOffset,focusKey:o.block.getKey(),focusOffset:o.blockOffset})}t.buildSelectionState=u,t.getMarkdownStateFromDraftState=function(e){return{text:s(e),selection:d(e)}},t.getMdeStateFromDraftState=function(e,t){return r(this,void 0,void 0,function(){var n,r;return o(this,function(o){switch(o.label){case 0:return n=s(e),t?[4,t(n)]:[3,2];case 1:return r=o.sent(),[3,3];case 2:r="",o.label=3;case 3:return[2,{html:r,markdown:n,draftEditorState:e}]}})})},t.buildNewDraftState=function(e,t){var n=t.text,r=t.selection,o=a.ContentState.createFromText(n),i=a.EditorState.forceSelection(e,e.getSelection());i=a.EditorState.push(i,o,"insert-characters");var d=r?u(i.getCurrentContent(),r):e.getSelection();return a.EditorState.forceSelection(i,d)}},39:function(e,t,n){"use strict";var r=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};function o(e,t){if(!e)throw Error("Argument 'text' should be truthy");for(var n=function(e){return" "===e||10===e.charCodeAt(0)},r=0,o=e.length,a=t;a-1>-1;a--)if(n(e[a-1])){r=a;break}for(a=t;a<e.length;a++)if(n(e[a])){o=a;break}return{word:e.slice(r,o),position:{start:r,end:o}}}function a(e){var t=e.text,n=e.selection;return t&&t.length&&n.start===n.end?o(t,n.start).position:n}function i(e){var t=e.text,n=e.selection,r=s(t,n.start),o=Array(r+1).join("\n"),a=t,i=n,d=0;if(o){var c=l(t,o,n.start);a=c.newText,d=c.insertionLength,i={start:n.start+c.insertionLength,end:n.end+c.insertionLength}}return{newText:a,insertionLength:d,newSelection:i}}function d(e,t,n,o){void 0===o&&(o=!0);var a=l(e,t,n.start),i={start:o?n.start:n.start+a.insertionLength,end:n.end+a.insertionLength};return r({},a,{newSelection:i})}function l(e,t,n){return{newText:[e.slice(0,n),t,e.slice(n)].join(""),insertionLength:t.length}}function s(e,t){if(void 0===e&&(e=""),0===t)return 0;for(var n=2,r=!0,o=t-1;o>=0&&n>=0;o--)switch(e.charCodeAt(o)){case 32:continue;case 10:n--,r=!1;break;default:return n}return r?0:n}function c(e,t){if(void 0===e&&(e=""),t===e.length-1)return 0;for(var n=2,r=!0,o=t;o<e.length&&n>=0;o++)switch(e.charCodeAt(o)){case 32:continue;case 10:n--,r=!1;break;default:return n}return r?0:n}function u(e){var t=e.text,n=e.selection,r=c(t,n.end),o=Array(r+1).join("\n"),a=t,i=0;if(o){var d=l(t,o,n.end);a=d.newText,i=d.insertionLength}return{newText:a,insertionLength:i,newSelection:n}}function m(e,t,n){var r=e.slice(n.start,n.end).split(/\n/),o=0,a=r.map(function(e,n){if("string"==typeof t)return o+=t.length,t+e;if("function"==typeof t){var r=t(e,n);return o+=r.length,t(e,n)+e}throw Error("insertion is expected to be either a string or a function")}).join("\n");return{newText:e.slice(0,n.start)+a+e.slice(n.end),insertionLength:o,newSelection:{start:r.length>1?n.start:n.start+o,end:n.end+o}}}Object.defineProperty(t,"__esModule",{value:!0}),t.getSurroundingWord=o,t.insertBeforeAndAfter=function(e,t){var n=e.text,r=e.selection,o=l(n,t,(r=a({text:n,selection:r})).start),i=o.newText,d=o.insertionLength;return{text:l(i,t,r.end+d).newText,selection:{start:r.start+d,end:r.end+d}}},t.selectWordIfCaretIsInsideOne=a,t.insertBreaksBeforeSoThatThereIsAnEmptyLineBefore=i,t.insertBefore=d,t.insertAfter=function(e,t,n){var o=l(e,t,n.end),a={start:n.start,end:n.end+o.insertionLength};return r({},o,{newSelection:a})},t.insertText=l,t.getBreaksNeededForEmptyLineBefore=s,t.getBreaksNeededForEmptyLineAfter=c,t.insertBreaksAfterSoThatThereIsAnEmptyLineAfter=u,t.insertBeforeEachLine=m,t.makeList=function(e,t){var n,r=e.text,o=e.selection;return{text:r=(n=m(r=(n=u({text:r=(n=i({text:r,selection:o=a({text:r,selection:o})})).newText,selection:o=n.newSelection})).newText,t,o=n.newSelection)).newText,selection:o=n.newSelection}},t.onTab=function(e,t){for(var n=e.text,r=e.selection,o=0,a=r.start;a-1>-1;a--)if("\n"===n[a-1]){o=a;break}var i=n.length;for(a=r.end;a<n.length;a++)if("\n"===n[a+1]){i=a;break}var d=n.slice(o,i).split(/\n/),l=0,s=0,c=d.map(function(e){var n=e.match(/^ +/);if(s=n&&n[0]?n[0].length:0,t){var r=4;return s&&s%4==0||(r=s%4),l-=r,e.slice(r)}var o="    ";return s%4==1&&(o="   "),s%4==2&&(o="  "),s%4==3&&(o=" "),l+=o.length,o+e}).join("\n");return{text:n=n.slice(0,o)+c+n.slice(i),selection:r=d.length<=1?{start:o+l+s,end:o+l+s}:{start:o,end:i+l}}},t.makeHeader=function(e,t){var n=e.text,r=e.selection,o=d(n,t,r=a({text:n,selection:r}),!1);return{text:o.newText,selection:o.newSelection}}},486:function(e,t,n){"use strict";function r(e){for(var n in e)t.hasOwnProperty(n)||(t[n]=e[n])}Object.defineProperty(t,"__esModule",{value:!0}),r(n(1070)),r(n(1069)),r(n(1068)),r(n(1067))},487:function(e,t,n){"use strict";var r,o=this&&this.__extends||(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])},function(e,t){function n(){this.constructor=e}r(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}),a=this&&this.__assign||Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++)for(var o in t=arguments[n])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e};Object.defineProperty(t,"__esModule",{value:!0});var i=n(0),d=n(244),l=function(e){function t(t){var n=e.call(this,t)||this;return n.handleGlobalClick=function(e){n.clickedOutside(e)&&n.closeDropdown()},n.openDropdown=function(){n.setState({open:!0})},n.clickedOutside=function(e){var t=e.target;return n.state.open&&n.dropdown&&n.dropdownOpener&&!n.dropdown.contains(t)&&!n.dropdownOpener.contains(t)},n.handleOnClickCommand=function(e,t){(0,n.props.onCommand)(t),n.closeDropdown()},n.handleClick=function(){n.state.open?n.closeDropdown():n.openDropdown()},n.state={open:!1},n}return o(t,e),t.prototype.componentDidMount=function(){document.addEventListener("click",this.handleGlobalClick,!1)},t.prototype.componentWillUnmount=function(){document.removeEventListener("click",this.handleGlobalClick,!1)},t.prototype.closeDropdown=function(){this.setState({open:!1})},t.prototype.render=function(){var e=this,t=this.props,n=t.commands,r=t.readOnly,o=this.state.open,l=n.map(function(t,n){return i.createElement(d.MdeToolbarButton,{key:"header-item"+n,buttonProps:t.buttonProps,buttonContent:t.buttonContent,onClick:function(n){return e.handleOnClickCommand(n,t)},readOnly:r})}),s=o?i.createElement("ul",{className:"react-mde-dropdown",ref:function(t){e.dropdown=t}},l):null,c=this.props,u=c.buttonContent,m=c.buttonProps;return i.createElement("li",{className:"mde-header-item"},i.createElement("button",a({type:"button"},m,{ref:function(t){e.dropdownOpener=t},onClick:this.handleClick,disabled:r}),u),s)},t}(i.Component);t.MdeToolbarDropdown=l},488:function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(0);t.MdeToolbarButtonGroup=function(e){return r.createElement("ul",{className:"mde-header-group"},e.children)}}},[[1199,1,2]]]);
  //# sourceMappingURL=preview.b615d74bbddaeb217415.bundle.js.map