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AQ/B,OANID,aAAuBlP,IACxBkP,EAAY3M,eAAeC,WAAmJrC,GAAU,IAKrK,IAAlBmT,EAASxH,KAzNW,SAA6B9O,EAAc2D,EAAgBH,EAAUg3D,EAAeroD,EAAWnG,GACvH,IAAIkG,EAAc1O,EAAShB,IAAI2P,GAC3BjO,EAAOgO,EAAY/N,UACnBC,EAAQ8N,EAAY7N,mBACpB61D,EAAW/nD,EACX8nD,EAAcjuD,EAAewuD,EAAcr2D,UAAU8D,OAErDwzC,EAAWvpC,EAAYzN,MAAM,CAC/BP,KAAMA,EAAKQ,MAAM,EAAGsH,GAAgBwuD,EAAcr2D,UAAYD,EAAKQ,MAAMsH,GACzErH,cAAe22C,EAAel3C,EAAOo2D,EAAcn2D,mBAAoB2H,GACvElJ,KAAM03D,EAAc93D,YAGtB,OAAO1C,EAAayE,MAAM,CACxBjB,SAAUA,EAASnG,IAAI8U,EAAWspC,GAClC70C,gBAAiBjD,EACjBkD,eAAgBlD,EAAec,MAAM,CACnCqC,UAAWozD,EACXnzD,aAAckzD,EACdjzD,SAAUkzD,EACVjzD,YAAagzD,EACb/yD,YAAY,KAGlB,CAkMWy0D,CAAoB37D,EAAc2D,EAAgBH,EAAU8S,EAAStG,QAASmC,EAAWnG,GAG3Fu7C,EAAevnD,EAAc2D,EAAgBH,EAAU8S,EAAUnE,EAAWnG,EACrF,C","sources":["webpack://garage-app/./node_modules/draft-js/lib/keyCommandUndo.js","webpack://garage-app/./node_modules/draft-js/lib/editOnKeyDown.js","webpack://garage-app/./node_modules/draft-js/lib/DraftEntityInstance.js","webpack://garage-app/./node_modules/draft-js/lib/DraftEditorContents.react.js","webpack://garage-app/./node_modules/draft-js/lib/splitBlockInContentState.js","webpack://garage-app/./node_modules/draft-js/lib/DraftEditorLeaf.react.js","webpack://garage-app/./node_modules/draft-js/lib/getSafeBodyFromHTML.js","webpack://garage-app/./node_modules/draft-js/lib/keyCommandTransposeCharacters.js","webpack://garage-app/./node_modules/draft-js/lib/DraftEditorBlock.react.js","webpack://garage-app/./node_modules/draft-js/lib/DraftEditorTextNode.react.js","webpack://garage-app/./node_modules/draft-js/lib/moveBlockInContentState.js","webpack://garage-app/./node_modules/draft-js/lib/convertFromDraftStateToRaw.js","webpack://garage-app/./node_modules/draft-js/lib/DraftModifier.js","webpack://garage-app/./node_modules/draft-js/lib/isSelectionAtLeafStart.js","webpack://garage-app/./node_modules/draft-js/lib/insertIntoList.js","webpack://garage-app/./node_modules/draft-js/lib/splitTextIntoTextBlocks.js","webpack://garage-app/./node_modules/draft-js/lib/DraftFeatureFlags.js","webpack://garage-app/./node_modules/draft-js/lib/setDraftEditorSelection.js","webpack://garage-app/./node_modules/draft-js/lib/moveSelectionForward.js","webpack://garage-app/./node_modules/draft-js/lib/getRangeClientRects.js","webpack://garage-app/./node_modules/draft-js/lib/ContentState.js","webpack://garage-app/./node_modules/draft-js/lib/SelectionState.js","webpack://garage-app/./node_modules/draft-js/lib/editOnCompositionStart.js","webpack://garage-app/./node_modules/draft-js/lib/decodeInlineStyleRanges.js","webpack://garage-app/./node_modules/draft-js/lib/findAncestorOffsetKey.js","webpack://garage-app/./node_modules/draft-js/lib/DraftPasteProcessor.js","webpack://garage-app/./node_modules/draft-js/lib/CharacterMetadata.js","webpack://garage-app/./node_modules/draft-js/lib/applyEntityToContentState.js","webpack://garage-app/./node_modules/draft-js/lib/editOnSelect.js","webpack://garage-app/./node_modules/draft-js/lib/DraftEditor.react.js","webpack://garage-app/./node_modules/draft-js/lib/DraftJsDebugLogging.js","webpack://garage-app/./node_modules/draft-js/lib/keyCommandMoveSelectionToStartOfBlock.js","webpack://garage-app/./node_modules/draft-js/lib/KeyBindingUtil.js","webpack://garage-app/./node_modules/draft-js/lib/Draft.js","webpack://garage-app/./node_modules/draft-js/lib/editOnFocus.js","webpack://garage-app/./node_modules/draft-js/lib/DraftEditorEditHandler.js","webpack://garage-app/./node_modules/draft-js/lib/getTextContentFromFiles.js","webpack://garage-app/./node_modules/draft-js/lib/removeRangeFromContentState.js","webpack://garage-app/./node_modules/draft-js/lib/ContentBlock.js","webpack://garage-app/./node_modules/draft-js/lib/editOnCopy.js","webpack://garage-app/./node_modules/draft-js/lib/DraftEntity.js","webpack://garage-app/./node_modules/draft-js/lib/keyCommandMoveSelectionToEndOfBlock.js","webpack://garage-app/./node_modules/draft-js/lib/getDraftEditorSelectionWithNodes.js","webpack://garage-app/./node_modules/draft-js/lib/getFragmentFromSelection.js","webpack://garage-app/./node_modules/draft-js/lib/DraftStringKey.js","webpack://garage-app/./node_modules/draft-js/lib/keyCommandBackspaceToStartOfLine.js","webpack://garage-app/./node_modules/draft-js/lib/getCharacterRemovalRange.js","webpack://garage-app/./node_modules/draft-js/lib/convertFromRawToDraftState.js","webpack://garage-app/./node_modules/draft-js/lib/moveSelectionBackward.js","webpack://garage-app/./node_modules/draft-js/lib/keyCommandPlainDelete.js","webpack://garage-app/./node_modules/draft-js/node_modules/immutable/dist/immutable.js","webpack://garage-app/./node_modules/draft-js/lib/EditorBidiService.js","webpack://garage-app/./node_modules/draft-js/lib/insertTextIntoContentState.js","webpack://garage-app/./node_modules/draft-js/lib/generateRandomKey.js","webpack://garage-app/./node_modules/draft-js/lib/getVisibleSelectionRect.js","webpack://garage-app/./node_modules/draft-js/lib/EditorState.js","webpack://garage-app/./node_modules/draft-js/lib/sanitizeDraftText.js","webpack://garage-app/./node_modules/draft-js/lib/applyEntityToContentBlock.js","webpack://garage-app/./node_modules/draft-js/lib/BlockMapBuilder.js","webpack://garage-app/./node_modules/draft-js/lib/encodeInlineStyleRanges.js","webpack://garage-app/./node_modules/draft-js/lib/randomizeBlockMapKeys.js","webpack://garage-app/./node_modules/draft-js/lib/CompositeDraftDecorator.js","webpack://garage-app/./node_modules/draft-js/lib/DraftRemovableWord.js","webpack://garage-app/./node_modules/draft-js/lib/getDefaultKeyBinding.js","webpack://garage-app/./node_modules/draft-js/lib/editOnDragOver.js","webpack://garage-app/./node_modules/draft-js/lib/AtomicBlockUtils.js","webpack://garage-app/./node_modules/draft-js/lib/findRangesImmutable.js","webpack://garage-app/./node_modules/draft-js/lib/BlockTree.js","webpack://garage-app/./node_modules/draft-js/lib/getRangeBoundingClientRect.js","webpack://garage-app/./node_modules/draft-js/lib/removeEntitiesAtEdges.js","webpack://garage-app/./node_modules/draft-js/lib/DraftEditorDragHandler.js","webpack://garage-app/./node_modules/draft-js/lib/createCharacterList.js","webpack://garage-app/./node_modules/draft-js/lib/DraftEditorPlaceholder.react.js","webpack://garage-app/./node_modules/draft-js/lib/adjustBlockDepthForContentState.js","webpack://garage-app/./node_modules/draft-js/lib/editOnPaste.js","webpack://garage-app/./node_modules/draft-js/lib/decodeEntityRanges.js","webpack://garage-app/./node_modules/draft-js/lib/DraftEditorContents-core.react.js","webpack://garage-app/./node_modules/draft-js/lib/convertFromHTMLToContentBlocks.js","webpack://garage-app/./node_modules/draft-js/lib/keyCommandDeleteWord.js","webpack://garage-app/./node_modules/draft-js/lib/getRangesForDraftEntity.js","webpack://garage-app/./node_modules/draft-js/lib/isEventHandled.js","webpack://garage-app/./node_modules/draft-js/lib/DraftFeatureFlags-core.js","webpack://garage-app/./node_modules/draft-js/lib/removeTextWithStrategy.js","webpack://garage-app/./node_modules/draft-js/lib/DefaultDraftInlineStyle.js","webpack://garage-app/./node_modules/draft-js/lib/editOnBeforeInput.js","webpack://garage-app/./node_modules/draft-js/lib/ContentStateInlineStyle.js","webpack://garage-app/./node_modules/draft-js/lib/editOnInput.js","webpack://garage-app/./node_modules/draft-js/lib/keyCommandBackspaceWord.js","webpack://garage-app/./node_modules/draft-js/lib/modifyBlockForContentState.js","webpack://garage-app/./node_modules/draft-js/lib/DraftTreeAdapter.js","webpack://garage-app/./node_modules/draft-js/lib/keyCommandPlainBackspace.js","webpack://garage-app/./node_modules/draft-js/lib/getUpdatedSelectionState.js","webpack://garage-app/./node_modules/draft-js/lib/RichTextEditorUtil.js","webpack://garage-app/./node_modules/draft-js/lib/getSelectionOffsetKeyForNode.js","webpack://garage-app/./node_modules/draft-js/lib/SecondaryClipboard.js","webpack://garage-app/./node_modules/draft-js/lib/keyCommandInsertNewline.js","webpack://garage-app/./node_modules/draft-js/lib/editOnCut.js","webpack://garage-app/./node_modules/draft-js/lib/DraftOffsetKey.js","webpack://garage-app/./node_modules/draft-js/lib/editOnBlur.js","webpack://garage-app/./node_modules/draft-js/lib/getEntityKeyForSelection.js","webpack://garage-app/./node_modules/draft-js/lib/getNextDelimiterBlockKey.js","webpack://garage-app/./node_modules/draft-js/lib/DraftEntitySegments.js","webpack://garage-app/./node_modules/draft-js/lib/expandRangeToStartOfLine.js","webpack://garage-app/./node_modules/draft-js/lib/getDraftEditorSelection.js","webpack://garage-app/./node_modules/draft-js/lib/encodeEntityRanges.js","webpack://garage-app/./node_modules/draft-js/lib/editOnDragStart.js","webpack://garage-app/./node_modules/draft-js/lib/DraftEditorCompositionHandler.js","webpack://garage-app/./node_modules/draft-js/lib/getContentStateFragment.js","webpack://garage-app/./node_modules/draft-js/lib/DefaultDraftBlockRenderMap.js","webpack://garage-app/./node_modules/draft-js/lib/ContentBlockNode.js","webpack://garage-app/./node_modules/draft-js/lib/insertFragmentIntoContentState.js"],"sourcesContent":["/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule keyCommandUndo\n * @format\n * \n */\n\n'use strict';\n\nvar EditorState = require('./EditorState');\n\nfunction keyCommandUndo(e, editorState, updateFn) {\n  var undoneState = EditorState.undo(editorState);\n\n  // If the last change to occur was a spellcheck change, allow the undo\n  // event to fall through to the browser. This allows the browser to record\n  // the unwanted change, which should soon lead it to learn not to suggest\n  // the correction again.\n  if (editorState.getLastChangeType() === 'spellcheck-change') {\n    var nativelyRenderedContent = undoneState.getCurrentContent();\n    updateFn(EditorState.set(undoneState, { nativelyRenderedContent: nativelyRenderedContent }));\n    return;\n  }\n\n  // Otheriwse, manage the undo behavior manually.\n  e.preventDefault();\n  if (!editorState.getNativelyRenderedContent()) {\n    updateFn(undoneState);\n    return;\n  }\n\n  // Trigger a re-render with the current content state to ensure that the\n  // component tree has up-to-date props for comparison.\n  updateFn(EditorState.set(editorState, { nativelyRenderedContent: null }));\n\n  // Wait to ensure that the re-render has occurred before performing\n  // the undo action.\n  setTimeout(function () {\n    updateFn(undoneState);\n  }, 0);\n}\n\nmodule.exports = keyCommandUndo;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule editOnKeyDown\n * @format\n * \n */\n\n'use strict';\n\nvar DraftModifier = require('./DraftModifier');\nvar EditorState = require('./EditorState');\nvar KeyBindingUtil = require('./KeyBindingUtil');\nvar Keys = require('fbjs/lib/Keys');\nvar SecondaryClipboard = require('./SecondaryClipboard');\nvar UserAgent = require('fbjs/lib/UserAgent');\n\nvar isEventHandled = require('./isEventHandled');\nvar keyCommandBackspaceToStartOfLine = require('./keyCommandBackspaceToStartOfLine');\nvar keyCommandBackspaceWord = require('./keyCommandBackspaceWord');\nvar keyCommandDeleteWord = require('./keyCommandDeleteWord');\nvar keyCommandInsertNewline = require('./keyCommandInsertNewline');\nvar keyCommandMoveSelectionToEndOfBlock = require('./keyCommandMoveSelectionToEndOfBlock');\nvar keyCommandMoveSelectionToStartOfBlock = require('./keyCommandMoveSelectionToStartOfBlock');\nvar keyCommandPlainBackspace = require('./keyCommandPlainBackspace');\nvar keyCommandPlainDelete = require('./keyCommandPlainDelete');\nvar keyCommandTransposeCharacters = require('./keyCommandTransposeCharacters');\nvar keyCommandUndo = require('./keyCommandUndo');\n\nvar isOptionKeyCommand = KeyBindingUtil.isOptionKeyCommand;\n\nvar isChrome = UserAgent.isBrowser('Chrome');\n\n/**\n * Map a `DraftEditorCommand` command value to a corresponding function.\n */\nfunction onKeyCommand(command, editorState) {\n  switch (command) {\n    case 'redo':\n      return EditorState.redo(editorState);\n    case 'delete':\n      return keyCommandPlainDelete(editorState);\n    case 'delete-word':\n      return keyCommandDeleteWord(editorState);\n    case 'backspace':\n      return keyCommandPlainBackspace(editorState);\n    case 'backspace-word':\n      return keyCommandBackspaceWord(editorState);\n    case 'backspace-to-start-of-line':\n      return keyCommandBackspaceToStartOfLine(editorState);\n    case 'split-block':\n      return keyCommandInsertNewline(editorState);\n    case 'transpose-characters':\n      return keyCommandTransposeCharacters(editorState);\n    case 'move-selection-to-start-of-block':\n      return keyCommandMoveSelectionToStartOfBlock(editorState);\n    case 'move-selection-to-end-of-block':\n      return keyCommandMoveSelectionToEndOfBlock(editorState);\n    case 'secondary-cut':\n      return SecondaryClipboard.cut(editorState);\n    case 'secondary-paste':\n      return SecondaryClipboard.paste(editorState);\n    default:\n      return editorState;\n  }\n}\n\n/**\n * Intercept keydown behavior to handle keys and commands manually, if desired.\n *\n * Keydown combinations may be mapped to `DraftCommand` values, which may\n * correspond to command functions that modify the editor or its contents.\n *\n * See `getDefaultKeyBinding` for defaults. Alternatively, the top-level\n * component may provide a custom mapping via the `keyBindingFn` prop.\n */\nfunction editOnKeyDown(editor, e) {\n  var keyCode = e.which;\n  var editorState = editor._latestEditorState;\n\n  switch (keyCode) {\n    case Keys.RETURN:\n      e.preventDefault();\n      // The top-level component may manually handle newline insertion. If\n      // no special handling is performed, fall through to command handling.\n      if (editor.props.handleReturn && isEventHandled(editor.props.handleReturn(e, editorState))) {\n        return;\n      }\n      break;\n    case Keys.ESC:\n      e.preventDefault();\n      editor.props.onEscape && editor.props.onEscape(e);\n      return;\n    case Keys.TAB:\n      editor.props.onTab && editor.props.onTab(e);\n      return;\n    case Keys.UP:\n      editor.props.onUpArrow && editor.props.onUpArrow(e);\n      return;\n    case Keys.RIGHT:\n      editor.props.onRightArrow && editor.props.onRightArrow(e);\n      return;\n    case Keys.DOWN:\n      editor.props.onDownArrow && editor.props.onDownArrow(e);\n      return;\n    case Keys.LEFT:\n      editor.props.onLeftArrow && editor.props.onLeftArrow(e);\n      return;\n    case Keys.SPACE:\n      // Handling for OSX where option + space scrolls.\n      if (isChrome && isOptionKeyCommand(e)) {\n        e.preventDefault();\n        // Insert a nbsp into the editor.\n        var contentState = DraftModifier.replaceText(editorState.getCurrentContent(), editorState.getSelection(), '\\xA0');\n        editor.update(EditorState.push(editorState, contentState, 'insert-characters'));\n        return;\n      }\n  }\n\n  var command = editor.props.keyBindingFn(e);\n\n  // If no command is specified, allow keydown event to continue.\n  if (!command) {\n    return;\n  }\n\n  if (command === 'undo') {\n    // Since undo requires some special updating behavior to keep the editor\n    // in sync, handle it separately.\n    keyCommandUndo(e, editorState, editor.update);\n    return;\n  }\n\n  // At this point, we know that we're handling a command of some kind, so\n  // we don't want to insert a character following the keydown.\n  e.preventDefault();\n\n  // Allow components higher up the tree to handle the command first.\n  if (editor.props.handleKeyCommand && isEventHandled(editor.props.handleKeyCommand(command, editorState))) {\n    return;\n  }\n\n  var newState = onKeyCommand(command, editorState);\n  if (newState !== editorState) {\n    editor.update(newState);\n  }\n}\n\nmodule.exports = editOnKeyDown;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DraftEntityInstance\n * @legacyServerCallableInstance\n * @format\n * \n */\n\n'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Immutable = require('immutable');\n\nvar Record = Immutable.Record;\n\n\nvar DraftEntityInstanceRecord = Record({\n  type: 'TOKEN',\n  mutability: 'IMMUTABLE',\n  data: Object\n});\n\n/**\n * An instance of a document entity, consisting of a `type` and relevant\n * `data`, metadata about the entity.\n *\n * For instance, a \"link\" entity might provide a URI, and a \"mention\"\n * entity might provide the mentioned user's ID. These pieces of data\n * may be used when rendering the entity as part of a ContentBlock DOM\n * representation. For a link, the data would be used as an href for\n * the rendered anchor. For a mention, the ID could be used to retrieve\n * a hovercard.\n */\n\nvar DraftEntityInstance = function (_DraftEntityInstanceR) {\n  _inherits(DraftEntityInstance, _DraftEntityInstanceR);\n\n  function DraftEntityInstance() {\n    _classCallCheck(this, DraftEntityInstance);\n\n    return _possibleConstructorReturn(this, _DraftEntityInstanceR.apply(this, arguments));\n  }\n\n  DraftEntityInstance.prototype.getType = function getType() {\n    return this.get('type');\n  };\n\n  DraftEntityInstance.prototype.getMutability = function getMutability() {\n    return this.get('mutability');\n  };\n\n  DraftEntityInstance.prototype.getData = function getData() {\n    return this.get('data');\n  };\n\n  return DraftEntityInstance;\n}(DraftEntityInstanceRecord);\n\nmodule.exports = DraftEntityInstance;","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DraftEditorContents.react\n * @format\n * \n */\n\n'use strict';\n\nvar DraftEditorContents = require('./DraftEditorContents-core.react');\n\nmodule.exports = DraftEditorContents;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule splitBlockInContentState\n * @format\n * \n */\n\n'use strict';\n\nvar ContentBlockNode = require('./ContentBlockNode');\nvar Immutable = require('immutable');\n\nvar generateRandomKey = require('./generateRandomKey');\nvar invariant = require('fbjs/lib/invariant');\n\nvar List = Immutable.List,\n    Map = Immutable.Map;\n\n\nvar transformBlock = function transformBlock(key, blockMap, func) {\n  if (!key) {\n    return;\n  }\n\n  var block = blockMap.get(key);\n\n  if (!block) {\n    return;\n  }\n\n  blockMap.set(key, func(block));\n};\n\nvar updateBlockMapLinks = function updateBlockMapLinks(blockMap, originalBlock, belowBlock) {\n  return blockMap.withMutations(function (blocks) {\n    var originalBlockKey = originalBlock.getKey();\n    var belowBlockKey = belowBlock.getKey();\n\n    // update block parent\n    transformBlock(originalBlock.getParentKey(), blocks, function (block) {\n      var parentChildrenList = block.getChildKeys();\n      var insertionIndex = parentChildrenList.indexOf(originalBlockKey) + 1;\n      var newChildrenArray = parentChildrenList.toArray();\n\n      newChildrenArray.splice(insertionIndex, 0, belowBlockKey);\n\n      return block.merge({\n        children: List(newChildrenArray)\n      });\n    });\n\n    // update original next block\n    transformBlock(originalBlock.getNextSiblingKey(), blocks, function (block) {\n      return block.merge({\n        prevSibling: belowBlockKey\n      });\n    });\n\n    // update original block\n    transformBlock(originalBlockKey, blocks, function (block) {\n      return block.merge({\n        nextSibling: belowBlockKey\n      });\n    });\n\n    // update below block\n    transformBlock(belowBlockKey, blocks, function (block) {\n      return block.merge({\n        prevSibling: originalBlockKey\n      });\n    });\n  });\n};\n\nvar splitBlockInContentState = function splitBlockInContentState(contentState, selectionState) {\n  !selectionState.isCollapsed() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Selection range must be collapsed.') : invariant(false) : void 0;\n\n  var key = selectionState.getAnchorKey();\n  var offset = selectionState.getAnchorOffset();\n  var blockMap = contentState.getBlockMap();\n  var blockToSplit = blockMap.get(key);\n  var text = blockToSplit.getText();\n  var chars = blockToSplit.getCharacterList();\n  var keyBelow = generateRandomKey();\n  var isExperimentalTreeBlock = blockToSplit instanceof ContentBlockNode;\n\n  var blockAbove = blockToSplit.merge({\n    text: text.slice(0, offset),\n    characterList: chars.slice(0, offset)\n  });\n  var blockBelow = blockAbove.merge({\n    key: keyBelow,\n    text: text.slice(offset),\n    characterList: chars.slice(offset),\n    data: Map()\n  });\n\n  var blocksBefore = blockMap.toSeq().takeUntil(function (v) {\n    return v === blockToSplit;\n  });\n  var blocksAfter = blockMap.toSeq().skipUntil(function (v) {\n    return v === blockToSplit;\n  }).rest();\n  var newBlocks = blocksBefore.concat([[key, blockAbove], [keyBelow, blockBelow]], blocksAfter).toOrderedMap();\n\n  if (isExperimentalTreeBlock) {\n    !blockToSplit.getChildKeys().isEmpty() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'ContentBlockNode must not have children') : invariant(false) : void 0;\n\n    newBlocks = updateBlockMapLinks(newBlocks, blockAbove, blockBelow);\n  }\n\n  return contentState.merge({\n    blockMap: newBlocks,\n    selectionBefore: selectionState,\n    selectionAfter: selectionState.merge({\n      anchorKey: keyBelow,\n      anchorOffset: 0,\n      focusKey: keyBelow,\n      focusOffset: 0,\n      isBackward: false\n    })\n  });\n};\n\nmodule.exports = splitBlockInContentState;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DraftEditorLeaf.react\n * @format\n * \n */\n\n'use strict';\n\nvar _assign = require('object-assign');\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar DraftEditorTextNode = require('./DraftEditorTextNode.react');\nvar React = require('react');\nvar ReactDOM = require('react-dom');\n\nvar invariant = require('fbjs/lib/invariant');\nvar setDraftEditorSelection = require('./setDraftEditorSelection');\n\n/**\n * All leaf nodes in the editor are spans with single text nodes. Leaf\n * elements are styled based on the merging of an optional custom style map\n * and a default style map.\n *\n * `DraftEditorLeaf` also provides a wrapper for calling into the imperative\n * DOM Selection API. In this way, top-level components can declaratively\n * maintain the selection state.\n */\nvar DraftEditorLeaf = function (_React$Component) {\n  _inherits(DraftEditorLeaf, _React$Component);\n\n  function DraftEditorLeaf() {\n    _classCallCheck(this, DraftEditorLeaf);\n\n    return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n  }\n\n  DraftEditorLeaf.prototype._setSelection = function _setSelection() {\n    var selection = this.props.selection;\n\n    // If selection state is irrelevant to the parent block, no-op.\n\n    if (selection == null || !selection.getHasFocus()) {\n      return;\n    }\n\n    var _props = this.props,\n        block = _props.block,\n        start = _props.start,\n        text = _props.text;\n\n    var blockKey = block.getKey();\n    var end = start + text.length;\n    if (!selection.hasEdgeWithin(blockKey, start, end)) {\n      return;\n    }\n\n    // Determine the appropriate target node for selection. If the child\n    // is not a text node, it is a <br /> spacer. In this case, use the\n    // <span> itself as the selection target.\n    var node = ReactDOM.findDOMNode(this);\n    !node ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing node') : invariant(false) : void 0;\n    var child = node.firstChild;\n    !child ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing child') : invariant(false) : void 0;\n    var targetNode = void 0;\n\n    if (child.nodeType === Node.TEXT_NODE) {\n      targetNode = child;\n    } else if (child.tagName === 'BR') {\n      targetNode = node;\n    } else {\n      targetNode = child.firstChild;\n      !targetNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing targetNode') : invariant(false) : void 0;\n    }\n\n    setDraftEditorSelection(selection, targetNode, blockKey, start, end);\n  };\n  /**\n   * By making individual leaf instances aware of their context within\n   * the text of the editor, we can set our selection range more\n   * easily than we could in the non-React world.\n   *\n   * Note that this depends on our maintaining tight control over the\n   * DOM structure of the DraftEditor component. If leaves had multiple\n   * text nodes, this would be harder.\n   */\n\n  DraftEditorLeaf.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {\n    var leafNode = ReactDOM.findDOMNode(this.leaf);\n    !leafNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing leafNode') : invariant(false) : void 0;\n    return leafNode.textContent !== nextProps.text || nextProps.styleSet !== this.props.styleSet || nextProps.forceSelection;\n  };\n\n  DraftEditorLeaf.prototype.componentDidUpdate = function componentDidUpdate() {\n    this._setSelection();\n  };\n\n  DraftEditorLeaf.prototype.componentDidMount = function componentDidMount() {\n    this._setSelection();\n  };\n\n  DraftEditorLeaf.prototype.render = function render() {\n    var _this2 = this;\n\n    var block = this.props.block;\n    var text = this.props.text;\n\n    // If the leaf is at the end of its block and ends in a soft newline, append\n    // an extra line feed character. Browsers collapse trailing newline\n    // characters, which leaves the cursor in the wrong place after a\n    // shift+enter. The extra character repairs this.\n\n    if (text.endsWith('\\n') && this.props.isLast) {\n      text += '\\n';\n    }\n\n    var _props2 = this.props,\n        customStyleMap = _props2.customStyleMap,\n        customStyleFn = _props2.customStyleFn,\n        offsetKey = _props2.offsetKey,\n        styleSet = _props2.styleSet;\n\n    var styleObj = styleSet.reduce(function (map, styleName) {\n      var mergedStyles = {};\n      var style = customStyleMap[styleName];\n\n      if (style !== undefined && map.textDecoration !== style.textDecoration) {\n        // .trim() is necessary for IE9/10/11 and Edge\n        mergedStyles.textDecoration = [map.textDecoration, style.textDecoration].join(' ').trim();\n      }\n\n      return _assign(map, style, mergedStyles);\n    }, {});\n\n    if (customStyleFn) {\n      var newStyles = customStyleFn(styleSet, block);\n      styleObj = _assign(styleObj, newStyles);\n    }\n\n    return React.createElement(\n      'span',\n      {\n        'data-offset-key': offsetKey,\n        ref: function ref(_ref) {\n          return _this2.leaf = _ref;\n        },\n        style: styleObj },\n      React.createElement(\n        DraftEditorTextNode,\n        null,\n        text\n      )\n    );\n  };\n\n  return DraftEditorLeaf;\n}(React.Component);\n\nmodule.exports = DraftEditorLeaf;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getSafeBodyFromHTML\n * @format\n * \n */\n\n'use strict';\n\nvar UserAgent = require('fbjs/lib/UserAgent');\n\nvar invariant = require('fbjs/lib/invariant');\n\nvar isOldIE = UserAgent.isBrowser('IE <= 9');\n\n// Provides a dom node that will not execute scripts\n// https://developer.mozilla.org/en-US/docs/Web/API/DOMImplementation.createHTMLDocument\n// https://developer.mozilla.org/en-US/Add-ons/Code_snippets/HTML_to_DOM\n\nfunction getSafeBodyFromHTML(html) {\n  var doc;\n  var root = null;\n  // Provides a safe context\n  if (!isOldIE && document.implementation && document.implementation.createHTMLDocument) {\n    doc = document.implementation.createHTMLDocument('foo');\n    !doc.documentElement ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing doc.documentElement') : invariant(false) : void 0;\n    doc.documentElement.innerHTML = html;\n    root = doc.getElementsByTagName('body')[0];\n  }\n  return root;\n}\n\nmodule.exports = getSafeBodyFromHTML;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule keyCommandTransposeCharacters\n * @format\n * \n */\n\n'use strict';\n\nvar DraftModifier = require('./DraftModifier');\nvar EditorState = require('./EditorState');\n\nvar getContentStateFragment = require('./getContentStateFragment');\n\n/**\n * Transpose the characters on either side of a collapsed cursor, or\n * if the cursor is at the end of the block, transpose the last two\n * characters.\n */\nfunction keyCommandTransposeCharacters(editorState) {\n  var selection = editorState.getSelection();\n  if (!selection.isCollapsed()) {\n    return editorState;\n  }\n\n  var offset = selection.getAnchorOffset();\n  if (offset === 0) {\n    return editorState;\n  }\n\n  var blockKey = selection.getAnchorKey();\n  var content = editorState.getCurrentContent();\n  var block = content.getBlockForKey(blockKey);\n  var length = block.getLength();\n\n  // Nothing to transpose if there aren't two characters.\n  if (length <= 1) {\n    return editorState;\n  }\n\n  var removalRange;\n  var finalSelection;\n\n  if (offset === length) {\n    // The cursor is at the end of the block. Swap the last two characters.\n    removalRange = selection.set('anchorOffset', offset - 1);\n    finalSelection = selection;\n  } else {\n    removalRange = selection.set('focusOffset', offset + 1);\n    finalSelection = removalRange.set('anchorOffset', offset + 1);\n  }\n\n  // Extract the character to move as a fragment. This preserves its\n  // styling and entity, if any.\n  var movedFragment = getContentStateFragment(content, removalRange);\n  var afterRemoval = DraftModifier.removeRange(content, removalRange, 'backward');\n\n  // After the removal, the insertion target is one character back.\n  var selectionAfter = afterRemoval.getSelectionAfter();\n  var targetOffset = selectionAfter.getAnchorOffset() - 1;\n  var targetRange = selectionAfter.merge({\n    anchorOffset: targetOffset,\n    focusOffset: targetOffset\n  });\n\n  var afterInsert = DraftModifier.replaceWithFragment(afterRemoval, targetRange, movedFragment);\n\n  var newEditorState = EditorState.push(editorState, afterInsert, 'insert-fragment');\n\n  return EditorState.acceptSelection(newEditorState, finalSelection);\n}\n\nmodule.exports = keyCommandTransposeCharacters;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DraftEditorBlock.react\n * @format\n * \n */\n\n'use strict';\n\nvar _assign = require('object-assign');\n\nvar _extends = _assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar DraftEditorLeaf = require('./DraftEditorLeaf.react');\nvar DraftOffsetKey = require('./DraftOffsetKey');\nvar React = require('react');\nvar ReactDOM = require('react-dom');\nvar Scroll = require('fbjs/lib/Scroll');\nvar Style = require('fbjs/lib/Style');\nvar UnicodeBidi = require('fbjs/lib/UnicodeBidi');\nvar UnicodeBidiDirection = require('fbjs/lib/UnicodeBidiDirection');\n\nvar cx = require('fbjs/lib/cx');\nvar getElementPosition = require('fbjs/lib/getElementPosition');\nvar getScrollPosition = require('fbjs/lib/getScrollPosition');\nvar getViewportDimensions = require('fbjs/lib/getViewportDimensions');\nvar invariant = require('fbjs/lib/invariant');\nvar nullthrows = require('fbjs/lib/nullthrows');\n\nvar SCROLL_BUFFER = 10;\n\n/**\n * Return whether a block overlaps with either edge of the `SelectionState`.\n */\nvar isBlockOnSelectionEdge = function isBlockOnSelectionEdge(selection, key) {\n  return selection.getAnchorKey() === key || selection.getFocusKey() === key;\n};\n\n/**\n * The default block renderer for a `DraftEditor` component.\n *\n * A `DraftEditorBlock` is able to render a given `ContentBlock` to its\n * appropriate decorator and inline style components.\n */\n\nvar DraftEditorBlock = function (_React$Component) {\n  _inherits(DraftEditorBlock, _React$Component);\n\n  function DraftEditorBlock() {\n    _classCallCheck(this, DraftEditorBlock);\n\n    return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n  }\n\n  DraftEditorBlock.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {\n    return this.props.block !== nextProps.block || this.props.tree !== nextProps.tree || this.props.direction !== nextProps.direction || isBlockOnSelectionEdge(nextProps.selection, nextProps.block.getKey()) && nextProps.forceSelection;\n  };\n\n  /**\n   * When a block is mounted and overlaps the selection state, we need to make\n   * sure that the cursor is visible to match native behavior. This may not\n   * be the case if the user has pressed `RETURN` or pasted some content, since\n   * programatically creating these new blocks and setting the DOM selection\n   * will miss out on the browser natively scrolling to that position.\n   *\n   * To replicate native behavior, if the block overlaps the selection state\n   * on mount, force the scroll position. Check the scroll state of the scroll\n   * parent, and adjust it to align the entire block to the bottom of the\n   * scroll parent.\n   */\n\n\n  DraftEditorBlock.prototype.componentDidMount = function componentDidMount() {\n    var selection = this.props.selection;\n    var endKey = selection.getEndKey();\n    if (!selection.getHasFocus() || endKey !== this.props.block.getKey()) {\n      return;\n    }\n\n    var blockNode = ReactDOM.findDOMNode(this);\n    var scrollParent = Style.getScrollParent(blockNode);\n    var scrollPosition = getScrollPosition(scrollParent);\n    var scrollDelta = void 0;\n\n    if (scrollParent === window) {\n      var nodePosition = getElementPosition(blockNode);\n      var nodeBottom = nodePosition.y + nodePosition.height;\n      var viewportHeight = getViewportDimensions().height;\n      scrollDelta = nodeBottom - viewportHeight;\n      if (scrollDelta > 0) {\n        window.scrollTo(scrollPosition.x, scrollPosition.y + scrollDelta + SCROLL_BUFFER);\n      }\n    } else {\n      !(blockNode instanceof HTMLElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'blockNode is not an HTMLElement') : invariant(false) : void 0;\n      var blockBottom = blockNode.offsetHeight + blockNode.offsetTop;\n      var scrollBottom = scrollParent.offsetHeight + scrollPosition.y;\n      scrollDelta = blockBottom - scrollBottom;\n      if (scrollDelta > 0) {\n        Scroll.setTop(scrollParent, Scroll.getTop(scrollParent) + scrollDelta + SCROLL_BUFFER);\n      }\n    }\n  };\n\n  DraftEditorBlock.prototype._renderChildren = function _renderChildren() {\n    var _this2 = this;\n\n    var block = this.props.block;\n    var blockKey = block.getKey();\n    var text = block.getText();\n    var lastLeafSet = this.props.tree.size - 1;\n    var hasSelection = isBlockOnSelectionEdge(this.props.selection, blockKey);\n\n    return this.props.tree.map(function (leafSet, ii) {\n      var leavesForLeafSet = leafSet.get('leaves');\n      var lastLeaf = leavesForLeafSet.size - 1;\n      var leaves = leavesForLeafSet.map(function (leaf, jj) {\n        var offsetKey = DraftOffsetKey.encode(blockKey, ii, jj);\n        var start = leaf.get('start');\n        var end = leaf.get('end');\n        return React.createElement(DraftEditorLeaf, {\n          key: offsetKey,\n          offsetKey: offsetKey,\n          block: block,\n          start: start,\n          selection: hasSelection ? _this2.props.selection : null,\n          forceSelection: _this2.props.forceSelection,\n          text: text.slice(start, end),\n          styleSet: block.getInlineStyleAt(start),\n          customStyleMap: _this2.props.customStyleMap,\n          customStyleFn: _this2.props.customStyleFn,\n          isLast: ii === lastLeafSet && jj === lastLeaf\n        });\n      }).toArray();\n\n      var decoratorKey = leafSet.get('decoratorKey');\n      if (decoratorKey == null) {\n        return leaves;\n      }\n\n      if (!_this2.props.decorator) {\n        return leaves;\n      }\n\n      var decorator = nullthrows(_this2.props.decorator);\n\n      var DecoratorComponent = decorator.getComponentForKey(decoratorKey);\n      if (!DecoratorComponent) {\n        return leaves;\n      }\n\n      var decoratorProps = decorator.getPropsForKey(decoratorKey);\n      var decoratorOffsetKey = DraftOffsetKey.encode(blockKey, ii, 0);\n      var decoratedText = text.slice(leavesForLeafSet.first().get('start'), leavesForLeafSet.last().get('end'));\n\n      // Resetting dir to the same value on a child node makes Chrome/Firefox\n      // confused on cursor movement. See http://jsfiddle.net/d157kLck/3/\n      var dir = UnicodeBidiDirection.getHTMLDirIfDifferent(UnicodeBidi.getDirection(decoratedText), _this2.props.direction);\n\n      return React.createElement(\n        DecoratorComponent,\n        _extends({}, decoratorProps, {\n          contentState: _this2.props.contentState,\n          decoratedText: decoratedText,\n          dir: dir,\n          key: decoratorOffsetKey,\n          entityKey: block.getEntityAt(leafSet.get('start')),\n          offsetKey: decoratorOffsetKey }),\n        leaves\n      );\n    }).toArray();\n  };\n\n  DraftEditorBlock.prototype.render = function render() {\n    var _props = this.props,\n        direction = _props.direction,\n        offsetKey = _props.offsetKey;\n\n    var className = cx({\n      'public/DraftStyleDefault/block': true,\n      'public/DraftStyleDefault/ltr': direction === 'LTR',\n      'public/DraftStyleDefault/rtl': direction === 'RTL'\n    });\n\n    return React.createElement(\n      'div',\n      { 'data-offset-key': offsetKey, className: className },\n      this._renderChildren()\n    );\n  };\n\n  return DraftEditorBlock;\n}(React.Component);\n\nmodule.exports = DraftEditorBlock;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DraftEditorTextNode.react\n * @format\n * \n */\n\n'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar React = require('react');\nvar ReactDOM = require('react-dom');\nvar UserAgent = require('fbjs/lib/UserAgent');\n\nvar invariant = require('fbjs/lib/invariant');\n\n// In IE, spans with <br> tags render as two newlines. By rendering a span\n// with only a newline character, we can be sure to render a single line.\nvar useNewlineChar = UserAgent.isBrowser('IE <= 11');\n\n/**\n * Check whether the node should be considered a newline.\n */\nfunction isNewline(node) {\n  return useNewlineChar ? node.textContent === '\\n' : node.tagName === 'BR';\n}\n\n/**\n * Placeholder elements for empty text content.\n *\n * What is this `data-text` attribute, anyway? It turns out that we need to\n * put an attribute on the lowest-level text node in order to preserve correct\n * spellcheck handling. If the <span> is naked, Chrome and Safari may do\n * bizarre things to do the DOM -- split text nodes, create extra spans, etc.\n * If the <span> has an attribute, this appears not to happen.\n * See http://jsfiddle.net/9khdavod/ for the failure case, and\n * http://jsfiddle.net/7pg143f7/ for the fixed case.\n */\nvar NEWLINE_A = useNewlineChar ? React.createElement(\n  'span',\n  { key: 'A', 'data-text': 'true' },\n  '\\n'\n) : React.createElement('br', { key: 'A', 'data-text': 'true' });\n\nvar NEWLINE_B = useNewlineChar ? React.createElement(\n  'span',\n  { key: 'B', 'data-text': 'true' },\n  '\\n'\n) : React.createElement('br', { key: 'B', 'data-text': 'true' });\n\n/**\n * The lowest-level component in a `DraftEditor`, the text node component\n * replaces the default React text node implementation. This allows us to\n * perform custom handling of newline behavior and avoid re-rendering text\n * nodes with DOM state that already matches the expectations of our immutable\n * editor state.\n */\nvar DraftEditorTextNode = function (_React$Component) {\n  _inherits(DraftEditorTextNode, _React$Component);\n\n  function DraftEditorTextNode(props) {\n    _classCallCheck(this, DraftEditorTextNode);\n\n    // By flipping this flag, we also keep flipping keys which forces\n    // React to remount this node every time it rerenders.\n    var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));\n\n    _this._forceFlag = false;\n    return _this;\n  }\n\n  DraftEditorTextNode.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {\n    var node = ReactDOM.findDOMNode(this);\n    var shouldBeNewline = nextProps.children === '';\n    !(node instanceof Element) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'node is not an Element') : invariant(false) : void 0;\n    if (shouldBeNewline) {\n      return !isNewline(node);\n    }\n    return node.textContent !== nextProps.children;\n  };\n\n  DraftEditorTextNode.prototype.componentDidMount = function componentDidMount() {\n    this._forceFlag = !this._forceFlag;\n  };\n\n  DraftEditorTextNode.prototype.componentDidUpdate = function componentDidUpdate() {\n    this._forceFlag = !this._forceFlag;\n  };\n\n  DraftEditorTextNode.prototype.render = function render() {\n    if (this.props.children === '') {\n      return this._forceFlag ? NEWLINE_A : NEWLINE_B;\n    }\n    return React.createElement(\n      'span',\n      { key: this._forceFlag ? 'A' : 'B', 'data-text': 'true' },\n      this.props.children\n    );\n  };\n\n  return DraftEditorTextNode;\n}(React.Component);\n\nmodule.exports = DraftEditorTextNode;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule moveBlockInContentState\n * @format\n * \n */\n\n'use strict';\n\nvar ContentBlockNode = require('./ContentBlockNode');\nvar Immutable = require('immutable');\n\nvar getNextDelimiterBlockKey = require('./getNextDelimiterBlockKey');\nvar invariant = require('fbjs/lib/invariant');\n\nvar OrderedMap = Immutable.OrderedMap,\n    List = Immutable.List;\n\n\nvar transformBlock = function transformBlock(key, blockMap, func) {\n  if (!key) {\n    return;\n  }\n\n  var block = blockMap.get(key);\n\n  if (!block) {\n    return;\n  }\n\n  blockMap.set(key, func(block));\n};\n\nvar updateBlockMapLinks = function updateBlockMapLinks(blockMap, originalBlockToBeMoved, originalTargetBlock, insertionMode, isExperimentalTreeBlock) {\n  if (!isExperimentalTreeBlock) {\n    return blockMap;\n  }\n  // possible values of 'insertionMode' are: 'after', 'before'\n  var isInsertedAfterTarget = insertionMode === 'after';\n\n  var originalBlockKey = originalBlockToBeMoved.getKey();\n  var originalTargetKey = originalTargetBlock.getKey();\n  var originalParentKey = originalBlockToBeMoved.getParentKey();\n  var originalNextSiblingKey = originalBlockToBeMoved.getNextSiblingKey();\n  var originalPrevSiblingKey = originalBlockToBeMoved.getPrevSiblingKey();\n  var newParentKey = originalTargetBlock.getParentKey();\n  var newNextSiblingKey = isInsertedAfterTarget ? originalTargetBlock.getNextSiblingKey() : originalTargetKey;\n  var newPrevSiblingKey = isInsertedAfterTarget ? originalTargetKey : originalTargetBlock.getPrevSiblingKey();\n\n  return blockMap.withMutations(function (blocks) {\n    // update old parent\n    transformBlock(originalParentKey, blocks, function (block) {\n      var parentChildrenList = block.getChildKeys();\n      return block.merge({\n        children: parentChildrenList['delete'](parentChildrenList.indexOf(originalBlockKey))\n      });\n    });\n\n    // update old prev\n    transformBlock(originalPrevSiblingKey, blocks, function (block) {\n      return block.merge({\n        nextSibling: originalNextSiblingKey\n      });\n    });\n\n    // update old next\n    transformBlock(originalNextSiblingKey, blocks, function (block) {\n      return block.merge({\n        prevSibling: originalPrevSiblingKey\n      });\n    });\n\n    // update new next\n    transformBlock(newNextSiblingKey, blocks, function (block) {\n      return block.merge({\n        prevSibling: originalBlockKey\n      });\n    });\n\n    // update new prev\n    transformBlock(newPrevSiblingKey, blocks, function (block) {\n      return block.merge({\n        nextSibling: originalBlockKey\n      });\n    });\n\n    // update new parent\n    transformBlock(newParentKey, blocks, function (block) {\n      var newParentChildrenList = block.getChildKeys();\n      var targetBlockIndex = newParentChildrenList.indexOf(originalTargetKey);\n\n      var insertionIndex = isInsertedAfterTarget ? targetBlockIndex + 1 : targetBlockIndex !== 0 ? targetBlockIndex - 1 : 0;\n\n      var newChildrenArray = newParentChildrenList.toArray();\n      newChildrenArray.splice(insertionIndex, 0, originalBlockKey);\n\n      return block.merge({\n        children: List(newChildrenArray)\n      });\n    });\n\n    // update block\n    transformBlock(originalBlockKey, blocks, function (block) {\n      return block.merge({\n        nextSibling: newNextSiblingKey,\n        prevSibling: newPrevSiblingKey,\n        parent: newParentKey\n      });\n    });\n  });\n};\n\nvar moveBlockInContentState = function moveBlockInContentState(contentState, blockToBeMoved, targetBlock, insertionMode) {\n  !(insertionMode !== 'replace') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Replacing blocks is not supported.') : invariant(false) : void 0;\n\n  var targetKey = targetBlock.getKey();\n  var blockKey = blockToBeMoved.getKey();\n\n  !(blockKey !== targetKey) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Block cannot be moved next to itself.') : invariant(false) : void 0;\n\n  var blockMap = contentState.getBlockMap();\n  var isExperimentalTreeBlock = blockToBeMoved instanceof ContentBlockNode;\n\n  var blocksToBeMoved = [blockToBeMoved];\n  var blockMapWithoutBlocksToBeMoved = blockMap['delete'](blockKey);\n\n  if (isExperimentalTreeBlock) {\n    blocksToBeMoved = [];\n    blockMapWithoutBlocksToBeMoved = blockMap.withMutations(function (blocks) {\n      var nextSiblingKey = blockToBeMoved.getNextSiblingKey();\n      var nextDelimiterBlockKey = getNextDelimiterBlockKey(blockToBeMoved, blocks);\n\n      blocks.toSeq().skipUntil(function (block) {\n        return block.getKey() === blockKey;\n      }).takeWhile(function (block) {\n        var key = block.getKey();\n        var isBlockToBeMoved = key === blockKey;\n        var hasNextSiblingAndIsNotNextSibling = nextSiblingKey && key !== nextSiblingKey;\n        var doesNotHaveNextSiblingAndIsNotDelimiter = !nextSiblingKey && block.getParentKey() && (!nextDelimiterBlockKey || key !== nextDelimiterBlockKey);\n\n        return !!(isBlockToBeMoved || hasNextSiblingAndIsNotNextSibling || doesNotHaveNextSiblingAndIsNotDelimiter);\n      }).forEach(function (block) {\n        blocksToBeMoved.push(block);\n        blocks['delete'](block.getKey());\n      });\n    });\n  }\n\n  var blocksBefore = blockMapWithoutBlocksToBeMoved.toSeq().takeUntil(function (v) {\n    return v === targetBlock;\n  });\n\n  var blocksAfter = blockMapWithoutBlocksToBeMoved.toSeq().skipUntil(function (v) {\n    return v === targetBlock;\n  }).skip(1);\n\n  var slicedBlocks = blocksToBeMoved.map(function (block) {\n    return [block.getKey(), block];\n  });\n\n  var newBlocks = OrderedMap();\n\n  if (insertionMode === 'before') {\n    var blockBefore = contentState.getBlockBefore(targetKey);\n\n    !(!blockBefore || blockBefore.getKey() !== blockToBeMoved.getKey()) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Block cannot be moved next to itself.') : invariant(false) : void 0;\n\n    newBlocks = blocksBefore.concat([].concat(slicedBlocks, [[targetKey, targetBlock]]), blocksAfter).toOrderedMap();\n  } else if (insertionMode === 'after') {\n    var blockAfter = contentState.getBlockAfter(targetKey);\n\n    !(!blockAfter || blockAfter.getKey() !== blockKey) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Block cannot be moved next to itself.') : invariant(false) : void 0;\n\n    newBlocks = blocksBefore.concat([[targetKey, targetBlock]].concat(slicedBlocks), blocksAfter).toOrderedMap();\n  }\n\n  return contentState.merge({\n    blockMap: updateBlockMapLinks(newBlocks, blockToBeMoved, targetBlock, insertionMode, isExperimentalTreeBlock),\n    selectionBefore: contentState.getSelectionAfter(),\n    selectionAfter: contentState.getSelectionAfter().merge({\n      anchorKey: blockKey,\n      focusKey: blockKey\n    })\n  });\n};\n\nmodule.exports = moveBlockInContentState;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule convertFromDraftStateToRaw\n * @format\n * \n */\n\n'use strict';\n\nvar _assign = require('object-assign');\n\nvar _extends = _assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar ContentBlock = require('./ContentBlock');\nvar ContentBlockNode = require('./ContentBlockNode');\nvar DraftStringKey = require('./DraftStringKey');\n\nvar encodeEntityRanges = require('./encodeEntityRanges');\nvar encodeInlineStyleRanges = require('./encodeInlineStyleRanges');\nvar invariant = require('fbjs/lib/invariant');\n\nvar createRawBlock = function createRawBlock(block, entityStorageMap) {\n  return {\n    key: block.getKey(),\n    text: block.getText(),\n    type: block.getType(),\n    depth: block.getDepth(),\n    inlineStyleRanges: encodeInlineStyleRanges(block),\n    entityRanges: encodeEntityRanges(block, entityStorageMap),\n    data: block.getData().toObject()\n  };\n};\n\nvar insertRawBlock = function insertRawBlock(block, entityMap, rawBlocks, blockCacheRef) {\n  if (block instanceof ContentBlock) {\n    rawBlocks.push(createRawBlock(block, entityMap));\n    return;\n  }\n\n  !(block instanceof ContentBlockNode) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'block is not a BlockNode') : invariant(false) : void 0;\n\n  var parentKey = block.getParentKey();\n  var rawBlock = blockCacheRef[block.getKey()] = _extends({}, createRawBlock(block, entityMap), {\n    children: []\n  });\n\n  if (parentKey) {\n    blockCacheRef[parentKey].children.push(rawBlock);\n    return;\n  }\n\n  rawBlocks.push(rawBlock);\n};\n\nvar encodeRawBlocks = function encodeRawBlocks(contentState, rawState) {\n  var entityMap = rawState.entityMap;\n\n\n  var rawBlocks = [];\n\n  var blockCacheRef = {};\n  var entityCacheRef = {};\n  var entityStorageKey = 0;\n\n  contentState.getBlockMap().forEach(function (block) {\n    block.findEntityRanges(function (character) {\n      return character.getEntity() !== null;\n    }, function (start) {\n      var entityKey = block.getEntityAt(start);\n      // Stringify to maintain order of otherwise numeric keys.\n      var stringifiedEntityKey = DraftStringKey.stringify(entityKey);\n      // This makes this function resilient to two entities\n      // erroneously having the same key\n      if (entityCacheRef[stringifiedEntityKey]) {\n        return;\n      }\n      entityCacheRef[stringifiedEntityKey] = entityKey;\n      // we need the `any` casting here since this is a temporary state\n      // where we will later on flip the entity map and populate it with\n      // real entity, at this stage we just need to map back the entity\n      // key used by the BlockNode\n      entityMap[stringifiedEntityKey] = '' + entityStorageKey;\n      entityStorageKey++;\n    });\n\n    insertRawBlock(block, entityMap, rawBlocks, blockCacheRef);\n  });\n\n  return {\n    blocks: rawBlocks,\n    entityMap: entityMap\n  };\n};\n\n// Flip storage map so that our storage keys map to global\n// DraftEntity keys.\nvar encodeRawEntityMap = function encodeRawEntityMap(contentState, rawState) {\n  var blocks = rawState.blocks,\n      entityMap = rawState.entityMap;\n\n\n  var rawEntityMap = {};\n\n  Object.keys(entityMap).forEach(function (key, index) {\n    var entity = contentState.getEntity(DraftStringKey.unstringify(key));\n    rawEntityMap[index] = {\n      type: entity.getType(),\n      mutability: entity.getMutability(),\n      data: entity.getData()\n    };\n  });\n\n  return {\n    blocks: blocks,\n    entityMap: rawEntityMap\n  };\n};\n\nvar convertFromDraftStateToRaw = function convertFromDraftStateToRaw(contentState) {\n  var rawDraftContentState = {\n    entityMap: {},\n    blocks: []\n  };\n\n  // add blocks\n  rawDraftContentState = encodeRawBlocks(contentState, rawDraftContentState);\n\n  // add entities\n  rawDraftContentState = encodeRawEntityMap(contentState, rawDraftContentState);\n\n  return rawDraftContentState;\n};\n\nmodule.exports = convertFromDraftStateToRaw;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DraftModifier\n * @format\n * \n */\n\n'use strict';\n\nvar CharacterMetadata = require('./CharacterMetadata');\nvar ContentStateInlineStyle = require('./ContentStateInlineStyle');\nvar DraftFeatureFlags = require('./DraftFeatureFlags');\nvar Immutable = require('immutable');\n\nvar applyEntityToContentState = require('./applyEntityToContentState');\nvar getCharacterRemovalRange = require('./getCharacterRemovalRange');\nvar getContentStateFragment = require('./getContentStateFragment');\nvar insertFragmentIntoContentState = require('./insertFragmentIntoContentState');\nvar insertTextIntoContentState = require('./insertTextIntoContentState');\nvar invariant = require('fbjs/lib/invariant');\nvar modifyBlockForContentState = require('./modifyBlockForContentState');\nvar removeEntitiesAtEdges = require('./removeEntitiesAtEdges');\nvar removeRangeFromContentState = require('./removeRangeFromContentState');\nvar splitBlockInContentState = require('./splitBlockInContentState');\n\nvar OrderedSet = Immutable.OrderedSet;\n\n/**\n * `DraftModifier` provides a set of convenience methods that apply\n * modifications to a `ContentState` object based on a target `SelectionState`.\n *\n * Any change to a `ContentState` should be decomposable into a series of\n * transaction functions that apply the required changes and return output\n * `ContentState` objects.\n *\n * These functions encapsulate some of the most common transaction sequences.\n */\n\nvar DraftModifier = {\n  replaceText: function replaceText(contentState, rangeToReplace, text, inlineStyle, entityKey) {\n    var withoutEntities = removeEntitiesAtEdges(contentState, rangeToReplace);\n    var withoutText = removeRangeFromContentState(withoutEntities, rangeToReplace);\n\n    var character = CharacterMetadata.create({\n      style: inlineStyle || OrderedSet(),\n      entity: entityKey || null\n    });\n\n    return insertTextIntoContentState(withoutText, withoutText.getSelectionAfter(), text, character);\n  },\n\n  insertText: function insertText(contentState, targetRange, text, inlineStyle, entityKey) {\n    !targetRange.isCollapsed() ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Target range must be collapsed for `insertText`.') : invariant(false) : void 0;\n    return DraftModifier.replaceText(contentState, targetRange, text, inlineStyle, entityKey);\n  },\n\n  moveText: function moveText(contentState, removalRange, targetRange) {\n    var movedFragment = getContentStateFragment(contentState, removalRange);\n\n    var afterRemoval = DraftModifier.removeRange(contentState, removalRange, 'backward');\n\n    return DraftModifier.replaceWithFragment(afterRemoval, targetRange, movedFragment);\n  },\n\n  replaceWithFragment: function replaceWithFragment(contentState, targetRange, fragment) {\n    var withoutEntities = removeEntitiesAtEdges(contentState, targetRange);\n    var withoutText = removeRangeFromContentState(withoutEntities, targetRange);\n\n    return insertFragmentIntoContentState(withoutText, withoutText.getSelectionAfter(), fragment);\n  },\n\n  removeRange: function removeRange(contentState, rangeToRemove, removalDirection) {\n    var startKey = void 0,\n        endKey = void 0,\n        startBlock = void 0,\n        endBlock = void 0;\n    if (rangeToRemove.getIsBackward()) {\n      rangeToRemove = rangeToRemove.merge({\n        anchorKey: rangeToRemove.getFocusKey(),\n        anchorOffset: rangeToRemove.getFocusOffset(),\n        focusKey: rangeToRemove.getAnchorKey(),\n        focusOffset: rangeToRemove.getAnchorOffset(),\n        isBackward: false\n      });\n    }\n    startKey = rangeToRemove.getAnchorKey();\n    endKey = rangeToRemove.getFocusKey();\n    startBlock = contentState.getBlockForKey(startKey);\n    endBlock = contentState.getBlockForKey(endKey);\n    var startOffset = rangeToRemove.getStartOffset();\n    var endOffset = rangeToRemove.getEndOffset();\n\n    var startEntityKey = startBlock.getEntityAt(startOffset);\n    var endEntityKey = endBlock.getEntityAt(endOffset - 1);\n\n    // Check whether the selection state overlaps with a single entity.\n    // If so, try to remove the appropriate substring of the entity text.\n    if (startKey === endKey) {\n      if (startEntityKey && startEntityKey === endEntityKey) {\n        var _adjustedRemovalRange = getCharacterRemovalRange(contentState.getEntityMap(), startBlock, endBlock, rangeToRemove, removalDirection);\n        return removeRangeFromContentState(contentState, _adjustedRemovalRange);\n      }\n    }\n    var adjustedRemovalRange = rangeToRemove;\n    if (DraftFeatureFlags.draft_segmented_entities_behavior) {\n      // Adjust the selection to properly delete segemented and immutable\n      // entities\n      adjustedRemovalRange = getCharacterRemovalRange(contentState.getEntityMap(), startBlock, endBlock, rangeToRemove, removalDirection);\n    }\n\n    var withoutEntities = removeEntitiesAtEdges(contentState, adjustedRemovalRange);\n    return removeRangeFromContentState(withoutEntities, adjustedRemovalRange);\n  },\n\n  splitBlock: function splitBlock(contentState, selectionState) {\n    var withoutEntities = removeEntitiesAtEdges(contentState, selectionState);\n    var withoutText = removeRangeFromContentState(withoutEntities, selectionState);\n\n    return splitBlockInContentState(withoutText, withoutText.getSelectionAfter());\n  },\n\n  applyInlineStyle: function applyInlineStyle(contentState, selectionState, inlineStyle) {\n    return ContentStateInlineStyle.add(contentState, selectionState, inlineStyle);\n  },\n\n  removeInlineStyle: function removeInlineStyle(contentState, selectionState, inlineStyle) {\n    return ContentStateInlineStyle.remove(contentState, selectionState, inlineStyle);\n  },\n\n  setBlockType: function setBlockType(contentState, selectionState, blockType) {\n    return modifyBlockForContentState(contentState, selectionState, function (block) {\n      return block.merge({ type: blockType, depth: 0 });\n    });\n  },\n\n  setBlockData: function setBlockData(contentState, selectionState, blockData) {\n    return modifyBlockForContentState(contentState, selectionState, function (block) {\n      return block.merge({ data: blockData });\n    });\n  },\n\n  mergeBlockData: function mergeBlockData(contentState, selectionState, blockData) {\n    return modifyBlockForContentState(contentState, selectionState, function (block) {\n      return block.merge({ data: block.getData().merge(blockData) });\n    });\n  },\n\n  applyEntity: function applyEntity(contentState, selectionState, entityKey) {\n    var withoutEntities = removeEntitiesAtEdges(contentState, selectionState);\n    return applyEntityToContentState(withoutEntities, selectionState, entityKey);\n  }\n};\n\nmodule.exports = DraftModifier;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule isSelectionAtLeafStart\n * @format\n * \n */\n\n'use strict';\n\nfunction isSelectionAtLeafStart(editorState) {\n  var selection = editorState.getSelection();\n  var anchorKey = selection.getAnchorKey();\n  var blockTree = editorState.getBlockTree(anchorKey);\n  var offset = selection.getStartOffset();\n\n  var isAtStart = false;\n\n  blockTree.some(function (leafSet) {\n    if (offset === leafSet.get('start')) {\n      isAtStart = true;\n      return true;\n    }\n\n    if (offset < leafSet.get('end')) {\n      return leafSet.get('leaves').some(function (leaf) {\n        var leafStart = leaf.get('start');\n        if (offset === leafStart) {\n          isAtStart = true;\n          return true;\n        }\n\n        return false;\n      });\n    }\n\n    return false;\n  });\n\n  return isAtStart;\n}\n\nmodule.exports = isSelectionAtLeafStart;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule insertIntoList\n * @format\n * \n */\n\n'use strict';\n\n/**\n * Maintain persistence for target list when appending and prepending.\n */\nfunction insertIntoList(targetList, toInsert, offset) {\n  if (offset === targetList.count()) {\n    toInsert.forEach(function (c) {\n      targetList = targetList.push(c);\n    });\n  } else if (offset === 0) {\n    toInsert.reverse().forEach(function (c) {\n      targetList = targetList.unshift(c);\n    });\n  } else {\n    var head = targetList.slice(0, offset);\n    var tail = targetList.slice(offset);\n    targetList = head.concat(toInsert, tail).toList();\n  }\n  return targetList;\n}\n\nmodule.exports = insertIntoList;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule splitTextIntoTextBlocks\n * @format\n * \n */\n\n'use strict';\n\nvar NEWLINE_REGEX = /\\r\\n?|\\n/g;\n\nfunction splitTextIntoTextBlocks(text) {\n  return text.split(NEWLINE_REGEX);\n}\n\nmodule.exports = splitTextIntoTextBlocks;","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DraftFeatureFlags\n * @format\n * \n */\n\n'use strict';\n\nvar DraftFeatureFlags = require('./DraftFeatureFlags-core');\n\nmodule.exports = DraftFeatureFlags;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule setDraftEditorSelection\n * @format\n * \n */\n\n'use strict';\n\nvar DraftJsDebugLogging = require('./DraftJsDebugLogging');\n\nvar containsNode = require('fbjs/lib/containsNode');\nvar getActiveElement = require('fbjs/lib/getActiveElement');\nvar invariant = require('fbjs/lib/invariant');\n\nfunction getAnonymizedDOM(node, getNodeLabels) {\n  if (!node) {\n    return '[empty]';\n  }\n\n  var anonymized = anonymizeTextWithin(node, getNodeLabels);\n  if (anonymized.nodeType === Node.TEXT_NODE) {\n    return anonymized.textContent;\n  }\n\n  !(anonymized instanceof Element) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Node must be an Element if it is not a text node.') : invariant(false) : void 0;\n  return anonymized.outerHTML;\n}\n\nfunction anonymizeTextWithin(node, getNodeLabels) {\n  var labels = getNodeLabels !== undefined ? getNodeLabels(node) : [];\n\n  if (node.nodeType === Node.TEXT_NODE) {\n    var length = node.textContent.length;\n    return document.createTextNode('[text ' + length + (labels.length ? ' | ' + labels.join(', ') : '') + ']');\n  }\n\n  var clone = node.cloneNode();\n  if (clone.nodeType === 1 && labels.length) {\n    clone.setAttribute('data-labels', labels.join(', '));\n  }\n  var childNodes = node.childNodes;\n  for (var ii = 0; ii < childNodes.length; ii++) {\n    clone.appendChild(anonymizeTextWithin(childNodes[ii], getNodeLabels));\n  }\n\n  return clone;\n}\n\nfunction getAnonymizedEditorDOM(node, getNodeLabels) {\n  // grabbing the DOM content of the Draft editor\n  var currentNode = node;\n  while (currentNode) {\n    if (currentNode instanceof Element && currentNode.hasAttribute('contenteditable')) {\n      // found the Draft editor container\n      return getAnonymizedDOM(currentNode, getNodeLabels);\n    } else {\n      currentNode = currentNode.parentNode;\n    }\n  }\n  return 'Could not find contentEditable parent of node';\n}\n\nfunction getNodeLength(node) {\n  return node.nodeValue === null ? node.childNodes.length : node.nodeValue.length;\n}\n\n/**\n * In modern non-IE browsers, we can support both forward and backward\n * selections.\n *\n * Note: IE10+ supports the Selection object, but it does not support\n * the `extend` method, which means that even in modern IE, it's not possible\n * to programatically create a backward selection. Thus, for all IE\n * versions, we use the old IE API to create our selections.\n */\nfunction setDraftEditorSelection(selectionState, node, blockKey, nodeStart, nodeEnd) {\n  // It's possible that the editor has been removed from the DOM but\n  // our selection code doesn't know it yet. Forcing selection in\n  // this case may lead to errors, so just bail now.\n  if (!containsNode(document.documentElement, node)) {\n    return;\n  }\n\n  var selection = global.getSelection();\n  var anchorKey = selectionState.getAnchorKey();\n  var anchorOffset = selectionState.getAnchorOffset();\n  var focusKey = selectionState.getFocusKey();\n  var focusOffset = selectionState.getFocusOffset();\n  var isBackward = selectionState.getIsBackward();\n\n  // IE doesn't support backward selection. Swap key/offset pairs.\n  if (!selection.extend && isBackward) {\n    var tempKey = anchorKey;\n    var tempOffset = anchorOffset;\n    anchorKey = focusKey;\n    anchorOffset = focusOffset;\n    focusKey = tempKey;\n    focusOffset = tempOffset;\n    isBackward = false;\n  }\n\n  var hasAnchor = anchorKey === blockKey && nodeStart <= anchorOffset && nodeEnd >= anchorOffset;\n\n  var hasFocus = focusKey === blockKey && nodeStart <= focusOffset && nodeEnd >= focusOffset;\n\n  // If the selection is entirely bound within this node, set the selection\n  // and be done.\n  if (hasAnchor && hasFocus) {\n    selection.removeAllRanges();\n    addPointToSelection(selection, node, anchorOffset - nodeStart, selectionState);\n    addFocusToSelection(selection, node, focusOffset - nodeStart, selectionState);\n    return;\n  }\n\n  if (!isBackward) {\n    // If the anchor is within this node, set the range start.\n    if (hasAnchor) {\n      selection.removeAllRanges();\n      addPointToSelection(selection, node, anchorOffset - nodeStart, selectionState);\n    }\n\n    // If the focus is within this node, we can assume that we have\n    // already set the appropriate start range on the selection, and\n    // can simply extend the selection.\n    if (hasFocus) {\n      addFocusToSelection(selection, node, focusOffset - nodeStart, selectionState);\n    }\n  } else {\n    // If this node has the focus, set the selection range to be a\n    // collapsed range beginning here. Later, when we encounter the anchor,\n    // we'll use this information to extend the selection.\n    if (hasFocus) {\n      selection.removeAllRanges();\n      addPointToSelection(selection, node, focusOffset - nodeStart, selectionState);\n    }\n\n    // If this node has the anchor, we may assume that the correct\n    // focus information is already stored on the selection object.\n    // We keep track of it, reset the selection range, and extend it\n    // back to the focus point.\n    if (hasAnchor) {\n      var storedFocusNode = selection.focusNode;\n      var storedFocusOffset = selection.focusOffset;\n\n      selection.removeAllRanges();\n      addPointToSelection(selection, node, anchorOffset - nodeStart, selectionState);\n      addFocusToSelection(selection, storedFocusNode, storedFocusOffset, selectionState);\n    }\n  }\n}\n\n/**\n * Extend selection towards focus point.\n */\nfunction addFocusToSelection(selection, node, offset, selectionState) {\n  var activeElement = getActiveElement();\n  if (selection.extend && containsNode(activeElement, node)) {\n    // If `extend` is called while another element has focus, an error is\n    // thrown. We therefore disable `extend` if the active element is somewhere\n    // other than the node we are selecting. This should only occur in Firefox,\n    // since it is the only browser to support multiple selections.\n    // See https://bugzilla.mozilla.org/show_bug.cgi?id=921444.\n\n    // logging to catch bug that is being reported in t16250795\n    if (offset > getNodeLength(node)) {\n      // the call to 'selection.extend' is about to throw\n      DraftJsDebugLogging.logSelectionStateFailure({\n        anonymizedDom: getAnonymizedEditorDOM(node),\n        extraParams: JSON.stringify({ offset: offset }),\n        selectionState: JSON.stringify(selectionState.toJS())\n      });\n    }\n\n    // logging to catch bug that is being reported in t18110632\n    var nodeWasFocus = node === selection.focusNode;\n    try {\n      selection.extend(node, offset);\n    } catch (e) {\n      DraftJsDebugLogging.logSelectionStateFailure({\n        anonymizedDom: getAnonymizedEditorDOM(node, function (n) {\n          var labels = [];\n          if (n === activeElement) {\n            labels.push('active element');\n          }\n          if (n === selection.anchorNode) {\n            labels.push('selection anchor node');\n          }\n          if (n === selection.focusNode) {\n            labels.push('selection focus node');\n          }\n          return labels;\n        }),\n        extraParams: JSON.stringify({\n          activeElementName: activeElement ? activeElement.nodeName : null,\n          nodeIsFocus: node === selection.focusNode,\n          nodeWasFocus: nodeWasFocus,\n          selectionRangeCount: selection.rangeCount,\n          selectionAnchorNodeName: selection.anchorNode ? selection.anchorNode.nodeName : null,\n          selectionAnchorOffset: selection.anchorOffset,\n          selectionFocusNodeName: selection.focusNode ? selection.focusNode.nodeName : null,\n          selectionFocusOffset: selection.focusOffset,\n          message: e ? '' + e : null,\n          offset: offset\n        }, null, 2),\n        selectionState: JSON.stringify(selectionState.toJS(), null, 2)\n      });\n      // allow the error to be thrown -\n      // better than continuing in a broken state\n      throw e;\n    }\n  } else {\n    // IE doesn't support extend. This will mean no backward selection.\n    // Extract the existing selection range and add focus to it.\n    // Additionally, clone the selection range. IE11 throws an\n    // InvalidStateError when attempting to access selection properties\n    // after the range is detached.\n    var range = selection.getRangeAt(0);\n    range.setEnd(node, offset);\n    selection.addRange(range.cloneRange());\n  }\n}\n\nfunction addPointToSelection(selection, node, offset, selectionState) {\n  var range = document.createRange();\n  // logging to catch bug that is being reported in t16250795\n  if (offset > getNodeLength(node)) {\n    // in this case we know that the call to 'range.setStart' is about to throw\n    DraftJsDebugLogging.logSelectionStateFailure({\n      anonymizedDom: getAnonymizedEditorDOM(node),\n      extraParams: JSON.stringify({ offset: offset }),\n      selectionState: JSON.stringify(selectionState.toJS())\n    });\n  }\n  range.setStart(node, offset);\n  selection.addRange(range);\n}\n\nmodule.exports = setDraftEditorSelection;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule moveSelectionForward\n * @format\n * \n */\n\n'use strict';\n\n/**\n * Given a collapsed selection, move the focus `maxDistance` forward within\n * the selected block. If the selection will go beyond the end of the block,\n * move focus to the start of the next block, but no further.\n *\n * This function is not Unicode-aware, so surrogate pairs will be treated\n * as having length 2.\n */\nfunction moveSelectionForward(editorState, maxDistance) {\n  var selection = editorState.getSelection();\n  var key = selection.getStartKey();\n  var offset = selection.getStartOffset();\n  var content = editorState.getCurrentContent();\n\n  var focusKey = key;\n  var focusOffset;\n\n  var block = content.getBlockForKey(key);\n\n  if (maxDistance > block.getText().length - offset) {\n    focusKey = content.getKeyAfter(key);\n    focusOffset = 0;\n  } else {\n    focusOffset = offset + maxDistance;\n  }\n\n  return selection.merge({ focusKey: focusKey, focusOffset: focusOffset });\n}\n\nmodule.exports = moveSelectionForward;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getRangeClientRects\n * @format\n * \n */\n\n'use strict';\n\nvar UserAgent = require('fbjs/lib/UserAgent');\n\nvar invariant = require('fbjs/lib/invariant');\n\nvar isChrome = UserAgent.isBrowser('Chrome');\n\n// In Chrome, the client rects will include the entire bounds of all nodes that\n// begin (have a start tag) within the selection, even if the selection does\n// not overlap the entire node. To resolve this, we split the range at each\n// start tag and join the client rects together.\n// https://code.google.com/p/chromium/issues/detail?id=324437\n/* eslint-disable consistent-return */\nfunction getRangeClientRectsChrome(range) {\n  var tempRange = range.cloneRange();\n  var clientRects = [];\n\n  for (var ancestor = range.endContainer; ancestor != null; ancestor = ancestor.parentNode) {\n    // If we've climbed up to the common ancestor, we can now use the\n    // original start point and stop climbing the tree.\n    var atCommonAncestor = ancestor === range.commonAncestorContainer;\n    if (atCommonAncestor) {\n      tempRange.setStart(range.startContainer, range.startOffset);\n    } else {\n      tempRange.setStart(tempRange.endContainer, 0);\n    }\n    var rects = Array.from(tempRange.getClientRects());\n    clientRects.push(rects);\n    if (atCommonAncestor) {\n      var _ref;\n\n      clientRects.reverse();\n      return (_ref = []).concat.apply(_ref, clientRects);\n    }\n    tempRange.setEndBefore(ancestor);\n  }\n\n  !false ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Found an unexpected detached subtree when getting range client rects.') : invariant(false) : void 0;\n}\n/* eslint-enable consistent-return */\n\n/**\n * Like range.getClientRects() but normalizes for browser bugs.\n */\nvar getRangeClientRects = isChrome ? getRangeClientRectsChrome : function (range) {\n  return Array.from(range.getClientRects());\n};\n\nmodule.exports = getRangeClientRects;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ContentState\n * @format\n * \n */\n\n'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar BlockMapBuilder = require('./BlockMapBuilder');\nvar CharacterMetadata = require('./CharacterMetadata');\nvar ContentBlock = require('./ContentBlock');\nvar ContentBlockNode = require('./ContentBlockNode');\nvar DraftEntity = require('./DraftEntity');\nvar DraftFeatureFlags = require('./DraftFeatureFlags');\nvar Immutable = require('immutable');\nvar SelectionState = require('./SelectionState');\n\nvar generateRandomKey = require('./generateRandomKey');\nvar sanitizeDraftText = require('./sanitizeDraftText');\n\nvar List = Immutable.List,\n    Record = Immutable.Record,\n    Repeat = Immutable.Repeat;\n\n\nvar experimentalTreeDataSupport = DraftFeatureFlags.draft_tree_data_support;\n\nvar defaultRecord = {\n  entityMap: null,\n  blockMap: null,\n  selectionBefore: null,\n  selectionAfter: null\n};\n\nvar ContentBlockNodeRecord = experimentalTreeDataSupport ? ContentBlockNode : ContentBlock;\n\nvar ContentStateRecord = Record(defaultRecord);\n\nvar ContentState = function (_ContentStateRecord) {\n  _inherits(ContentState, _ContentStateRecord);\n\n  function ContentState() {\n    _classCallCheck(this, ContentState);\n\n    return _possibleConstructorReturn(this, _ContentStateRecord.apply(this, arguments));\n  }\n\n  ContentState.prototype.getEntityMap = function getEntityMap() {\n    // TODO: update this when we fully remove DraftEntity\n    return DraftEntity;\n  };\n\n  ContentState.prototype.getBlockMap = function getBlockMap() {\n    return this.get('blockMap');\n  };\n\n  ContentState.prototype.getSelectionBefore = function getSelectionBefore() {\n    return this.get('selectionBefore');\n  };\n\n  ContentState.prototype.getSelectionAfter = function getSelectionAfter() {\n    return this.get('selectionAfter');\n  };\n\n  ContentState.prototype.getBlockForKey = function getBlockForKey(key) {\n    var block = this.getBlockMap().get(key);\n    return block;\n  };\n\n  ContentState.prototype.getKeyBefore = function getKeyBefore(key) {\n    return this.getBlockMap().reverse().keySeq().skipUntil(function (v) {\n      return v === key;\n    }).skip(1).first();\n  };\n\n  ContentState.prototype.getKeyAfter = function getKeyAfter(key) {\n    return this.getBlockMap().keySeq().skipUntil(function (v) {\n      return v === key;\n    }).skip(1).first();\n  };\n\n  ContentState.prototype.getBlockAfter = function getBlockAfter(key) {\n    return this.getBlockMap().skipUntil(function (_, k) {\n      return k === key;\n    }).skip(1).first();\n  };\n\n  ContentState.prototype.getBlockBefore = function getBlockBefore(key) {\n    return this.getBlockMap().reverse().skipUntil(function (_, k) {\n      return k === key;\n    }).skip(1).first();\n  };\n\n  ContentState.prototype.getBlocksAsArray = function getBlocksAsArray() {\n    return this.getBlockMap().toArray();\n  };\n\n  ContentState.prototype.getFirstBlock = function getFirstBlock() {\n    return this.getBlockMap().first();\n  };\n\n  ContentState.prototype.getLastBlock = function getLastBlock() {\n    return this.getBlockMap().last();\n  };\n\n  ContentState.prototype.getPlainText = function getPlainText(delimiter) {\n    return this.getBlockMap().map(function (block) {\n      return block ? block.getText() : '';\n    }).join(delimiter || '\\n');\n  };\n\n  ContentState.prototype.getLastCreatedEntityKey = function getLastCreatedEntityKey() {\n    // TODO: update this when we fully remove DraftEntity\n    return DraftEntity.__getLastCreatedEntityKey();\n  };\n\n  ContentState.prototype.hasText = function hasText() {\n    var blockMap = this.getBlockMap();\n    return blockMap.size > 1 || blockMap.first().getLength() > 0;\n  };\n\n  ContentState.prototype.createEntity = function createEntity(type, mutability, data) {\n    // TODO: update this when we fully remove DraftEntity\n    DraftEntity.__create(type, mutability, data);\n    return this;\n  };\n\n  ContentState.prototype.mergeEntityData = function mergeEntityData(key, toMerge) {\n    // TODO: update this when we fully remove DraftEntity\n    DraftEntity.__mergeData(key, toMerge);\n    return this;\n  };\n\n  ContentState.prototype.replaceEntityData = function replaceEntityData(key, newData) {\n    // TODO: update this when we fully remove DraftEntity\n    DraftEntity.__replaceData(key, newData);\n    return this;\n  };\n\n  ContentState.prototype.addEntity = function addEntity(instance) {\n    // TODO: update this when we fully remove DraftEntity\n    DraftEntity.__add(instance);\n    return this;\n  };\n\n  ContentState.prototype.getEntity = function getEntity(key) {\n    // TODO: update this when we fully remove DraftEntity\n    return DraftEntity.__get(key);\n  };\n\n  ContentState.createFromBlockArray = function createFromBlockArray(\n  // TODO: update flow type when we completely deprecate the old entity API\n  blocks, entityMap) {\n    // TODO: remove this when we completely deprecate the old entity API\n    var theBlocks = Array.isArray(blocks) ? blocks : blocks.contentBlocks;\n    var blockMap = BlockMapBuilder.createFromArray(theBlocks);\n    var selectionState = blockMap.isEmpty() ? new SelectionState() : SelectionState.createEmpty(blockMap.first().getKey());\n    return new ContentState({\n      blockMap: blockMap,\n      entityMap: entityMap || DraftEntity,\n      selectionBefore: selectionState,\n      selectionAfter: selectionState\n    });\n  };\n\n  ContentState.createFromText = function createFromText(text) {\n    var delimiter = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : /\\r\\n?|\\n/g;\n\n    var strings = text.split(delimiter);\n    var blocks = strings.map(function (block) {\n      block = sanitizeDraftText(block);\n      return new ContentBlockNodeRecord({\n        key: generateRandomKey(),\n        text: block,\n        type: 'unstyled',\n        characterList: List(Repeat(CharacterMetadata.EMPTY, block.length))\n      });\n    });\n    return ContentState.createFromBlockArray(blocks);\n  };\n\n  return ContentState;\n}(ContentStateRecord);\n\nmodule.exports = ContentState;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SelectionState\n * @format\n * \n */\n\n'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar Immutable = require('immutable');\n\nvar Record = Immutable.Record;\n\n\nvar defaultRecord = {\n  anchorKey: '',\n  anchorOffset: 0,\n  focusKey: '',\n  focusOffset: 0,\n  isBackward: false,\n  hasFocus: false\n};\n\nvar SelectionStateRecord = Record(defaultRecord);\n\nvar SelectionState = function (_SelectionStateRecord) {\n  _inherits(SelectionState, _SelectionStateRecord);\n\n  function SelectionState() {\n    _classCallCheck(this, SelectionState);\n\n    return _possibleConstructorReturn(this, _SelectionStateRecord.apply(this, arguments));\n  }\n\n  SelectionState.prototype.serialize = function serialize() {\n    return 'Anchor: ' + this.getAnchorKey() + ':' + this.getAnchorOffset() + ', ' + 'Focus: ' + this.getFocusKey() + ':' + this.getFocusOffset() + ', ' + 'Is Backward: ' + String(this.getIsBackward()) + ', ' + 'Has Focus: ' + String(this.getHasFocus());\n  };\n\n  SelectionState.prototype.getAnchorKey = function getAnchorKey() {\n    return this.get('anchorKey');\n  };\n\n  SelectionState.prototype.getAnchorOffset = function getAnchorOffset() {\n    return this.get('anchorOffset');\n  };\n\n  SelectionState.prototype.getFocusKey = function getFocusKey() {\n    return this.get('focusKey');\n  };\n\n  SelectionState.prototype.getFocusOffset = function getFocusOffset() {\n    return this.get('focusOffset');\n  };\n\n  SelectionState.prototype.getIsBackward = function getIsBackward() {\n    return this.get('isBackward');\n  };\n\n  SelectionState.prototype.getHasFocus = function getHasFocus() {\n    return this.get('hasFocus');\n  };\n\n  /**\n   * Return whether the specified range overlaps with an edge of the\n   * SelectionState.\n   */\n\n\n  SelectionState.prototype.hasEdgeWithin = function hasEdgeWithin(blockKey, start, end) {\n    var anchorKey = this.getAnchorKey();\n    var focusKey = this.getFocusKey();\n\n    if (anchorKey === focusKey && anchorKey === blockKey) {\n      var selectionStart = this.getStartOffset();\n      var selectionEnd = this.getEndOffset();\n      return start <= selectionEnd && selectionStart <= end;\n    }\n\n    if (blockKey !== anchorKey && blockKey !== focusKey) {\n      return false;\n    }\n\n    var offsetToCheck = blockKey === anchorKey ? this.getAnchorOffset() : this.getFocusOffset();\n\n    return start <= offsetToCheck && end >= offsetToCheck;\n  };\n\n  SelectionState.prototype.isCollapsed = function isCollapsed() {\n    return this.getAnchorKey() === this.getFocusKey() && this.getAnchorOffset() === this.getFocusOffset();\n  };\n\n  SelectionState.prototype.getStartKey = function getStartKey() {\n    return this.getIsBackward() ? this.getFocusKey() : this.getAnchorKey();\n  };\n\n  SelectionState.prototype.getStartOffset = function getStartOffset() {\n    return this.getIsBackward() ? this.getFocusOffset() : this.getAnchorOffset();\n  };\n\n  SelectionState.prototype.getEndKey = function getEndKey() {\n    return this.getIsBackward() ? this.getAnchorKey() : this.getFocusKey();\n  };\n\n  SelectionState.prototype.getEndOffset = function getEndOffset() {\n    return this.getIsBackward() ? this.getAnchorOffset() : this.getFocusOffset();\n  };\n\n  SelectionState.createEmpty = function createEmpty(key) {\n    return new SelectionState({\n      anchorKey: key,\n      anchorOffset: 0,\n      focusKey: key,\n      focusOffset: 0,\n      isBackward: false,\n      hasFocus: false\n    });\n  };\n\n  return SelectionState;\n}(SelectionStateRecord);\n\nmodule.exports = SelectionState;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule editOnCompositionStart\n * @format\n * \n */\n\n'use strict';\n\nvar EditorState = require('./EditorState');\n\n/**\n * The user has begun using an IME input system. Switching to `composite` mode\n * allows handling composition input and disables other edit behavior.\n */\nfunction editOnCompositionStart(editor, e) {\n  editor.setMode('composite');\n  editor.update(EditorState.set(editor._latestEditorState, { inCompositionMode: true }));\n  // Allow composition handler to interpret the compositionstart event\n  editor._onCompositionStart(e);\n}\n\nmodule.exports = editOnCompositionStart;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule decodeInlineStyleRanges\n * @format\n * \n */\n\n'use strict';\n\nvar _require = require('immutable'),\n    OrderedSet = _require.OrderedSet;\n\nvar UnicodeUtils = require('fbjs/lib/UnicodeUtils');\n\nvar substr = UnicodeUtils.substr;\n\n\nvar EMPTY_SET = OrderedSet();\n\n/**\n * Convert to native JavaScript string lengths to determine ranges.\n */\nfunction decodeInlineStyleRanges(text, ranges) {\n  var styles = Array(text.length).fill(EMPTY_SET);\n  if (ranges) {\n    ranges.forEach(function ( /*object*/range) {\n      var cursor = substr(text, 0, range.offset).length;\n      var end = cursor + substr(text, range.offset, range.length).length;\n      while (cursor < end) {\n        styles[cursor] = styles[cursor].add(range.style);\n        cursor++;\n      }\n    });\n  }\n  return styles;\n}\n\nmodule.exports = decodeInlineStyleRanges;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule findAncestorOffsetKey\n * @format\n * \n */\n\n'use strict';\n\nvar getSelectionOffsetKeyForNode = require('./getSelectionOffsetKeyForNode');\n\n/**\n * Get the key from the node's nearest offset-aware ancestor.\n */\nfunction findAncestorOffsetKey(node) {\n  var searchNode = node;\n  while (searchNode && searchNode !== document.documentElement) {\n    var key = getSelectionOffsetKeyForNode(searchNode);\n    if (key != null) {\n      return key;\n    }\n    searchNode = searchNode.parentNode;\n  }\n  return null;\n}\n\nmodule.exports = findAncestorOffsetKey;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DraftPasteProcessor\n * @format\n * \n */\n\n'use strict';\n\nvar _assign = require('object-assign');\n\nvar _extends = _assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar CharacterMetadata = require('./CharacterMetadata');\nvar ContentBlock = require('./ContentBlock');\nvar ContentBlockNode = require('./ContentBlockNode');\nvar DraftFeatureFlags = require('./DraftFeatureFlags');\nvar Immutable = require('immutable');\n\nvar convertFromHTMLtoContentBlocks = require('./convertFromHTMLToContentBlocks');\nvar generateRandomKey = require('./generateRandomKey');\nvar getSafeBodyFromHTML = require('./getSafeBodyFromHTML');\nvar sanitizeDraftText = require('./sanitizeDraftText');\n\nvar List = Immutable.List,\n    Repeat = Immutable.Repeat;\n\n\nvar experimentalTreeDataSupport = DraftFeatureFlags.draft_tree_data_support;\nvar ContentBlockRecord = experimentalTreeDataSupport ? ContentBlockNode : ContentBlock;\n\nvar DraftPasteProcessor = {\n  processHTML: function processHTML(html, blockRenderMap) {\n    return convertFromHTMLtoContentBlocks(html, getSafeBodyFromHTML, blockRenderMap);\n  },\n  processText: function processText(textBlocks, character, type) {\n    return textBlocks.reduce(function (acc, textLine, index) {\n      textLine = sanitizeDraftText(textLine);\n      var key = generateRandomKey();\n\n      var blockNodeConfig = {\n        key: key,\n        type: type,\n        text: textLine,\n        characterList: List(Repeat(character, textLine.length))\n      };\n\n      // next block updates previous block\n      if (experimentalTreeDataSupport && index !== 0) {\n        var prevSiblingIndex = index - 1;\n        // update previous block\n        var previousBlock = acc[prevSiblingIndex] = acc[prevSiblingIndex].merge({\n          nextSibling: key\n        });\n        blockNodeConfig = _extends({}, blockNodeConfig, {\n          prevSibling: previousBlock.getKey()\n        });\n      }\n\n      acc.push(new ContentBlockRecord(blockNodeConfig));\n\n      return acc;\n    }, []);\n  }\n};\n\nmodule.exports = DraftPasteProcessor;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule CharacterMetadata\n * @format\n * \n */\n\n'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar _require = require('immutable'),\n    Map = _require.Map,\n    OrderedSet = _require.OrderedSet,\n    Record = _require.Record;\n\n// Immutable.map is typed such that the value for every key in the map\n// must be the same type\n\n\nvar EMPTY_SET = OrderedSet();\n\nvar defaultRecord = {\n  style: EMPTY_SET,\n  entity: null\n};\n\nvar CharacterMetadataRecord = Record(defaultRecord);\n\nvar CharacterMetadata = function (_CharacterMetadataRec) {\n  _inherits(CharacterMetadata, _CharacterMetadataRec);\n\n  function CharacterMetadata() {\n    _classCallCheck(this, CharacterMetadata);\n\n    return _possibleConstructorReturn(this, _CharacterMetadataRec.apply(this, arguments));\n  }\n\n  CharacterMetadata.prototype.getStyle = function getStyle() {\n    return this.get('style');\n  };\n\n  CharacterMetadata.prototype.getEntity = function getEntity() {\n    return this.get('entity');\n  };\n\n  CharacterMetadata.prototype.hasStyle = function hasStyle(style) {\n    return this.getStyle().includes(style);\n  };\n\n  CharacterMetadata.applyStyle = function applyStyle(record, style) {\n    var withStyle = record.set('style', record.getStyle().add(style));\n    return CharacterMetadata.create(withStyle);\n  };\n\n  CharacterMetadata.removeStyle = function removeStyle(record, style) {\n    var withoutStyle = record.set('style', record.getStyle().remove(style));\n    return CharacterMetadata.create(withoutStyle);\n  };\n\n  CharacterMetadata.applyEntity = function applyEntity(record, entityKey) {\n    var withEntity = record.getEntity() === entityKey ? record : record.set('entity', entityKey);\n    return CharacterMetadata.create(withEntity);\n  };\n\n  /**\n   * Use this function instead of the `CharacterMetadata` constructor.\n   * Since most content generally uses only a very small number of\n   * style/entity permutations, we can reuse these objects as often as\n   * possible.\n   */\n\n\n  CharacterMetadata.create = function create(config) {\n    if (!config) {\n      return EMPTY;\n    }\n\n    var defaultConfig = {\n      style: EMPTY_SET,\n      entity: null\n    };\n\n    // Fill in unspecified properties, if necessary.\n    var configMap = Map(defaultConfig).merge(config);\n\n    var existing = pool.get(configMap);\n    if (existing) {\n      return existing;\n    }\n\n    var newCharacter = new CharacterMetadata(configMap);\n    pool = pool.set(configMap, newCharacter);\n    return newCharacter;\n  };\n\n  return CharacterMetadata;\n}(CharacterMetadataRecord);\n\nvar EMPTY = new CharacterMetadata();\nvar pool = Map([[Map(defaultRecord), EMPTY]]);\n\nCharacterMetadata.EMPTY = EMPTY;\n\nmodule.exports = CharacterMetadata;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule applyEntityToContentState\n * @format\n * \n */\n\n'use strict';\n\nvar Immutable = require('immutable');\n\nvar applyEntityToContentBlock = require('./applyEntityToContentBlock');\n\nfunction applyEntityToContentState(contentState, selectionState, entityKey) {\n  var blockMap = contentState.getBlockMap();\n  var startKey = selectionState.getStartKey();\n  var startOffset = selectionState.getStartOffset();\n  var endKey = selectionState.getEndKey();\n  var endOffset = selectionState.getEndOffset();\n\n  var newBlocks = blockMap.skipUntil(function (_, k) {\n    return k === startKey;\n  }).takeUntil(function (_, k) {\n    return k === endKey;\n  }).toOrderedMap().merge(Immutable.OrderedMap([[endKey, blockMap.get(endKey)]])).map(function (block, blockKey) {\n    var sliceStart = blockKey === startKey ? startOffset : 0;\n    var sliceEnd = blockKey === endKey ? endOffset : block.getLength();\n    return applyEntityToContentBlock(block, sliceStart, sliceEnd, entityKey);\n  });\n\n  return contentState.merge({\n    blockMap: blockMap.merge(newBlocks),\n    selectionBefore: selectionState,\n    selectionAfter: selectionState\n  });\n}\n\nmodule.exports = applyEntityToContentState;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule editOnSelect\n * @format\n * \n */\n\n'use strict';\n\nvar EditorState = require('./EditorState');\nvar ReactDOM = require('react-dom');\n\nvar getDraftEditorSelection = require('./getDraftEditorSelection');\nvar invariant = require('fbjs/lib/invariant');\n\nfunction editOnSelect(editor) {\n  if (editor._blockSelectEvents || editor._latestEditorState !== editor.props.editorState) {\n    return;\n  }\n\n  var editorState = editor.props.editorState;\n  var editorNode = ReactDOM.findDOMNode(editor.editorContainer);\n  !editorNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing editorNode') : invariant(false) : void 0;\n  !(editorNode.firstChild instanceof HTMLElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'editorNode.firstChild is not an HTMLElement') : invariant(false) : void 0;\n  var documentSelection = getDraftEditorSelection(editorState, editorNode.firstChild);\n  var updatedSelectionState = documentSelection.selectionState;\n\n  if (updatedSelectionState !== editorState.getSelection()) {\n    if (documentSelection.needsRecovery) {\n      editorState = EditorState.forceSelection(editorState, updatedSelectionState);\n    } else {\n      editorState = EditorState.acceptSelection(editorState, updatedSelectionState);\n    }\n    editor.update(editorState);\n  }\n}\n\nmodule.exports = editOnSelect;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DraftEditor.react\n * @format\n * \n * @preventMunge\n */\n\n'use strict';\n\nvar _assign = require('object-assign');\n\nvar _extends = _assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar DefaultDraftBlockRenderMap = require('./DefaultDraftBlockRenderMap');\nvar DefaultDraftInlineStyle = require('./DefaultDraftInlineStyle');\nvar DraftEditorCompositionHandler = require('./DraftEditorCompositionHandler');\nvar DraftEditorContents = require('./DraftEditorContents.react');\nvar DraftEditorDragHandler = require('./DraftEditorDragHandler');\nvar DraftEditorEditHandler = require('./DraftEditorEditHandler');\nvar DraftEditorPlaceholder = require('./DraftEditorPlaceholder.react');\nvar EditorState = require('./EditorState');\nvar React = require('react');\nvar ReactDOM = require('react-dom');\nvar Scroll = require('fbjs/lib/Scroll');\nvar Style = require('fbjs/lib/Style');\nvar UserAgent = require('fbjs/lib/UserAgent');\n\nvar cx = require('fbjs/lib/cx');\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar generateRandomKey = require('./generateRandomKey');\nvar getDefaultKeyBinding = require('./getDefaultKeyBinding');\nvar getScrollPosition = require('fbjs/lib/getScrollPosition');\nvar invariant = require('fbjs/lib/invariant');\nvar nullthrows = require('fbjs/lib/nullthrows');\n\nvar isIE = UserAgent.isBrowser('IE');\n\n// IE does not support the `input` event on contentEditable, so we can't\n// observe spellcheck behavior.\nvar allowSpellCheck = !isIE;\n\n// Define a set of handler objects to correspond to each possible `mode`\n// of editor behavior.\nvar handlerMap = {\n  edit: DraftEditorEditHandler,\n  composite: DraftEditorCompositionHandler,\n  drag: DraftEditorDragHandler,\n  cut: null,\n  render: null\n};\n\n/**\n * `DraftEditor` is the root editor component. It composes a `contentEditable`\n * div, and provides a wide variety of useful function props for managing the\n * state of the editor. See `DraftEditorProps` for details.\n */\nvar DraftEditor = function (_React$Component) {\n  _inherits(DraftEditor, _React$Component);\n\n  function DraftEditor(props) {\n    _classCallCheck(this, DraftEditor);\n\n    var _this = _possibleConstructorReturn(this, _React$Component.call(this, props));\n\n    _this.focus = function (scrollPosition) {\n      var editorState = _this.props.editorState;\n\n      var alreadyHasFocus = editorState.getSelection().getHasFocus();\n      var editorNode = ReactDOM.findDOMNode(_this.editor);\n\n      if (!editorNode) {\n        // once in a while people call 'focus' in a setTimeout, and the node has\n        // been deleted, so it can be null in that case.\n        return;\n      }\n\n      var scrollParent = Style.getScrollParent(editorNode);\n\n      var _ref = scrollPosition || getScrollPosition(scrollParent),\n          x = _ref.x,\n          y = _ref.y;\n\n      !(editorNode instanceof HTMLElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'editorNode is not an HTMLElement') : invariant(false) : void 0;\n      editorNode.focus();\n\n      // Restore scroll position\n      if (scrollParent === window) {\n        window.scrollTo(x, y);\n      } else {\n        Scroll.setTop(scrollParent, y);\n      }\n\n      // On Chrome and Safari, calling focus on contenteditable focuses the\n      // cursor at the first character. This is something you don't expect when\n      // you're clicking on an input element but not directly on a character.\n      // Put the cursor back where it was before the blur.\n      if (!alreadyHasFocus) {\n        _this.update(EditorState.forceSelection(editorState, editorState.getSelection()));\n      }\n    };\n\n    _this.blur = function () {\n      var editorNode = ReactDOM.findDOMNode(_this.editor);\n      !(editorNode instanceof HTMLElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'editorNode is not an HTMLElement') : invariant(false) : void 0;\n      editorNode.blur();\n    };\n\n    _this.setMode = function (mode) {\n      _this._handler = handlerMap[mode];\n    };\n\n    _this.exitCurrentMode = function () {\n      _this.setMode('edit');\n    };\n\n    _this.restoreEditorDOM = function (scrollPosition) {\n      _this.setState({ contentsKey: _this.state.contentsKey + 1 }, function () {\n        _this.focus(scrollPosition);\n      });\n    };\n\n    _this.setClipboard = function (clipboard) {\n      _this._clipboard = clipboard;\n    };\n\n    _this.getClipboard = function () {\n      return _this._clipboard;\n    };\n\n    _this.update = function (editorState) {\n      _this._latestEditorState = editorState;\n      _this.props.onChange(editorState);\n    };\n\n    _this.onDragEnter = function () {\n      _this._dragCount++;\n    };\n\n    _this.onDragLeave = function () {\n      _this._dragCount--;\n      if (_this._dragCount === 0) {\n        _this.exitCurrentMode();\n      }\n    };\n\n    _this._blockSelectEvents = false;\n    _this._clipboard = null;\n    _this._handler = null;\n    _this._dragCount = 0;\n    _this._editorKey = props.editorKey || generateRandomKey();\n    _this._placeholderAccessibilityID = 'placeholder-' + _this._editorKey;\n    _this._latestEditorState = props.editorState;\n    _this._latestCommittedEditorState = props.editorState;\n\n    _this._onBeforeInput = _this._buildHandler('onBeforeInput');\n    _this._onBlur = _this._buildHandler('onBlur');\n    _this._onCharacterData = _this._buildHandler('onCharacterData');\n    _this._onCompositionEnd = _this._buildHandler('onCompositionEnd');\n    _this._onCompositionStart = _this._buildHandler('onCompositionStart');\n    _this._onCopy = _this._buildHandler('onCopy');\n    _this._onCut = _this._buildHandler('onCut');\n    _this._onDragEnd = _this._buildHandler('onDragEnd');\n    _this._onDragOver = _this._buildHandler('onDragOver');\n    _this._onDragStart = _this._buildHandler('onDragStart');\n    _this._onDrop = _this._buildHandler('onDrop');\n    _this._onInput = _this._buildHandler('onInput');\n    _this._onFocus = _this._buildHandler('onFocus');\n    _this._onKeyDown = _this._buildHandler('onKeyDown');\n    _this._onKeyPress = _this._buildHandler('onKeyPress');\n    _this._onKeyUp = _this._buildHandler('onKeyUp');\n    _this._onMouseDown = _this._buildHandler('onMouseDown');\n    _this._onMouseUp = _this._buildHandler('onMouseUp');\n    _this._onPaste = _this._buildHandler('onPaste');\n    _this._onSelect = _this._buildHandler('onSelect');\n\n    _this.getEditorKey = function () {\n      return _this._editorKey;\n    };\n\n    // See `restoreEditorDOM()`.\n    _this.state = { contentsKey: 0 };\n    return _this;\n  }\n\n  /**\n   * Build a method that will pass the event to the specified handler method.\n   * This allows us to look up the correct handler function for the current\n   * editor mode, if any has been specified.\n   */\n\n\n  /**\n   * Define proxies that can route events to the current handler.\n   */\n\n\n  DraftEditor.prototype._buildHandler = function _buildHandler(eventName) {\n    var _this2 = this;\n\n    return function (e) {\n      if (!_this2.props.readOnly) {\n        var method = _this2._handler && _this2._handler[eventName];\n        method && method(_this2, e);\n      }\n    };\n  };\n\n  DraftEditor.prototype._showPlaceholder = function _showPlaceholder() {\n    return !!this.props.placeholder && !this.props.editorState.isInCompositionMode() && !this.props.editorState.getCurrentContent().hasText();\n  };\n\n  DraftEditor.prototype._renderPlaceholder = function _renderPlaceholder() {\n    if (this._showPlaceholder()) {\n      var placeHolderProps = {\n        text: nullthrows(this.props.placeholder),\n        editorState: this.props.editorState,\n        textAlignment: this.props.textAlignment,\n        accessibilityID: this._placeholderAccessibilityID\n      };\n\n      return React.createElement(DraftEditorPlaceholder, placeHolderProps);\n    }\n    return null;\n  };\n\n  DraftEditor.prototype.render = function render() {\n    var _this3 = this;\n\n    var _props = this.props,\n        blockRenderMap = _props.blockRenderMap,\n        blockRendererFn = _props.blockRendererFn,\n        blockStyleFn = _props.blockStyleFn,\n        customStyleFn = _props.customStyleFn,\n        customStyleMap = _props.customStyleMap,\n        editorState = _props.editorState,\n        readOnly = _props.readOnly,\n        textAlignment = _props.textAlignment,\n        textDirectionality = _props.textDirectionality;\n\n\n    var rootClass = cx({\n      'DraftEditor/root': true,\n      'DraftEditor/alignLeft': textAlignment === 'left',\n      'DraftEditor/alignRight': textAlignment === 'right',\n      'DraftEditor/alignCenter': textAlignment === 'center'\n    });\n\n    var contentStyle = {\n      outline: 'none',\n      // fix parent-draggable Safari bug. #1326\n      userSelect: 'text',\n      WebkitUserSelect: 'text',\n      whiteSpace: 'pre-wrap',\n      wordWrap: 'break-word'\n    };\n\n    // The aria-expanded and aria-haspopup properties should only be rendered\n    // for a combobox.\n    var ariaRole = this.props.role || 'textbox';\n    var ariaExpanded = ariaRole === 'combobox' ? !!this.props.ariaExpanded : null;\n\n    var editorContentsProps = {\n      blockRenderMap: blockRenderMap,\n      blockRendererFn: blockRendererFn,\n      blockStyleFn: blockStyleFn,\n      customStyleMap: _extends({}, DefaultDraftInlineStyle, customStyleMap),\n      customStyleFn: customStyleFn,\n      editorKey: this._editorKey,\n      editorState: editorState,\n      key: 'contents' + this.state.contentsKey,\n      textDirectionality: textDirectionality\n    };\n\n    return React.createElement(\n      'div',\n      { className: rootClass },\n      this._renderPlaceholder(),\n      React.createElement(\n        'div',\n        {\n          className: cx('DraftEditor/editorContainer'),\n          ref: function ref(_ref3) {\n            return _this3.editorContainer = _ref3;\n          } },\n        React.createElement(\n          'div',\n          {\n            'aria-activedescendant': readOnly ? null : this.props.ariaActiveDescendantID,\n            'aria-autocomplete': readOnly ? null : this.props.ariaAutoComplete,\n            'aria-controls': readOnly ? null : this.props.ariaControls,\n            'aria-describedby': this.props.ariaDescribedBy || this._placeholderAccessibilityID,\n            'aria-expanded': readOnly ? null : ariaExpanded,\n            'aria-label': this.props.ariaLabel,\n            'aria-labelledby': this.props.ariaLabelledBy,\n            'aria-multiline': this.props.ariaMultiline,\n            autoCapitalize: this.props.autoCapitalize,\n            autoComplete: this.props.autoComplete,\n            autoCorrect: this.props.autoCorrect,\n            className: cx({\n              // Chrome's built-in translation feature mutates the DOM in ways\n              // that Draft doesn't expect (ex: adding <font> tags inside\n              // DraftEditorLeaf spans) and causes problems. We add notranslate\n              // here which makes its autotranslation skip over this subtree.\n              notranslate: !readOnly,\n              'public/DraftEditor/content': true\n            }),\n            contentEditable: !readOnly,\n            'data-testid': this.props.webDriverTestID,\n            onBeforeInput: this._onBeforeInput,\n            onBlur: this._onBlur,\n            onCompositionEnd: this._onCompositionEnd,\n            onCompositionStart: this._onCompositionStart,\n            onCopy: this._onCopy,\n            onCut: this._onCut,\n            onDragEnd: this._onDragEnd,\n            onDragEnter: this.onDragEnter,\n            onDragLeave: this.onDragLeave,\n            onDragOver: this._onDragOver,\n            onDragStart: this._onDragStart,\n            onDrop: this._onDrop,\n            onFocus: this._onFocus,\n            onInput: this._onInput,\n            onKeyDown: this._onKeyDown,\n            onKeyPress: this._onKeyPress,\n            onKeyUp: this._onKeyUp,\n            onMouseUp: this._onMouseUp,\n            onPaste: this._onPaste,\n            onSelect: this._onSelect,\n            ref: function ref(_ref2) {\n              return _this3.editor = _ref2;\n            },\n            role: readOnly ? null : ariaRole,\n            spellCheck: allowSpellCheck && this.props.spellCheck,\n            style: contentStyle,\n            suppressContentEditableWarning: true,\n            tabIndex: this.props.tabIndex },\n          React.createElement(DraftEditorContents, editorContentsProps)\n        )\n      )\n    );\n  };\n\n  DraftEditor.prototype.componentDidMount = function componentDidMount() {\n    this.setMode('edit');\n\n    /**\n     * IE has a hardcoded \"feature\" that attempts to convert link text into\n     * anchors in contentEditable DOM. This breaks the editor's expectations of\n     * the DOM, and control is lost. Disable it to make IE behave.\n     * See: http://blogs.msdn.com/b/ieinternals/archive/2010/09/15/\n     * ie9-beta-minor-change-list.aspx\n     */\n    if (isIE) {\n      document.execCommand('AutoUrlDetect', false, false);\n    }\n  };\n\n  /**\n   * Prevent selection events from affecting the current editor state. This\n   * is mostly intended to defend against IE, which fires off `selectionchange`\n   * events regardless of whether the selection is set via the browser or\n   * programmatically. We only care about selection events that occur because\n   * of browser interaction, not re-renders and forced selections.\n   */\n\n\n  DraftEditor.prototype.componentWillUpdate = function componentWillUpdate(nextProps) {\n    this._blockSelectEvents = true;\n    this._latestEditorState = nextProps.editorState;\n  };\n\n  DraftEditor.prototype.componentDidUpdate = function componentDidUpdate() {\n    this._blockSelectEvents = false;\n    this._latestCommittedEditorState = this.props.editorState;\n  };\n\n  /**\n   * Used via `this.focus()`.\n   *\n   * Force focus back onto the editor node.\n   *\n   * We attempt to preserve scroll position when focusing. You can also pass\n   * a specified scroll position (for cases like `cut` behavior where it should\n   * be restored to a known position).\n   */\n\n\n  /**\n   * Used via `this.setMode(...)`.\n   *\n   * Set the behavior mode for the editor component. This switches the current\n   * handler module to ensure that DOM events are managed appropriately for\n   * the active mode.\n   */\n\n\n  /**\n   * Used via `this.restoreEditorDOM()`.\n   *\n   * Force a complete re-render of the DraftEditorContents based on the current\n   * EditorState. This is useful when we know we are going to lose control of\n   * the DOM state (cut command, IME) and we want to make sure that\n   * reconciliation occurs on a version of the DOM that is synchronized with\n   * our EditorState.\n   */\n\n\n  /**\n   * Used via `this.setClipboard(...)`.\n   *\n   * Set the clipboard state for a cut/copy event.\n   */\n\n\n  /**\n   * Used via `this.getClipboard()`.\n   *\n   * Retrieve the clipboard state for a cut/copy event.\n   */\n\n\n  /**\n   * Used via `this.update(...)`.\n   *\n   * Propagate a new `EditorState` object to higher-level components. This is\n   * the method by which event handlers inform the `DraftEditor` component of\n   * state changes. A component that composes a `DraftEditor` **must** provide\n   * an `onChange` prop to receive state updates passed along from this\n   * function.\n   */\n\n\n  /**\n   * Used in conjunction with `onDragLeave()`, by counting the number of times\n   * a dragged element enters and leaves the editor (or any of its children),\n   * to determine when the dragged element absolutely leaves the editor.\n   */\n\n\n  /**\n   * See `onDragEnter()`.\n   */\n\n\n  return DraftEditor;\n}(React.Component);\n\nDraftEditor.defaultProps = {\n  blockRenderMap: DefaultDraftBlockRenderMap,\n  blockRendererFn: emptyFunction.thatReturnsNull,\n  blockStyleFn: emptyFunction.thatReturns(''),\n  keyBindingFn: getDefaultKeyBinding,\n  readOnly: false,\n  spellCheck: false,\n  stripPastedStyles: false\n};\n\n\nmodule.exports = DraftEditor;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DraftJsDebugLogging\n */\n\n'use strict';\n\nmodule.exports = {\n  logSelectionStateFailure: function logSelectionStateFailure() {\n    return null;\n  }\n};","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule keyCommandMoveSelectionToStartOfBlock\n * @format\n * \n */\n\n'use strict';\n\nvar EditorState = require('./EditorState');\n\n/**\n * Collapse selection at the start of the first selected block. This is used\n * for Firefox versions that attempt to navigate forward/backward instead of\n * moving the cursor. Other browsers are able to move the cursor natively.\n */\nfunction keyCommandMoveSelectionToStartOfBlock(editorState) {\n  var selection = editorState.getSelection();\n  var startKey = selection.getStartKey();\n  return EditorState.set(editorState, {\n    selection: selection.merge({\n      anchorKey: startKey,\n      anchorOffset: 0,\n      focusKey: startKey,\n      focusOffset: 0,\n      isBackward: false\n    }),\n    forceSelection: true\n  });\n}\n\nmodule.exports = keyCommandMoveSelectionToStartOfBlock;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule KeyBindingUtil\n * @format\n * \n */\n\n'use strict';\n\nvar UserAgent = require('fbjs/lib/UserAgent');\n\nvar isOSX = UserAgent.isPlatform('Mac OS X');\n\nvar KeyBindingUtil = {\n  /**\n   * Check whether the ctrlKey modifier is *not* being used in conjunction with\n   * the altKey modifier. If they are combined, the result is an `altGraph`\n   * key modifier, which should not be handled by this set of key bindings.\n   */\n  isCtrlKeyCommand: function isCtrlKeyCommand(e) {\n    return !!e.ctrlKey && !e.altKey;\n  },\n\n  isOptionKeyCommand: function isOptionKeyCommand(e) {\n    return isOSX && e.altKey;\n  },\n\n  hasCommandModifier: function hasCommandModifier(e) {\n    return isOSX ? !!e.metaKey && !e.altKey : KeyBindingUtil.isCtrlKeyCommand(e);\n  }\n};\n\nmodule.exports = KeyBindingUtil;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule Draft\n * @format\n * \n */\n\n'use strict';\n\nvar AtomicBlockUtils = require('./AtomicBlockUtils');\nvar BlockMapBuilder = require('./BlockMapBuilder');\nvar CharacterMetadata = require('./CharacterMetadata');\nvar CompositeDraftDecorator = require('./CompositeDraftDecorator');\nvar ContentBlock = require('./ContentBlock');\nvar ContentState = require('./ContentState');\nvar DefaultDraftBlockRenderMap = require('./DefaultDraftBlockRenderMap');\nvar DefaultDraftInlineStyle = require('./DefaultDraftInlineStyle');\nvar DraftEditor = require('./DraftEditor.react');\nvar DraftEditorBlock = require('./DraftEditorBlock.react');\nvar DraftEntity = require('./DraftEntity');\nvar DraftModifier = require('./DraftModifier');\nvar DraftEntityInstance = require('./DraftEntityInstance');\nvar EditorState = require('./EditorState');\nvar KeyBindingUtil = require('./KeyBindingUtil');\nvar RichTextEditorUtil = require('./RichTextEditorUtil');\nvar SelectionState = require('./SelectionState');\n\nvar convertFromDraftStateToRaw = require('./convertFromDraftStateToRaw');\nvar convertFromHTMLToContentBlocks = require('./convertFromHTMLToContentBlocks');\nvar convertFromRawToDraftState = require('./convertFromRawToDraftState');\nvar generateRandomKey = require('./generateRandomKey');\nvar getDefaultKeyBinding = require('./getDefaultKeyBinding');\nvar getVisibleSelectionRect = require('./getVisibleSelectionRect');\n\nvar DraftPublic = {\n  Editor: DraftEditor,\n  EditorBlock: DraftEditorBlock,\n  EditorState: EditorState,\n\n  CompositeDecorator: CompositeDraftDecorator,\n  Entity: DraftEntity,\n  EntityInstance: DraftEntityInstance,\n\n  BlockMapBuilder: BlockMapBuilder,\n  CharacterMetadata: CharacterMetadata,\n  ContentBlock: ContentBlock,\n  ContentState: ContentState,\n  SelectionState: SelectionState,\n\n  AtomicBlockUtils: AtomicBlockUtils,\n  KeyBindingUtil: KeyBindingUtil,\n  Modifier: DraftModifier,\n  RichUtils: RichTextEditorUtil,\n\n  DefaultDraftBlockRenderMap: DefaultDraftBlockRenderMap,\n  DefaultDraftInlineStyle: DefaultDraftInlineStyle,\n\n  convertFromHTML: convertFromHTMLToContentBlocks,\n  convertFromRaw: convertFromRawToDraftState,\n  convertToRaw: convertFromDraftStateToRaw,\n  genKey: generateRandomKey,\n  getDefaultKeyBinding: getDefaultKeyBinding,\n  getVisibleSelectionRect: getVisibleSelectionRect\n};\n\nmodule.exports = DraftPublic;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule editOnFocus\n * @format\n * \n */\n\n'use strict';\n\nvar EditorState = require('./EditorState');\nvar UserAgent = require('fbjs/lib/UserAgent');\n\nfunction editOnFocus(editor, e) {\n  var editorState = editor._latestEditorState;\n  var currentSelection = editorState.getSelection();\n  if (currentSelection.getHasFocus()) {\n    return;\n  }\n\n  var selection = currentSelection.set('hasFocus', true);\n  editor.props.onFocus && editor.props.onFocus(e);\n\n  // When the tab containing this text editor is hidden and the user does a\n  // find-in-page in a _different_ tab, Chrome on Mac likes to forget what the\n  // selection was right after sending this focus event and (if you let it)\n  // moves the cursor back to the beginning of the editor, so we force the\n  // selection here instead of simply accepting it in order to preserve the\n  // old cursor position. See https://crbug.com/540004.\n  // But it looks like this is fixed in Chrome 60.0.3081.0.\n  // Other browsers also don't have this bug, so we prefer to acceptSelection\n  // when possible, to ensure that unfocusing and refocusing a Draft editor\n  // doesn't preserve the selection, matching how textareas work.\n  if (UserAgent.isBrowser('Chrome < 60.0.3081.0')) {\n    editor.update(EditorState.forceSelection(editorState, selection));\n  } else {\n    editor.update(EditorState.acceptSelection(editorState, selection));\n  }\n}\n\nmodule.exports = editOnFocus;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DraftEditorEditHandler\n * @format\n * \n */\n\n'use strict';\n\nvar onBeforeInput = require('./editOnBeforeInput');\nvar onBlur = require('./editOnBlur');\nvar onCompositionStart = require('./editOnCompositionStart');\nvar onCopy = require('./editOnCopy');\nvar onCut = require('./editOnCut');\nvar onDragOver = require('./editOnDragOver');\nvar onDragStart = require('./editOnDragStart');\nvar onFocus = require('./editOnFocus');\nvar onInput = require('./editOnInput');\nvar onKeyDown = require('./editOnKeyDown');\nvar onPaste = require('./editOnPaste');\nvar onSelect = require('./editOnSelect');\n\nvar DraftEditorEditHandler = {\n  onBeforeInput: onBeforeInput,\n  onBlur: onBlur,\n  onCompositionStart: onCompositionStart,\n  onCopy: onCopy,\n  onCut: onCut,\n  onDragOver: onDragOver,\n  onDragStart: onDragStart,\n  onFocus: onFocus,\n  onInput: onInput,\n  onKeyDown: onKeyDown,\n  onPaste: onPaste,\n  onSelect: onSelect\n};\n\nmodule.exports = DraftEditorEditHandler;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getTextContentFromFiles\n * @format\n * \n */\n\n'use strict';\n\nvar invariant = require('fbjs/lib/invariant');\n\nvar TEXT_CLIPPING_REGEX = /\\.textClipping$/;\n\nvar TEXT_TYPES = {\n  'text/plain': true,\n  'text/html': true,\n  'text/rtf': true\n};\n\n// Somewhat arbitrary upper bound on text size. Let's not lock up the browser.\nvar TEXT_SIZE_UPPER_BOUND = 5000;\n\n/**\n * Extract the text content from a file list.\n */\nfunction getTextContentFromFiles(files, callback) {\n  var readCount = 0;\n  var results = [];\n  files.forEach(function ( /*blob*/file) {\n    readFile(file, function ( /*string*/text) {\n      readCount++;\n      text && results.push(text.slice(0, TEXT_SIZE_UPPER_BOUND));\n      if (readCount == files.length) {\n        callback(results.join('\\r'));\n      }\n    });\n  });\n}\n\n/**\n * todo isaac: Do work to turn html/rtf into a content fragment.\n */\nfunction readFile(file, callback) {\n  if (!global.FileReader || file.type && !(file.type in TEXT_TYPES)) {\n    callback('');\n    return;\n  }\n\n  if (file.type === '') {\n    var contents = '';\n    // Special-case text clippings, which have an empty type but include\n    // `.textClipping` in the file name. `readAsText` results in an empty\n    // string for text clippings, so we force the file name to serve\n    // as the text value for the file.\n    if (TEXT_CLIPPING_REGEX.test(file.name)) {\n      contents = file.name.replace(TEXT_CLIPPING_REGEX, '');\n    }\n    callback(contents);\n    return;\n  }\n\n  var reader = new FileReader();\n  reader.onload = function () {\n    var result = reader.result;\n    !(typeof result === 'string') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'We should be calling \"FileReader.readAsText\" which returns a string') : invariant(false) : void 0;\n    callback(result);\n  };\n  reader.onerror = function () {\n    callback('');\n  };\n  reader.readAsText(file);\n}\n\nmodule.exports = getTextContentFromFiles;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule removeRangeFromContentState\n * @format\n * \n */\n\n'use strict';\n\nvar ContentBlockNode = require('./ContentBlockNode');\nvar Immutable = require('immutable');\n\nvar getNextDelimiterBlockKey = require('./getNextDelimiterBlockKey');\n\nvar List = Immutable.List,\n    Map = Immutable.Map;\n\n\nvar transformBlock = function transformBlock(key, blockMap, func) {\n  if (!key) {\n    return;\n  }\n\n  var block = blockMap.get(key);\n\n  if (!block) {\n    return;\n  }\n\n  blockMap.set(key, func(block));\n};\n\n/**\n * Ancestors needs to be preserved when there are non selected\n * children to make sure we do not leave any orphans behind\n */\nvar getAncestorsKeys = function getAncestorsKeys(blockKey, blockMap) {\n  var parents = [];\n\n  if (!blockKey) {\n    return parents;\n  }\n\n  var blockNode = blockMap.get(blockKey);\n  while (blockNode && blockNode.getParentKey()) {\n    var parentKey = blockNode.getParentKey();\n    if (parentKey) {\n      parents.push(parentKey);\n    }\n    blockNode = parentKey ? blockMap.get(parentKey) : null;\n  }\n\n  return parents;\n};\n\n/**\n * Get all next delimiter keys until we hit a root delimiter and return\n * an array of key references\n */\nvar getNextDelimitersBlockKeys = function getNextDelimitersBlockKeys(block, blockMap) {\n  var nextDelimiters = [];\n\n  if (!block) {\n    return nextDelimiters;\n  }\n\n  var nextDelimiter = getNextDelimiterBlockKey(block, blockMap);\n  while (nextDelimiter && blockMap.get(nextDelimiter)) {\n    var _block = blockMap.get(nextDelimiter);\n    nextDelimiters.push(nextDelimiter);\n\n    // we do not need to keep checking all root node siblings, just the first occurance\n    nextDelimiter = _block.getParentKey() ? getNextDelimiterBlockKey(_block, blockMap) : null;\n  }\n\n  return nextDelimiters;\n};\n\nvar getNextValidSibling = function getNextValidSibling(block, blockMap, originalBlockMap) {\n  if (!block) {\n    return null;\n  }\n\n  // note that we need to make sure we refer to the original block since this\n  // function is called within a withMutations\n  var nextValidSiblingKey = originalBlockMap.get(block.getKey()).getNextSiblingKey();\n\n  while (nextValidSiblingKey && !blockMap.get(nextValidSiblingKey)) {\n    nextValidSiblingKey = originalBlockMap.get(nextValidSiblingKey).getNextSiblingKey() || null;\n  }\n\n  return nextValidSiblingKey;\n};\n\nvar getPrevValidSibling = function getPrevValidSibling(block, blockMap, originalBlockMap) {\n  if (!block) {\n    return null;\n  }\n\n  // note that we need to make sure we refer to the original block since this\n  // function is called within a withMutations\n  var prevValidSiblingKey = originalBlockMap.get(block.getKey()).getPrevSiblingKey();\n\n  while (prevValidSiblingKey && !blockMap.get(prevValidSiblingKey)) {\n    prevValidSiblingKey = originalBlockMap.get(prevValidSiblingKey).getPrevSiblingKey() || null;\n  }\n\n  return prevValidSiblingKey;\n};\n\nvar updateBlockMapLinks = function updateBlockMapLinks(blockMap, startBlock, endBlock, originalBlockMap) {\n  return blockMap.withMutations(function (blocks) {\n    // update start block if its retained\n    transformBlock(startBlock.getKey(), blocks, function (block) {\n      return block.merge({\n        nextSibling: getNextValidSibling(startBlock, blocks, originalBlockMap),\n        prevSibling: getPrevValidSibling(startBlock, blocks, originalBlockMap)\n      });\n    });\n\n    // update endblock if its retained\n    transformBlock(endBlock.getKey(), blocks, function (block) {\n      return block.merge({\n        nextSibling: getNextValidSibling(endBlock, blocks, originalBlockMap),\n        prevSibling: getPrevValidSibling(endBlock, blocks, originalBlockMap)\n      });\n    });\n\n    // update start block parent ancestors\n    getAncestorsKeys(startBlock.getKey(), originalBlockMap).forEach(function (parentKey) {\n      return transformBlock(parentKey, blocks, function (block) {\n        return block.merge({\n          children: block.getChildKeys().filter(function (key) {\n            return blocks.get(key);\n          }),\n          nextSibling: getNextValidSibling(block, blocks, originalBlockMap),\n          prevSibling: getPrevValidSibling(block, blocks, originalBlockMap)\n        });\n      });\n    });\n\n    // update start block next - can only happen if startBlock == endBlock\n    transformBlock(startBlock.getNextSiblingKey(), blocks, function (block) {\n      return block.merge({\n        prevSibling: startBlock.getPrevSiblingKey()\n      });\n    });\n\n    // update start block prev\n    transformBlock(startBlock.getPrevSiblingKey(), blocks, function (block) {\n      return block.merge({\n        nextSibling: getNextValidSibling(startBlock, blocks, originalBlockMap)\n      });\n    });\n\n    // update end block next\n    transformBlock(endBlock.getNextSiblingKey(), blocks, function (block) {\n      return block.merge({\n        prevSibling: getPrevValidSibling(endBlock, blocks, originalBlockMap)\n      });\n    });\n\n    // update end block prev\n    transformBlock(endBlock.getPrevSiblingKey(), blocks, function (block) {\n      return block.merge({\n        nextSibling: endBlock.getNextSiblingKey()\n      });\n    });\n\n    // update end block parent ancestors\n    getAncestorsKeys(endBlock.getKey(), originalBlockMap).forEach(function (parentKey) {\n      transformBlock(parentKey, blocks, function (block) {\n        return block.merge({\n          children: block.getChildKeys().filter(function (key) {\n            return blocks.get(key);\n          }),\n          nextSibling: getNextValidSibling(block, blocks, originalBlockMap),\n          prevSibling: getPrevValidSibling(block, blocks, originalBlockMap)\n        });\n      });\n    });\n\n    // update next delimiters all the way to a root delimiter\n    getNextDelimitersBlockKeys(endBlock, originalBlockMap).forEach(function (delimiterKey) {\n      return transformBlock(delimiterKey, blocks, function (block) {\n        return block.merge({\n          nextSibling: getNextValidSibling(block, blocks, originalBlockMap),\n          prevSibling: getPrevValidSibling(block, blocks, originalBlockMap)\n        });\n      });\n    });\n  });\n};\n\nvar removeRangeFromContentState = function removeRangeFromContentState(contentState, selectionState) {\n  if (selectionState.isCollapsed()) {\n    return contentState;\n  }\n\n  var blockMap = contentState.getBlockMap();\n  var startKey = selectionState.getStartKey();\n  var startOffset = selectionState.getStartOffset();\n  var endKey = selectionState.getEndKey();\n  var endOffset = selectionState.getEndOffset();\n\n  var startBlock = blockMap.get(startKey);\n  var endBlock = blockMap.get(endKey);\n\n  // we assume that ContentBlockNode and ContentBlocks are not mixed together\n  var isExperimentalTreeBlock = startBlock instanceof ContentBlockNode;\n\n  // used to retain blocks that should not be deleted to avoid orphan children\n  var parentAncestors = [];\n\n  if (isExperimentalTreeBlock) {\n    var endBlockchildrenKeys = endBlock.getChildKeys();\n    var endBlockAncestors = getAncestorsKeys(endKey, blockMap);\n\n    // endBlock has unselected sibblings so we can not remove its ancestors parents\n    if (endBlock.getNextSiblingKey()) {\n      parentAncestors = parentAncestors.concat(endBlockAncestors);\n    }\n\n    // endBlock has children so can not remove this block or any of its ancestors\n    if (!endBlockchildrenKeys.isEmpty()) {\n      parentAncestors = parentAncestors.concat(endBlockAncestors.concat([endKey]));\n    }\n\n    // we need to retain all ancestors of the next delimiter block\n    parentAncestors = parentAncestors.concat(getAncestorsKeys(getNextDelimiterBlockKey(endBlock, blockMap), blockMap));\n  }\n\n  var characterList = void 0;\n\n  if (startBlock === endBlock) {\n    characterList = removeFromList(startBlock.getCharacterList(), startOffset, endOffset);\n  } else {\n    characterList = startBlock.getCharacterList().slice(0, startOffset).concat(endBlock.getCharacterList().slice(endOffset));\n  }\n\n  var modifiedStart = startBlock.merge({\n    text: startBlock.getText().slice(0, startOffset) + endBlock.getText().slice(endOffset),\n    characterList: characterList\n  });\n\n  var newBlocks = blockMap.toSeq().skipUntil(function (_, k) {\n    return k === startKey;\n  }).takeUntil(function (_, k) {\n    return k === endKey;\n  }).filter(function (_, k) {\n    return parentAncestors.indexOf(k) === -1;\n  }).concat(Map([[endKey, null]])).map(function (_, k) {\n    return k === startKey ? modifiedStart : null;\n  });\n\n  var updatedBlockMap = blockMap.merge(newBlocks).filter(function (block) {\n    return !!block;\n  });\n\n  if (isExperimentalTreeBlock) {\n    updatedBlockMap = updateBlockMapLinks(updatedBlockMap, startBlock, endBlock, blockMap);\n  }\n\n  return contentState.merge({\n    blockMap: updatedBlockMap,\n    selectionBefore: selectionState,\n    selectionAfter: selectionState.merge({\n      anchorKey: startKey,\n      anchorOffset: startOffset,\n      focusKey: startKey,\n      focusOffset: startOffset,\n      isBackward: false\n    })\n  });\n};\n\n/**\n * Maintain persistence for target list when removing characters on the\n * head and tail of the character list.\n */\nvar removeFromList = function removeFromList(targetList, startOffset, endOffset) {\n  if (startOffset === 0) {\n    while (startOffset < endOffset) {\n      targetList = targetList.shift();\n      startOffset++;\n    }\n  } else if (endOffset === targetList.count()) {\n    while (endOffset > startOffset) {\n      targetList = targetList.pop();\n      endOffset--;\n    }\n  } else {\n    var head = targetList.slice(0, startOffset);\n    var tail = targetList.slice(endOffset);\n    targetList = head.concat(tail).toList();\n  }\n  return targetList;\n};\n\nmodule.exports = removeRangeFromContentState;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ContentBlock\n * @format\n * \n */\n\n'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar CharacterMetadata = require('./CharacterMetadata');\nvar Immutable = require('immutable');\n\nvar findRangesImmutable = require('./findRangesImmutable');\n\nvar List = Immutable.List,\n    Map = Immutable.Map,\n    OrderedSet = Immutable.OrderedSet,\n    Record = Immutable.Record,\n    Repeat = Immutable.Repeat;\n\n\nvar EMPTY_SET = OrderedSet();\n\nvar defaultRecord = {\n  key: '',\n  type: 'unstyled',\n  text: '',\n  characterList: List(),\n  depth: 0,\n  data: Map()\n};\n\nvar ContentBlockRecord = Record(defaultRecord);\n\nvar decorateCharacterList = function decorateCharacterList(config) {\n  if (!config) {\n    return config;\n  }\n\n  var characterList = config.characterList,\n      text = config.text;\n\n\n  if (text && !characterList) {\n    config.characterList = List(Repeat(CharacterMetadata.EMPTY, text.length));\n  }\n\n  return config;\n};\n\nvar ContentBlock = function (_ContentBlockRecord) {\n  _inherits(ContentBlock, _ContentBlockRecord);\n\n  function ContentBlock(config) {\n    _classCallCheck(this, ContentBlock);\n\n    return _possibleConstructorReturn(this, _ContentBlockRecord.call(this, decorateCharacterList(config)));\n  }\n\n  ContentBlock.prototype.getKey = function getKey() {\n    return this.get('key');\n  };\n\n  ContentBlock.prototype.getType = function getType() {\n    return this.get('type');\n  };\n\n  ContentBlock.prototype.getText = function getText() {\n    return this.get('text');\n  };\n\n  ContentBlock.prototype.getCharacterList = function getCharacterList() {\n    return this.get('characterList');\n  };\n\n  ContentBlock.prototype.getLength = function getLength() {\n    return this.getText().length;\n  };\n\n  ContentBlock.prototype.getDepth = function getDepth() {\n    return this.get('depth');\n  };\n\n  ContentBlock.prototype.getData = function getData() {\n    return this.get('data');\n  };\n\n  ContentBlock.prototype.getInlineStyleAt = function getInlineStyleAt(offset) {\n    var character = this.getCharacterList().get(offset);\n    return character ? character.getStyle() : EMPTY_SET;\n  };\n\n  ContentBlock.prototype.getEntityAt = function getEntityAt(offset) {\n    var character = this.getCharacterList().get(offset);\n    return character ? character.getEntity() : null;\n  };\n\n  /**\n   * Execute a callback for every contiguous range of styles within the block.\n   */\n\n\n  ContentBlock.prototype.findStyleRanges = function findStyleRanges(filterFn, callback) {\n    findRangesImmutable(this.getCharacterList(), haveEqualStyle, filterFn, callback);\n  };\n\n  /**\n   * Execute a callback for every contiguous range of entities within the block.\n   */\n\n\n  ContentBlock.prototype.findEntityRanges = function findEntityRanges(filterFn, callback) {\n    findRangesImmutable(this.getCharacterList(), haveEqualEntity, filterFn, callback);\n  };\n\n  return ContentBlock;\n}(ContentBlockRecord);\n\nfunction haveEqualStyle(charA, charB) {\n  return charA.getStyle() === charB.getStyle();\n}\n\nfunction haveEqualEntity(charA, charB) {\n  return charA.getEntity() === charB.getEntity();\n}\n\nmodule.exports = ContentBlock;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule editOnCopy\n * @format\n * \n */\n\n'use strict';\n\nvar getFragmentFromSelection = require('./getFragmentFromSelection');\n\n/**\n * If we have a selection, create a ContentState fragment and store\n * it in our internal clipboard. Subsequent paste events will use this\n * fragment if no external clipboard data is supplied.\n */\nfunction editOnCopy(editor, e) {\n  var editorState = editor._latestEditorState;\n  var selection = editorState.getSelection();\n\n  // No selection, so there's nothing to copy.\n  if (selection.isCollapsed()) {\n    e.preventDefault();\n    return;\n  }\n\n  editor.setClipboard(getFragmentFromSelection(editor._latestEditorState));\n}\n\nmodule.exports = editOnCopy;","'use strict';\n\nvar _assign = require('object-assign');\n\nvar _extends = _assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DraftEntity\n * @format\n * \n */\n\nvar DraftEntityInstance = require('./DraftEntityInstance');\nvar Immutable = require('immutable');\n\nvar invariant = require('fbjs/lib/invariant');\n\nvar Map = Immutable.Map;\n\n\nvar instances = Map();\nvar instanceKey = 0;\n\n/**\n * Temporary utility for generating the warnings\n */\nfunction logWarning(oldMethodCall, newMethodCall) {\n  console.warn('WARNING: ' + oldMethodCall + ' will be deprecated soon!\\nPlease use \"' + newMethodCall + '\" instead.');\n}\n\n/**\n * A \"document entity\" is an object containing metadata associated with a\n * piece of text in a ContentBlock.\n *\n * For example, a `link` entity might include a `uri` property. When a\n * ContentBlock is rendered in the browser, text that refers to that link\n * entity may be rendered as an anchor, with the `uri` as the href value.\n *\n * In a ContentBlock, every position in the text may correspond to zero\n * or one entities. This correspondence is tracked using a key string,\n * generated via DraftEntity.create() and used to obtain entity metadata\n * via DraftEntity.get().\n */\nvar DraftEntity = {\n  /**\n   * WARNING: This method will be deprecated soon!\n   * Please use 'contentState.getLastCreatedEntityKey' instead.\n   * ---\n   * Get the random key string from whatever entity was last created.\n   * We need this to support the new API, as part of transitioning to put Entity\n   * storage in contentState.\n   */\n  getLastCreatedEntityKey: function getLastCreatedEntityKey() {\n    logWarning('DraftEntity.getLastCreatedEntityKey', 'contentState.getLastCreatedEntityKey');\n    return DraftEntity.__getLastCreatedEntityKey();\n  },\n\n  /**\n   * WARNING: This method will be deprecated soon!\n   * Please use 'contentState.createEntity' instead.\n   * ---\n   * Create a DraftEntityInstance and store it for later retrieval.\n   *\n   * A random key string will be generated and returned. This key may\n   * be used to track the entity's usage in a ContentBlock, and for\n   * retrieving data about the entity at render time.\n   */\n  create: function create(type, mutability, data) {\n    logWarning('DraftEntity.create', 'contentState.createEntity');\n    return DraftEntity.__create(type, mutability, data);\n  },\n\n  /**\n   * WARNING: This method will be deprecated soon!\n   * Please use 'contentState.addEntity' instead.\n   * ---\n   * Add an existing DraftEntityInstance to the DraftEntity map. This is\n   * useful when restoring instances from the server.\n   */\n  add: function add(instance) {\n    logWarning('DraftEntity.add', 'contentState.addEntity');\n    return DraftEntity.__add(instance);\n  },\n\n  /**\n   * WARNING: This method will be deprecated soon!\n   * Please use 'contentState.getEntity' instead.\n   * ---\n   * Retrieve the entity corresponding to the supplied key string.\n   */\n  get: function get(key) {\n    logWarning('DraftEntity.get', 'contentState.getEntity');\n    return DraftEntity.__get(key);\n  },\n\n  /**\n   * WARNING: This method will be deprecated soon!\n   * Please use 'contentState.mergeEntityData' instead.\n   * ---\n   * Entity instances are immutable. If you need to update the data for an\n   * instance, this method will merge your data updates and return a new\n   * instance.\n   */\n  mergeData: function mergeData(key, toMerge) {\n    logWarning('DraftEntity.mergeData', 'contentState.mergeEntityData');\n    return DraftEntity.__mergeData(key, toMerge);\n  },\n\n  /**\n   * WARNING: This method will be deprecated soon!\n   * Please use 'contentState.replaceEntityData' instead.\n   * ---\n   * Completely replace the data for a given instance.\n   */\n  replaceData: function replaceData(key, newData) {\n    logWarning('DraftEntity.replaceData', 'contentState.replaceEntityData');\n    return DraftEntity.__replaceData(key, newData);\n  },\n\n  // ***********************************WARNING******************************\n  // --- the above public API will be deprecated in the next version of Draft!\n  // The methods below this line are private - don't call them directly.\n\n  /**\n   * Get the random key string from whatever entity was last created.\n   * We need this to support the new API, as part of transitioning to put Entity\n   * storage in contentState.\n   */\n  __getLastCreatedEntityKey: function __getLastCreatedEntityKey() {\n    return '' + instanceKey;\n  },\n\n  /**\n   * Create a DraftEntityInstance and store it for later retrieval.\n   *\n   * A random key string will be generated and returned. This key may\n   * be used to track the entity's usage in a ContentBlock, and for\n   * retrieving data about the entity at render time.\n   */\n  __create: function __create(type, mutability, data) {\n    return DraftEntity.__add(new DraftEntityInstance({ type: type, mutability: mutability, data: data || {} }));\n  },\n\n  /**\n   * Add an existing DraftEntityInstance to the DraftEntity map. This is\n   * useful when restoring instances from the server.\n   */\n  __add: function __add(instance) {\n    var key = '' + ++instanceKey;\n    instances = instances.set(key, instance);\n    return key;\n  },\n\n  /**\n   * Retrieve the entity corresponding to the supplied key string.\n   */\n  __get: function __get(key) {\n    var instance = instances.get(key);\n    !!!instance ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unknown DraftEntity key: %s.', key) : invariant(false) : void 0;\n    return instance;\n  },\n\n  /**\n   * Entity instances are immutable. If you need to update the data for an\n   * instance, this method will merge your data updates and return a new\n   * instance.\n   */\n  __mergeData: function __mergeData(key, toMerge) {\n    var instance = DraftEntity.__get(key);\n    var newData = _extends({}, instance.getData(), toMerge);\n    var newInstance = instance.set('data', newData);\n    instances = instances.set(key, newInstance);\n    return newInstance;\n  },\n\n  /**\n   * Completely replace the data for a given instance.\n   */\n  __replaceData: function __replaceData(key, newData) {\n    var instance = DraftEntity.__get(key);\n    var newInstance = instance.set('data', newData);\n    instances = instances.set(key, newInstance);\n    return newInstance;\n  }\n};\n\nmodule.exports = DraftEntity;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule keyCommandMoveSelectionToEndOfBlock\n * @format\n * \n */\n\n'use strict';\n\nvar EditorState = require('./EditorState');\n\n/**\n * See comment for `moveSelectionToStartOfBlock`.\n */\nfunction keyCommandMoveSelectionToEndOfBlock(editorState) {\n  var selection = editorState.getSelection();\n  var endKey = selection.getEndKey();\n  var content = editorState.getCurrentContent();\n  var textLength = content.getBlockForKey(endKey).getLength();\n  return EditorState.set(editorState, {\n    selection: selection.merge({\n      anchorKey: endKey,\n      anchorOffset: textLength,\n      focusKey: endKey,\n      focusOffset: textLength,\n      isBackward: false\n    }),\n    forceSelection: true\n  });\n}\n\nmodule.exports = keyCommandMoveSelectionToEndOfBlock;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getDraftEditorSelectionWithNodes\n * @format\n * \n */\n\n'use strict';\n\nvar findAncestorOffsetKey = require('./findAncestorOffsetKey');\nvar getSelectionOffsetKeyForNode = require('./getSelectionOffsetKeyForNode');\nvar getUpdatedSelectionState = require('./getUpdatedSelectionState');\nvar invariant = require('fbjs/lib/invariant');\nvar nullthrows = require('fbjs/lib/nullthrows');\n\n/**\n * Convert the current selection range to an anchor/focus pair of offset keys\n * and values that can be interpreted by components.\n */\nfunction getDraftEditorSelectionWithNodes(editorState, root, anchorNode, anchorOffset, focusNode, focusOffset) {\n  var anchorIsTextNode = anchorNode.nodeType === Node.TEXT_NODE;\n  var focusIsTextNode = focusNode.nodeType === Node.TEXT_NODE;\n\n  // If the selection range lies only on text nodes, the task is simple.\n  // Find the nearest offset-aware elements and use the\n  // offset values supplied by the selection range.\n  if (anchorIsTextNode && focusIsTextNode) {\n    return {\n      selectionState: getUpdatedSelectionState(editorState, nullthrows(findAncestorOffsetKey(anchorNode)), anchorOffset, nullthrows(findAncestorOffsetKey(focusNode)), focusOffset),\n      needsRecovery: false\n    };\n  }\n\n  var anchorPoint = null;\n  var focusPoint = null;\n  var needsRecovery = true;\n\n  // An element is selected. Convert this selection range into leaf offset\n  // keys and offset values for consumption at the component level. This\n  // is common in Firefox, where select-all and triple click behavior leads\n  // to entire elements being selected.\n  //\n  // Note that we use the `needsRecovery` parameter in the callback here. This\n  // is because when certain elements are selected, the behavior for subsequent\n  // cursor movement (e.g. via arrow keys) is uncertain and may not match\n  // expectations at the component level. For example, if an entire <div> is\n  // selected and the user presses the right arrow, Firefox keeps the selection\n  // on the <div>. If we allow subsequent keypresses to insert characters\n  // natively, they will be inserted into a browser-created text node to the\n  // right of that <div>. This is obviously undesirable.\n  //\n  // With the `needsRecovery` flag, we inform the caller that it is responsible\n  // for manually setting the selection state on the rendered document to\n  // ensure proper selection state maintenance.\n\n  if (anchorIsTextNode) {\n    anchorPoint = {\n      key: nullthrows(findAncestorOffsetKey(anchorNode)),\n      offset: anchorOffset\n    };\n    focusPoint = getPointForNonTextNode(root, focusNode, focusOffset);\n  } else if (focusIsTextNode) {\n    focusPoint = {\n      key: nullthrows(findAncestorOffsetKey(focusNode)),\n      offset: focusOffset\n    };\n    anchorPoint = getPointForNonTextNode(root, anchorNode, anchorOffset);\n  } else {\n    anchorPoint = getPointForNonTextNode(root, anchorNode, anchorOffset);\n    focusPoint = getPointForNonTextNode(root, focusNode, focusOffset);\n\n    // If the selection is collapsed on an empty block, don't force recovery.\n    // This way, on arrow key selection changes, the browser can move the\n    // cursor from a non-zero offset on one block, through empty blocks,\n    // to a matching non-zero offset on other text blocks.\n    if (anchorNode === focusNode && anchorOffset === focusOffset) {\n      needsRecovery = !!anchorNode.firstChild && anchorNode.firstChild.nodeName !== 'BR';\n    }\n  }\n\n  return {\n    selectionState: getUpdatedSelectionState(editorState, anchorPoint.key, anchorPoint.offset, focusPoint.key, focusPoint.offset),\n    needsRecovery: needsRecovery\n  };\n}\n\n/**\n * Identify the first leaf descendant for the given node.\n */\nfunction getFirstLeaf(node) {\n  while (node.firstChild && (\n  // data-blocks has no offset\n  node.firstChild instanceof Element && node.firstChild.getAttribute('data-blocks') === 'true' || getSelectionOffsetKeyForNode(node.firstChild))) {\n    node = node.firstChild;\n  }\n  return node;\n}\n\n/**\n * Identify the last leaf descendant for the given node.\n */\nfunction getLastLeaf(node) {\n  while (node.lastChild && (\n  // data-blocks has no offset\n  node.lastChild instanceof Element && node.lastChild.getAttribute('data-blocks') === 'true' || getSelectionOffsetKeyForNode(node.lastChild))) {\n    node = node.lastChild;\n  }\n  return node;\n}\n\nfunction getPointForNonTextNode(editorRoot, startNode, childOffset) {\n  var node = startNode;\n  var offsetKey = findAncestorOffsetKey(node);\n\n  !(offsetKey != null || editorRoot && (editorRoot === node || editorRoot.firstChild === node)) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Unknown node in selection range.') : invariant(false) : void 0;\n\n  // If the editorRoot is the selection, step downward into the content\n  // wrapper.\n  if (editorRoot === node) {\n    node = node.firstChild;\n    !(node instanceof Element && node.getAttribute('data-contents') === 'true') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Invalid DraftEditorContents structure.') : invariant(false) : void 0;\n    if (childOffset > 0) {\n      childOffset = node.childNodes.length;\n    }\n  }\n\n  // If the child offset is zero and we have an offset key, we're done.\n  // If there's no offset key because the entire editor is selected,\n  // find the leftmost (\"first\") leaf in the tree and use that as the offset\n  // key.\n  if (childOffset === 0) {\n    var key = null;\n    if (offsetKey != null) {\n      key = offsetKey;\n    } else {\n      var firstLeaf = getFirstLeaf(node);\n      key = nullthrows(getSelectionOffsetKeyForNode(firstLeaf));\n    }\n    return { key: key, offset: 0 };\n  }\n\n  var nodeBeforeCursor = node.childNodes[childOffset - 1];\n  var leafKey = null;\n  var textLength = null;\n\n  if (!getSelectionOffsetKeyForNode(nodeBeforeCursor)) {\n    // Our target node may be a leaf or a text node, in which case we're\n    // already where we want to be and can just use the child's length as\n    // our offset.\n    leafKey = nullthrows(offsetKey);\n    textLength = getTextContentLength(nodeBeforeCursor);\n  } else {\n    // Otherwise, we'll look at the child to the left of the cursor and find\n    // the last leaf node in its subtree.\n    var lastLeaf = getLastLeaf(nodeBeforeCursor);\n    leafKey = nullthrows(getSelectionOffsetKeyForNode(lastLeaf));\n    textLength = getTextContentLength(lastLeaf);\n  }\n\n  return {\n    key: leafKey,\n    offset: textLength\n  };\n}\n\n/**\n * Return the length of a node's textContent, regarding single newline\n * characters as zero-length. This allows us to avoid problems with identifying\n * the correct selection offset for empty blocks in IE, in which we\n * render newlines instead of break tags.\n */\nfunction getTextContentLength(node) {\n  var textContent = node.textContent;\n  return textContent === '\\n' ? 0 : textContent.length;\n}\n\nmodule.exports = getDraftEditorSelectionWithNodes;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getFragmentFromSelection\n * @format\n * \n */\n\n'use strict';\n\nvar getContentStateFragment = require('./getContentStateFragment');\n\nfunction getFragmentFromSelection(editorState) {\n  var selectionState = editorState.getSelection();\n\n  if (selectionState.isCollapsed()) {\n    return null;\n  }\n\n  return getContentStateFragment(editorState.getCurrentContent(), selectionState);\n}\n\nmodule.exports = getFragmentFromSelection;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DraftStringKey\n * @format\n * \n */\n\n'use strict';\n\nvar DraftStringKey = {\n  stringify: function stringify(key) {\n    return '_' + String(key);\n  },\n\n  unstringify: function unstringify(key) {\n    return key.slice(1);\n  }\n};\n\nmodule.exports = DraftStringKey;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule keyCommandBackspaceToStartOfLine\n * @format\n * \n */\n\n'use strict';\n\nvar EditorState = require('./EditorState');\n\nvar expandRangeToStartOfLine = require('./expandRangeToStartOfLine');\nvar getDraftEditorSelectionWithNodes = require('./getDraftEditorSelectionWithNodes');\nvar moveSelectionBackward = require('./moveSelectionBackward');\nvar removeTextWithStrategy = require('./removeTextWithStrategy');\n\nfunction keyCommandBackspaceToStartOfLine(editorState) {\n  var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n    var selection = strategyState.getSelection();\n    if (selection.isCollapsed() && selection.getAnchorOffset() === 0) {\n      return moveSelectionBackward(strategyState, 1);\n    }\n\n    var domSelection = global.getSelection();\n    var range = domSelection.getRangeAt(0);\n    range = expandRangeToStartOfLine(range);\n\n    return getDraftEditorSelectionWithNodes(strategyState, null, range.endContainer, range.endOffset, range.startContainer, range.startOffset).selectionState;\n  }, 'backward');\n\n  if (afterRemoval === editorState.getCurrentContent()) {\n    return editorState;\n  }\n\n  return EditorState.push(editorState, afterRemoval, 'remove-range');\n}\n\nmodule.exports = keyCommandBackspaceToStartOfLine;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getCharacterRemovalRange\n * @format\n * \n */\n\n'use strict';\n\nvar DraftEntitySegments = require('./DraftEntitySegments');\n\nvar getRangesForDraftEntity = require('./getRangesForDraftEntity');\nvar invariant = require('fbjs/lib/invariant');\n\n/**\n * Given a SelectionState and a removal direction, determine the entire range\n * that should be removed from a ContentState. This is based on any entities\n * within the target, with their `mutability` values taken into account.\n *\n * For instance, if we are attempting to remove part of an \"immutable\" entity\n * range, the entire entity must be removed. The returned `SelectionState`\n * will be adjusted accordingly.\n */\nfunction getCharacterRemovalRange(entityMap, startBlock, endBlock, selectionState, direction) {\n  var start = selectionState.getStartOffset();\n  var end = selectionState.getEndOffset();\n  var startEntityKey = startBlock.getEntityAt(start);\n  var endEntityKey = endBlock.getEntityAt(end - 1);\n  if (!startEntityKey && !endEntityKey) {\n    return selectionState;\n  }\n  var newSelectionState = selectionState;\n  if (startEntityKey && startEntityKey === endEntityKey) {\n    newSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, true, true);\n  } else if (startEntityKey && endEntityKey) {\n    var startSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, false, true);\n    var endSelectionState = getEntityRemovalRange(entityMap, endBlock, newSelectionState, direction, endEntityKey, false, false);\n    newSelectionState = newSelectionState.merge({\n      anchorOffset: startSelectionState.getAnchorOffset(),\n      focusOffset: endSelectionState.getFocusOffset(),\n      isBackward: false\n    });\n  } else if (startEntityKey) {\n    var _startSelectionState = getEntityRemovalRange(entityMap, startBlock, newSelectionState, direction, startEntityKey, false, true);\n    newSelectionState = newSelectionState.merge({\n      anchorOffset: _startSelectionState.getStartOffset(),\n      isBackward: false\n    });\n  } else if (endEntityKey) {\n    var _endSelectionState = getEntityRemovalRange(entityMap, endBlock, newSelectionState, direction, endEntityKey, false, false);\n    newSelectionState = newSelectionState.merge({\n      focusOffset: _endSelectionState.getEndOffset(),\n      isBackward: false\n    });\n  }\n  return newSelectionState;\n}\n\nfunction getEntityRemovalRange(entityMap, block, selectionState, direction, entityKey, isEntireSelectionWithinEntity, isEntityAtStart) {\n  var start = selectionState.getStartOffset();\n  var end = selectionState.getEndOffset();\n  var entity = entityMap.__get(entityKey);\n  var mutability = entity.getMutability();\n  var sideToConsider = isEntityAtStart ? start : end;\n\n  // `MUTABLE` entities can just have the specified range of text removed\n  // directly. No adjustments are needed.\n  if (mutability === 'MUTABLE') {\n    return selectionState;\n  }\n\n  // Find the entity range that overlaps with our removal range.\n  var entityRanges = getRangesForDraftEntity(block, entityKey).filter(function (range) {\n    return sideToConsider <= range.end && sideToConsider >= range.start;\n  });\n\n  !(entityRanges.length == 1) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'There should only be one entity range within this removal range.') : invariant(false) : void 0;\n\n  var entityRange = entityRanges[0];\n\n  // For `IMMUTABLE` entity types, we will remove the entire entity range.\n  if (mutability === 'IMMUTABLE') {\n    return selectionState.merge({\n      anchorOffset: entityRange.start,\n      focusOffset: entityRange.end,\n      isBackward: false\n    });\n  }\n\n  // For `SEGMENTED` entity types, determine the appropriate segment to\n  // remove.\n  if (!isEntireSelectionWithinEntity) {\n    if (isEntityAtStart) {\n      end = entityRange.end;\n    } else {\n      start = entityRange.start;\n    }\n  }\n\n  var removalRange = DraftEntitySegments.getRemovalRange(start, end, block.getText().slice(entityRange.start, entityRange.end), entityRange.start, direction);\n\n  return selectionState.merge({\n    anchorOffset: removalRange.start,\n    focusOffset: removalRange.end,\n    isBackward: false\n  });\n}\n\nmodule.exports = getCharacterRemovalRange;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule convertFromRawToDraftState\n * @format\n * \n */\n\n'use strict';\n\nvar _assign = require('object-assign');\n\nvar _extends = _assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar ContentBlock = require('./ContentBlock');\nvar ContentBlockNode = require('./ContentBlockNode');\nvar ContentState = require('./ContentState');\nvar DraftEntity = require('./DraftEntity');\nvar DraftFeatureFlags = require('./DraftFeatureFlags');\nvar DraftTreeAdapter = require('./DraftTreeAdapter');\nvar Immutable = require('immutable');\nvar SelectionState = require('./SelectionState');\n\nvar createCharacterList = require('./createCharacterList');\nvar decodeEntityRanges = require('./decodeEntityRanges');\nvar decodeInlineStyleRanges = require('./decodeInlineStyleRanges');\nvar generateRandomKey = require('./generateRandomKey');\nvar invariant = require('fbjs/lib/invariant');\n\nvar experimentalTreeDataSupport = DraftFeatureFlags.draft_tree_data_support;\n\nvar List = Immutable.List,\n    Map = Immutable.Map,\n    OrderedMap = Immutable.OrderedMap;\n\n\nvar decodeBlockNodeConfig = function decodeBlockNodeConfig(block, entityMap) {\n  var key = block.key,\n      type = block.type,\n      data = block.data,\n      text = block.text,\n      depth = block.depth;\n\n\n  var blockNodeConfig = {\n    text: text,\n    depth: depth || 0,\n    type: type || 'unstyled',\n    key: key || generateRandomKey(),\n    data: Map(data),\n    characterList: decodeCharacterList(block, entityMap)\n  };\n\n  return blockNodeConfig;\n};\n\nvar decodeCharacterList = function decodeCharacterList(block, entityMap) {\n  var text = block.text,\n      rawEntityRanges = block.entityRanges,\n      rawInlineStyleRanges = block.inlineStyleRanges;\n\n\n  var entityRanges = rawEntityRanges || [];\n  var inlineStyleRanges = rawInlineStyleRanges || [];\n\n  // Translate entity range keys to the DraftEntity map.\n  return createCharacterList(decodeInlineStyleRanges(text, inlineStyleRanges), decodeEntityRanges(text, entityRanges.filter(function (range) {\n    return entityMap.hasOwnProperty(range.key);\n  }).map(function (range) {\n    return _extends({}, range, { key: entityMap[range.key] });\n  })));\n};\n\nvar addKeyIfMissing = function addKeyIfMissing(block) {\n  return _extends({}, block, {\n    key: block.key || generateRandomKey()\n  });\n};\n\n/**\n * Node stack is responsible to ensure we traverse the tree only once\n * in depth order, while also providing parent refs to inner nodes to\n * construct their links.\n */\nvar updateNodeStack = function updateNodeStack(stack, nodes, parentRef) {\n  var nodesWithParentRef = nodes.map(function (block) {\n    return _extends({}, block, {\n      parentRef: parentRef\n    });\n  });\n\n  // since we pop nodes from the stack we need to insert them in reverse\n  return stack.concat(nodesWithParentRef.reverse());\n};\n\n/**\n * This will build a tree draft content state by creating the node\n * reference links into a single tree walk. Each node has a link\n * reference to \"parent\", \"children\", \"nextSibling\" and \"prevSibling\"\n * blockMap will be created using depth ordering.\n */\nvar decodeContentBlockNodes = function decodeContentBlockNodes(blocks, entityMap) {\n  return blocks\n  // ensure children have valid keys to enable sibling links\n  .map(addKeyIfMissing).reduce(function (blockMap, block, index) {\n    !Array.isArray(block.children) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'invalid RawDraftContentBlock can not be converted to ContentBlockNode') : invariant(false) : void 0;\n\n    // ensure children have valid keys to enable sibling links\n    var children = block.children.map(addKeyIfMissing);\n\n    // root level nodes\n    var contentBlockNode = new ContentBlockNode(_extends({}, decodeBlockNodeConfig(block, entityMap), {\n      prevSibling: index === 0 ? null : blocks[index - 1].key,\n      nextSibling: index === blocks.length - 1 ? null : blocks[index + 1].key,\n      children: List(children.map(function (child) {\n        return child.key;\n      }))\n    }));\n\n    // push root node to blockMap\n    blockMap = blockMap.set(contentBlockNode.getKey(), contentBlockNode);\n\n    // this stack is used to ensure we visit all nodes respecting depth ordering\n    var stack = updateNodeStack([], children, contentBlockNode);\n\n    // start computing children nodes\n    while (stack.length > 0) {\n      // we pop from the stack and start processing this node\n      var node = stack.pop();\n\n      // parentRef already points to a converted ContentBlockNode\n      var parentRef = node.parentRef;\n      var siblings = parentRef.getChildKeys();\n      var _index = siblings.indexOf(node.key);\n      var isValidBlock = Array.isArray(node.children);\n\n      if (!isValidBlock) {\n        !isValidBlock ? process.env.NODE_ENV !== 'production' ? invariant(false, 'invalid RawDraftContentBlock can not be converted to ContentBlockNode') : invariant(false) : void 0;\n        break;\n      }\n\n      // ensure children have valid keys to enable sibling links\n      var _children = node.children.map(addKeyIfMissing);\n\n      var _contentBlockNode = new ContentBlockNode(_extends({}, decodeBlockNodeConfig(node, entityMap), {\n        parent: parentRef.getKey(),\n        children: List(_children.map(function (child) {\n          return child.key;\n        })),\n        prevSibling: _index === 0 ? null : siblings.get(_index - 1),\n        nextSibling: _index === siblings.size - 1 ? null : siblings.get(_index + 1)\n      }));\n\n      // push node to blockMap\n      blockMap = blockMap.set(_contentBlockNode.getKey(), _contentBlockNode);\n\n      // this stack is used to ensure we visit all nodes respecting depth ordering\n      stack = updateNodeStack(stack, _children, _contentBlockNode);\n    }\n\n    return blockMap;\n  }, OrderedMap());\n};\n\nvar decodeContentBlocks = function decodeContentBlocks(blocks, entityMap) {\n  return OrderedMap(blocks.map(function (block) {\n    var contentBlock = new ContentBlock(decodeBlockNodeConfig(block, entityMap));\n    return [contentBlock.getKey(), contentBlock];\n  }));\n};\n\nvar decodeRawBlocks = function decodeRawBlocks(rawState, entityMap) {\n  var isTreeRawBlock = Array.isArray(rawState.blocks[0].children);\n  var rawBlocks = experimentalTreeDataSupport && !isTreeRawBlock ? DraftTreeAdapter.fromRawStateToRawTreeState(rawState).blocks : rawState.blocks;\n\n  if (!experimentalTreeDataSupport) {\n    return decodeContentBlocks(isTreeRawBlock ? DraftTreeAdapter.fromRawTreeStateToRawState(rawState).blocks : rawBlocks, entityMap);\n  }\n\n  return decodeContentBlockNodes(rawBlocks, entityMap);\n};\n\nvar decodeRawEntityMap = function decodeRawEntityMap(rawState) {\n  var rawEntityMap = rawState.entityMap;\n\n  var entityMap = {};\n\n  // TODO: Update this once we completely remove DraftEntity\n  Object.keys(rawEntityMap).forEach(function (rawEntityKey) {\n    var _rawEntityMap$rawEnti = rawEntityMap[rawEntityKey],\n        type = _rawEntityMap$rawEnti.type,\n        mutability = _rawEntityMap$rawEnti.mutability,\n        data = _rawEntityMap$rawEnti.data;\n\n    // get the key reference to created entity\n\n    entityMap[rawEntityKey] = DraftEntity.__create(type, mutability, data || {});\n  });\n\n  return entityMap;\n};\n\nvar convertFromRawToDraftState = function convertFromRawToDraftState(rawState) {\n  !Array.isArray(rawState.blocks) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'invalid RawDraftContentState') : invariant(false) : void 0;\n\n  // decode entities\n  var entityMap = decodeRawEntityMap(rawState);\n\n  // decode blockMap\n  var blockMap = decodeRawBlocks(rawState, entityMap);\n\n  // create initial selection\n  var selectionState = blockMap.isEmpty() ? new SelectionState() : SelectionState.createEmpty(blockMap.first().getKey());\n\n  return new ContentState({\n    blockMap: blockMap,\n    entityMap: entityMap,\n    selectionBefore: selectionState,\n    selectionAfter: selectionState\n  });\n};\n\nmodule.exports = convertFromRawToDraftState;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule moveSelectionBackward\n * @format\n * \n */\n\n'use strict';\n\n/**\n * Given a collapsed selection, move the focus `maxDistance` backward within\n * the selected block. If the selection will go beyond the start of the block,\n * move focus to the end of the previous block, but no further.\n *\n * This function is not Unicode-aware, so surrogate pairs will be treated\n * as having length 2.\n */\nfunction moveSelectionBackward(editorState, maxDistance) {\n  var selection = editorState.getSelection();\n  var content = editorState.getCurrentContent();\n  var key = selection.getStartKey();\n  var offset = selection.getStartOffset();\n\n  var focusKey = key;\n  var focusOffset = 0;\n\n  if (maxDistance > offset) {\n    var keyBefore = content.getKeyBefore(key);\n    if (keyBefore == null) {\n      focusKey = key;\n    } else {\n      focusKey = keyBefore;\n      var blockBefore = content.getBlockForKey(keyBefore);\n      focusOffset = blockBefore.getText().length;\n    }\n  } else {\n    focusOffset = offset - maxDistance;\n  }\n\n  return selection.merge({\n    focusKey: focusKey,\n    focusOffset: focusOffset,\n    isBackward: true\n  });\n}\n\nmodule.exports = moveSelectionBackward;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule keyCommandPlainDelete\n * @format\n * \n */\n\n'use strict';\n\nvar EditorState = require('./EditorState');\nvar UnicodeUtils = require('fbjs/lib/UnicodeUtils');\n\nvar moveSelectionForward = require('./moveSelectionForward');\nvar removeTextWithStrategy = require('./removeTextWithStrategy');\n\n/**\n * Remove the selected range. If the cursor is collapsed, remove the following\n * character. This operation is Unicode-aware, so removing a single character\n * will remove a surrogate pair properly as well.\n */\nfunction keyCommandPlainDelete(editorState) {\n  var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n    var selection = strategyState.getSelection();\n    var content = strategyState.getCurrentContent();\n    var key = selection.getAnchorKey();\n    var offset = selection.getAnchorOffset();\n    var charAhead = content.getBlockForKey(key).getText()[offset];\n    return moveSelectionForward(strategyState, charAhead ? UnicodeUtils.getUTF16Length(charAhead, 0) : 1);\n  }, 'forward');\n\n  if (afterRemoval === editorState.getCurrentContent()) {\n    return editorState;\n  }\n\n  var selection = editorState.getSelection();\n\n  return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'delete-character' : 'remove-range');\n}\n\nmodule.exports = keyCommandPlainDelete;","/**\n *  Copyright (c) 2014-2015, Facebook, Inc.\n *  All rights reserved.\n *\n *  This source code is licensed under the BSD-style license found in the\n *  LICENSE file in the root directory of this source tree. An additional grant\n *  of patent rights can be found in the PATENTS file in the same directory.\n */\n\n(function (global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :\n  typeof define === 'function' && define.amd ? define(factory) :\n  global.Immutable = factory();\n}(this, function () { 'use strict';var SLICE$0 = Array.prototype.slice;\n\n  function createClass(ctor, superClass) {\n    if (superClass) {\n      ctor.prototype = Object.create(superClass.prototype);\n    }\n    ctor.prototype.constructor = ctor;\n  }\n\n  function Iterable(value) {\n      return isIterable(value) ? value : Seq(value);\n    }\n\n\n  createClass(KeyedIterable, Iterable);\n    function KeyedIterable(value) {\n      return isKeyed(value) ? value : KeyedSeq(value);\n    }\n\n\n  createClass(IndexedIterable, Iterable);\n    function IndexedIterable(value) {\n      return isIndexed(value) ? value : IndexedSeq(value);\n    }\n\n\n  createClass(SetIterable, Iterable);\n    function SetIterable(value) {\n      return isIterable(value) && !isAssociative(value) ? value : SetSeq(value);\n    }\n\n\n\n  function isIterable(maybeIterable) {\n    return !!(maybeIterable && maybeIterable[IS_ITERABLE_SENTINEL]);\n  }\n\n  function isKeyed(maybeKeyed) {\n    return !!(maybeKeyed && maybeKeyed[IS_KEYED_SENTINEL]);\n  }\n\n  function isIndexed(maybeIndexed) {\n    return !!(maybeIndexed && maybeIndexed[IS_INDEXED_SENTINEL]);\n  }\n\n  function isAssociative(maybeAssociative) {\n    return isKeyed(maybeAssociative) || isIndexed(maybeAssociative);\n  }\n\n  function isOrdered(maybeOrdered) {\n    return !!(maybeOrdered && maybeOrdered[IS_ORDERED_SENTINEL]);\n  }\n\n  Iterable.isIterable = isIterable;\n  Iterable.isKeyed = isKeyed;\n  Iterable.isIndexed = isIndexed;\n  Iterable.isAssociative = isAssociative;\n  Iterable.isOrdered = isOrdered;\n\n  Iterable.Keyed = KeyedIterable;\n  Iterable.Indexed = IndexedIterable;\n  Iterable.Set = SetIterable;\n\n\n  var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';\n  var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';\n  var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@';\n  var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';\n\n  // Used for setting prototype methods that IE8 chokes on.\n  var DELETE = 'delete';\n\n  // Constants describing the size of trie nodes.\n  var SHIFT = 5; // Resulted in best performance after ______?\n  var SIZE = 1 << SHIFT;\n  var MASK = SIZE - 1;\n\n  // A consistent shared value representing \"not set\" which equals nothing other\n  // than itself, and nothing that could be provided externally.\n  var NOT_SET = {};\n\n  // Boolean references, Rough equivalent of `bool &`.\n  var CHANGE_LENGTH = { value: false };\n  var DID_ALTER = { value: false };\n\n  function MakeRef(ref) {\n    ref.value = false;\n    return ref;\n  }\n\n  function SetRef(ref) {\n    ref && (ref.value = true);\n  }\n\n  // A function which returns a value representing an \"owner\" for transient writes\n  // to tries. The return value will only ever equal itself, and will not equal\n  // the return of any subsequent call of this function.\n  function OwnerID() {}\n\n  // http://jsperf.com/copy-array-inline\n  function arrCopy(arr, offset) {\n    offset = offset || 0;\n    var len = Math.max(0, arr.length - offset);\n    var newArr = new Array(len);\n    for (var ii = 0; ii < len; ii++) {\n      newArr[ii] = arr[ii + offset];\n    }\n    return newArr;\n  }\n\n  function ensureSize(iter) {\n    if (iter.size === undefined) {\n      iter.size = iter.__iterate(returnTrue);\n    }\n    return iter.size;\n  }\n\n  function wrapIndex(iter, index) {\n    // This implements \"is array index\" which the ECMAString spec defines as:\n    //\n    //     A String property name P is an array index if and only if\n    //     ToString(ToUint32(P)) is equal to P and ToUint32(P) is not equal\n    //     to 2^32−1.\n    //\n    // http://www.ecma-international.org/ecma-262/6.0/#sec-array-exotic-objects\n    if (typeof index !== 'number') {\n      var uint32Index = index >>> 0; // N >>> 0 is shorthand for ToUint32\n      if ('' + uint32Index !== index || uint32Index === 4294967295) {\n        return NaN;\n      }\n      index = uint32Index;\n    }\n    return index < 0 ? ensureSize(iter) + index : index;\n  }\n\n  function returnTrue() {\n    return true;\n  }\n\n  function wholeSlice(begin, end, size) {\n    return (begin === 0 || (size !== undefined && begin <= -size)) &&\n      (end === undefined || (size !== undefined && end >= size));\n  }\n\n  function resolveBegin(begin, size) {\n    return resolveIndex(begin, size, 0);\n  }\n\n  function resolveEnd(end, size) {\n    return resolveIndex(end, size, size);\n  }\n\n  function resolveIndex(index, size, defaultIndex) {\n    return index === undefined ?\n      defaultIndex :\n      index < 0 ?\n        Math.max(0, size + index) :\n        size === undefined ?\n          index :\n          Math.min(size, index);\n  }\n\n  /* global Symbol */\n\n  var ITERATE_KEYS = 0;\n  var ITERATE_VALUES = 1;\n  var ITERATE_ENTRIES = 2;\n\n  var REAL_ITERATOR_SYMBOL = typeof Symbol === 'function' && Symbol.iterator;\n  var FAUX_ITERATOR_SYMBOL = '@@iterator';\n\n  var ITERATOR_SYMBOL = REAL_ITERATOR_SYMBOL || FAUX_ITERATOR_SYMBOL;\n\n\n  function Iterator(next) {\n      this.next = next;\n    }\n\n    Iterator.prototype.toString = function() {\n      return '[Iterator]';\n    };\n\n\n  Iterator.KEYS = ITERATE_KEYS;\n  Iterator.VALUES = ITERATE_VALUES;\n  Iterator.ENTRIES = ITERATE_ENTRIES;\n\n  Iterator.prototype.inspect =\n  Iterator.prototype.toSource = function () { return this.toString(); }\n  Iterator.prototype[ITERATOR_SYMBOL] = function () {\n    return this;\n  };\n\n\n  function iteratorValue(type, k, v, iteratorResult) {\n    var value = type === 0 ? k : type === 1 ? v : [k, v];\n    iteratorResult ? (iteratorResult.value = value) : (iteratorResult = {\n      value: value, done: false\n    });\n    return iteratorResult;\n  }\n\n  function iteratorDone() {\n    return { value: undefined, done: true };\n  }\n\n  function hasIterator(maybeIterable) {\n    return !!getIteratorFn(maybeIterable);\n  }\n\n  function isIterator(maybeIterator) {\n    return maybeIterator && typeof maybeIterator.next === 'function';\n  }\n\n  function getIterator(iterable) {\n    var iteratorFn = getIteratorFn(iterable);\n    return iteratorFn && iteratorFn.call(iterable);\n  }\n\n  function getIteratorFn(iterable) {\n    var iteratorFn = iterable && (\n      (REAL_ITERATOR_SYMBOL && iterable[REAL_ITERATOR_SYMBOL]) ||\n      iterable[FAUX_ITERATOR_SYMBOL]\n    );\n    if (typeof iteratorFn === 'function') {\n      return iteratorFn;\n    }\n  }\n\n  function isArrayLike(value) {\n    return value && typeof value.length === 'number';\n  }\n\n  createClass(Seq, Iterable);\n    function Seq(value) {\n      return value === null || value === undefined ? emptySequence() :\n        isIterable(value) ? value.toSeq() : seqFromValue(value);\n    }\n\n    Seq.of = function(/*...values*/) {\n      return Seq(arguments);\n    };\n\n    Seq.prototype.toSeq = function() {\n      return this;\n    };\n\n    Seq.prototype.toString = function() {\n      return this.__toString('Seq {', '}');\n    };\n\n    Seq.prototype.cacheResult = function() {\n      if (!this._cache && this.__iterateUncached) {\n        this._cache = this.entrySeq().toArray();\n        this.size = this._cache.length;\n      }\n      return this;\n    };\n\n    // abstract __iterateUncached(fn, reverse)\n\n    Seq.prototype.__iterate = function(fn, reverse) {\n      return seqIterate(this, fn, reverse, true);\n    };\n\n    // abstract __iteratorUncached(type, reverse)\n\n    Seq.prototype.__iterator = function(type, reverse) {\n      return seqIterator(this, type, reverse, true);\n    };\n\n\n\n  createClass(KeyedSeq, Seq);\n    function KeyedSeq(value) {\n      return value === null || value === undefined ?\n        emptySequence().toKeyedSeq() :\n        isIterable(value) ?\n          (isKeyed(value) ? value.toSeq() : value.fromEntrySeq()) :\n          keyedSeqFromValue(value);\n    }\n\n    KeyedSeq.prototype.toKeyedSeq = function() {\n      return this;\n    };\n\n\n\n  createClass(IndexedSeq, Seq);\n    function IndexedSeq(value) {\n      return value === null || value === undefined ? emptySequence() :\n        !isIterable(value) ? indexedSeqFromValue(value) :\n        isKeyed(value) ? value.entrySeq() : value.toIndexedSeq();\n    }\n\n    IndexedSeq.of = function(/*...values*/) {\n      return IndexedSeq(arguments);\n    };\n\n    IndexedSeq.prototype.toIndexedSeq = function() {\n      return this;\n    };\n\n    IndexedSeq.prototype.toString = function() {\n      return this.__toString('Seq [', ']');\n    };\n\n    IndexedSeq.prototype.__iterate = function(fn, reverse) {\n      return seqIterate(this, fn, reverse, false);\n    };\n\n    IndexedSeq.prototype.__iterator = function(type, reverse) {\n      return seqIterator(this, type, reverse, false);\n    };\n\n\n\n  createClass(SetSeq, Seq);\n    function SetSeq(value) {\n      return (\n        value === null || value === undefined ? emptySequence() :\n        !isIterable(value) ? indexedSeqFromValue(value) :\n        isKeyed(value) ? value.entrySeq() : value\n      ).toSetSeq();\n    }\n\n    SetSeq.of = function(/*...values*/) {\n      return SetSeq(arguments);\n    };\n\n    SetSeq.prototype.toSetSeq = function() {\n      return this;\n    };\n\n\n\n  Seq.isSeq = isSeq;\n  Seq.Keyed = KeyedSeq;\n  Seq.Set = SetSeq;\n  Seq.Indexed = IndexedSeq;\n\n  var IS_SEQ_SENTINEL = '@@__IMMUTABLE_SEQ__@@';\n\n  Seq.prototype[IS_SEQ_SENTINEL] = true;\n\n\n\n  createClass(ArraySeq, IndexedSeq);\n    function ArraySeq(array) {\n      this._array = array;\n      this.size = array.length;\n    }\n\n    ArraySeq.prototype.get = function(index, notSetValue) {\n      return this.has(index) ? this._array[wrapIndex(this, index)] : notSetValue;\n    };\n\n    ArraySeq.prototype.__iterate = function(fn, reverse) {\n      var array = this._array;\n      var maxIndex = array.length - 1;\n      for (var ii = 0; ii <= maxIndex; ii++) {\n        if (fn(array[reverse ? maxIndex - ii : ii], ii, this) === false) {\n          return ii + 1;\n        }\n      }\n      return ii;\n    };\n\n    ArraySeq.prototype.__iterator = function(type, reverse) {\n      var array = this._array;\n      var maxIndex = array.length - 1;\n      var ii = 0;\n      return new Iterator(function() \n        {return ii > maxIndex ?\n          iteratorDone() :\n          iteratorValue(type, ii, array[reverse ? maxIndex - ii++ : ii++])}\n      );\n    };\n\n\n\n  createClass(ObjectSeq, KeyedSeq);\n    function ObjectSeq(object) {\n      var keys = Object.keys(object);\n      this._object = object;\n      this._keys = keys;\n      this.size = keys.length;\n    }\n\n    ObjectSeq.prototype.get = function(key, notSetValue) {\n      if (notSetValue !== undefined && !this.has(key)) {\n        return notSetValue;\n      }\n      return this._object[key];\n    };\n\n    ObjectSeq.prototype.has = function(key) {\n      return this._object.hasOwnProperty(key);\n    };\n\n    ObjectSeq.prototype.__iterate = function(fn, reverse) {\n      var object = this._object;\n      var keys = this._keys;\n      var maxIndex = keys.length - 1;\n      for (var ii = 0; ii <= maxIndex; ii++) {\n        var key = keys[reverse ? maxIndex - ii : ii];\n        if (fn(object[key], key, this) === false) {\n          return ii + 1;\n        }\n      }\n      return ii;\n    };\n\n    ObjectSeq.prototype.__iterator = function(type, reverse) {\n      var object = this._object;\n      var keys = this._keys;\n      var maxIndex = keys.length - 1;\n      var ii = 0;\n      return new Iterator(function()  {\n        var key = keys[reverse ? maxIndex - ii : ii];\n        return ii++ > maxIndex ?\n          iteratorDone() :\n          iteratorValue(type, key, object[key]);\n      });\n    };\n\n  ObjectSeq.prototype[IS_ORDERED_SENTINEL] = true;\n\n\n  createClass(IterableSeq, IndexedSeq);\n    function IterableSeq(iterable) {\n      this._iterable = iterable;\n      this.size = iterable.length || iterable.size;\n    }\n\n    IterableSeq.prototype.__iterateUncached = function(fn, reverse) {\n      if (reverse) {\n        return this.cacheResult().__iterate(fn, reverse);\n      }\n      var iterable = this._iterable;\n      var iterator = getIterator(iterable);\n      var iterations = 0;\n      if (isIterator(iterator)) {\n        var step;\n        while (!(step = iterator.next()).done) {\n          if (fn(step.value, iterations++, this) === false) {\n            break;\n          }\n        }\n      }\n      return iterations;\n    };\n\n    IterableSeq.prototype.__iteratorUncached = function(type, reverse) {\n      if (reverse) {\n        return this.cacheResult().__iterator(type, reverse);\n      }\n      var iterable = this._iterable;\n      var iterator = getIterator(iterable);\n      if (!isIterator(iterator)) {\n        return new Iterator(iteratorDone);\n      }\n      var iterations = 0;\n      return new Iterator(function()  {\n        var step = iterator.next();\n        return step.done ? step : iteratorValue(type, iterations++, step.value);\n      });\n    };\n\n\n\n  createClass(IteratorSeq, IndexedSeq);\n    function IteratorSeq(iterator) {\n      this._iterator = iterator;\n      this._iteratorCache = [];\n    }\n\n    IteratorSeq.prototype.__iterateUncached = function(fn, reverse) {\n      if (reverse) {\n        return this.cacheResult().__iterate(fn, reverse);\n      }\n      var iterator = this._iterator;\n      var cache = this._iteratorCache;\n      var iterations = 0;\n      while (iterations < cache.length) {\n        if (fn(cache[iterations], iterations++, this) === false) {\n          return iterations;\n        }\n      }\n      var step;\n      while (!(step = iterator.next()).done) {\n        var val = step.value;\n        cache[iterations] = val;\n        if (fn(val, iterations++, this) === false) {\n          break;\n        }\n      }\n      return iterations;\n    };\n\n    IteratorSeq.prototype.__iteratorUncached = function(type, reverse) {\n      if (reverse) {\n        return this.cacheResult().__iterator(type, reverse);\n      }\n      var iterator = this._iterator;\n      var cache = this._iteratorCache;\n      var iterations = 0;\n      return new Iterator(function()  {\n        if (iterations >= cache.length) {\n          var step = iterator.next();\n          if (step.done) {\n            return step;\n          }\n          cache[iterations] = step.value;\n        }\n        return iteratorValue(type, iterations, cache[iterations++]);\n      });\n    };\n\n\n\n\n  // # pragma Helper functions\n\n  function isSeq(maybeSeq) {\n    return !!(maybeSeq && maybeSeq[IS_SEQ_SENTINEL]);\n  }\n\n  var EMPTY_SEQ;\n\n  function emptySequence() {\n    return EMPTY_SEQ || (EMPTY_SEQ = new ArraySeq([]));\n  }\n\n  function keyedSeqFromValue(value) {\n    var seq =\n      Array.isArray(value) ? new ArraySeq(value).fromEntrySeq() :\n      isIterator(value) ? new IteratorSeq(value).fromEntrySeq() :\n      hasIterator(value) ? new IterableSeq(value).fromEntrySeq() :\n      typeof value === 'object' ? new ObjectSeq(value) :\n      undefined;\n    if (!seq) {\n      throw new TypeError(\n        'Expected Array or iterable object of [k, v] entries, '+\n        'or keyed object: ' + value\n      );\n    }\n    return seq;\n  }\n\n  function indexedSeqFromValue(value) {\n    var seq = maybeIndexedSeqFromValue(value);\n    if (!seq) {\n      throw new TypeError(\n        'Expected Array or iterable object of values: ' + value\n      );\n    }\n    return seq;\n  }\n\n  function seqFromValue(value) {\n    var seq = maybeIndexedSeqFromValue(value) ||\n      (typeof value === 'object' && new ObjectSeq(value));\n    if (!seq) {\n      throw new TypeError(\n        'Expected Array or iterable object of values, or keyed object: ' + value\n      );\n    }\n    return seq;\n  }\n\n  function maybeIndexedSeqFromValue(value) {\n    return (\n      isArrayLike(value) ? new ArraySeq(value) :\n      isIterator(value) ? new IteratorSeq(value) :\n      hasIterator(value) ? new IterableSeq(value) :\n      undefined\n    );\n  }\n\n  function seqIterate(seq, fn, reverse, useKeys) {\n    var cache = seq._cache;\n    if (cache) {\n      var maxIndex = cache.length - 1;\n      for (var ii = 0; ii <= maxIndex; ii++) {\n        var entry = cache[reverse ? maxIndex - ii : ii];\n        if (fn(entry[1], useKeys ? entry[0] : ii, seq) === false) {\n          return ii + 1;\n        }\n      }\n      return ii;\n    }\n    return seq.__iterateUncached(fn, reverse);\n  }\n\n  function seqIterator(seq, type, reverse, useKeys) {\n    var cache = seq._cache;\n    if (cache) {\n      var maxIndex = cache.length - 1;\n      var ii = 0;\n      return new Iterator(function()  {\n        var entry = cache[reverse ? maxIndex - ii : ii];\n        return ii++ > maxIndex ?\n          iteratorDone() :\n          iteratorValue(type, useKeys ? entry[0] : ii - 1, entry[1]);\n      });\n    }\n    return seq.__iteratorUncached(type, reverse);\n  }\n\n  function fromJS(json, converter) {\n    return converter ?\n      fromJSWith(converter, json, '', {'': json}) :\n      fromJSDefault(json);\n  }\n\n  function fromJSWith(converter, json, key, parentJSON) {\n    if (Array.isArray(json)) {\n      return converter.call(parentJSON, key, IndexedSeq(json).map(function(v, k)  {return fromJSWith(converter, v, k, json)}));\n    }\n    if (isPlainObj(json)) {\n      return converter.call(parentJSON, key, KeyedSeq(json).map(function(v, k)  {return fromJSWith(converter, v, k, json)}));\n    }\n    return json;\n  }\n\n  function fromJSDefault(json) {\n    if (Array.isArray(json)) {\n      return IndexedSeq(json).map(fromJSDefault).toList();\n    }\n    if (isPlainObj(json)) {\n      return KeyedSeq(json).map(fromJSDefault).toMap();\n    }\n    return json;\n  }\n\n  function isPlainObj(value) {\n    return value && (value.constructor === Object || value.constructor === undefined);\n  }\n\n  /**\n   * An extension of the \"same-value\" algorithm as [described for use by ES6 Map\n   * and Set](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Map#Key_equality)\n   *\n   * NaN is considered the same as NaN, however -0 and 0 are considered the same\n   * value, which is different from the algorithm described by\n   * [`Object.is`](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is).\n   *\n   * This is extended further to allow Objects to describe the values they\n   * represent, by way of `valueOf` or `equals` (and `hashCode`).\n   *\n   * Note: because of this extension, the key equality of Immutable.Map and the\n   * value equality of Immutable.Set will differ from ES6 Map and Set.\n   *\n   * ### Defining custom values\n   *\n   * The easiest way to describe the value an object represents is by implementing\n   * `valueOf`. For example, `Date` represents a value by returning a unix\n   * timestamp for `valueOf`:\n   *\n   *     var date1 = new Date(1234567890000); // Fri Feb 13 2009 ...\n   *     var date2 = new Date(1234567890000);\n   *     date1.valueOf(); // 1234567890000\n   *     assert( date1 !== date2 );\n   *     assert( Immutable.is( date1, date2 ) );\n   *\n   * Note: overriding `valueOf` may have other implications if you use this object\n   * where JavaScript expects a primitive, such as implicit string coercion.\n   *\n   * For more complex types, especially collections, implementing `valueOf` may\n   * not be performant. An alternative is to implement `equals` and `hashCode`.\n   *\n   * `equals` takes another object, presumably of similar type, and returns true\n   * if the it is equal. Equality is symmetrical, so the same result should be\n   * returned if this and the argument are flipped.\n   *\n   *     assert( a.equals(b) === b.equals(a) );\n   *\n   * `hashCode` returns a 32bit integer number representing the object which will\n   * be used to determine how to store the value object in a Map or Set. You must\n   * provide both or neither methods, one must not exist without the other.\n   *\n   * Also, an important relationship between these methods must be upheld: if two\n   * values are equal, they *must* return the same hashCode. If the values are not\n   * equal, they might have the same hashCode; this is called a hash collision,\n   * and while undesirable for performance reasons, it is acceptable.\n   *\n   *     if (a.equals(b)) {\n   *       assert( a.hashCode() === b.hashCode() );\n   *     }\n   *\n   * All Immutable collections implement `equals` and `hashCode`.\n   *\n   */\n  function is(valueA, valueB) {\n    if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) {\n      return true;\n    }\n    if (!valueA || !valueB) {\n      return false;\n    }\n    if (typeof valueA.valueOf === 'function' &&\n        typeof valueB.valueOf === 'function') {\n      valueA = valueA.valueOf();\n      valueB = valueB.valueOf();\n      if (valueA === valueB || (valueA !== valueA && valueB !== valueB)) {\n        return true;\n      }\n      if (!valueA || !valueB) {\n        return false;\n      }\n    }\n    if (typeof valueA.equals === 'function' &&\n        typeof valueB.equals === 'function' &&\n        valueA.equals(valueB)) {\n      return true;\n    }\n    return false;\n  }\n\n  function deepEqual(a, b) {\n    if (a === b) {\n      return true;\n    }\n\n    if (\n      !isIterable(b) ||\n      a.size !== undefined && b.size !== undefined && a.size !== b.size ||\n      a.__hash !== undefined && b.__hash !== undefined && a.__hash !== b.__hash ||\n      isKeyed(a) !== isKeyed(b) ||\n      isIndexed(a) !== isIndexed(b) ||\n      isOrdered(a) !== isOrdered(b)\n    ) {\n      return false;\n    }\n\n    if (a.size === 0 && b.size === 0) {\n      return true;\n    }\n\n    var notAssociative = !isAssociative(a);\n\n    if (isOrdered(a)) {\n      var entries = a.entries();\n      return b.every(function(v, k)  {\n        var entry = entries.next().value;\n        return entry && is(entry[1], v) && (notAssociative || is(entry[0], k));\n      }) && entries.next().done;\n    }\n\n    var flipped = false;\n\n    if (a.size === undefined) {\n      if (b.size === undefined) {\n        if (typeof a.cacheResult === 'function') {\n          a.cacheResult();\n        }\n      } else {\n        flipped = true;\n        var _ = a;\n        a = b;\n        b = _;\n      }\n    }\n\n    var allEqual = true;\n    var bSize = b.__iterate(function(v, k)  {\n      if (notAssociative ? !a.has(v) :\n          flipped ? !is(v, a.get(k, NOT_SET)) : !is(a.get(k, NOT_SET), v)) {\n        allEqual = false;\n        return false;\n      }\n    });\n\n    return allEqual && a.size === bSize;\n  }\n\n  createClass(Repeat, IndexedSeq);\n\n    function Repeat(value, times) {\n      if (!(this instanceof Repeat)) {\n        return new Repeat(value, times);\n      }\n      this._value = value;\n      this.size = times === undefined ? Infinity : Math.max(0, times);\n      if (this.size === 0) {\n        if (EMPTY_REPEAT) {\n          return EMPTY_REPEAT;\n        }\n        EMPTY_REPEAT = this;\n      }\n    }\n\n    Repeat.prototype.toString = function() {\n      if (this.size === 0) {\n        return 'Repeat []';\n      }\n      return 'Repeat [ ' + this._value + ' ' + this.size + ' times ]';\n    };\n\n    Repeat.prototype.get = function(index, notSetValue) {\n      return this.has(index) ? this._value : notSetValue;\n    };\n\n    Repeat.prototype.includes = function(searchValue) {\n      return is(this._value, searchValue);\n    };\n\n    Repeat.prototype.slice = function(begin, end) {\n      var size = this.size;\n      return wholeSlice(begin, end, size) ? this :\n        new Repeat(this._value, resolveEnd(end, size) - resolveBegin(begin, size));\n    };\n\n    Repeat.prototype.reverse = function() {\n      return this;\n    };\n\n    Repeat.prototype.indexOf = function(searchValue) {\n      if (is(this._value, searchValue)) {\n        return 0;\n      }\n      return -1;\n    };\n\n    Repeat.prototype.lastIndexOf = function(searchValue) {\n      if (is(this._value, searchValue)) {\n        return this.size;\n      }\n      return -1;\n    };\n\n    Repeat.prototype.__iterate = function(fn, reverse) {\n      for (var ii = 0; ii < this.size; ii++) {\n        if (fn(this._value, ii, this) === false) {\n          return ii + 1;\n        }\n      }\n      return ii;\n    };\n\n    Repeat.prototype.__iterator = function(type, reverse) {var this$0 = this;\n      var ii = 0;\n      return new Iterator(function() \n        {return ii < this$0.size ? iteratorValue(type, ii++, this$0._value) : iteratorDone()}\n      );\n    };\n\n    Repeat.prototype.equals = function(other) {\n      return other instanceof Repeat ?\n        is(this._value, other._value) :\n        deepEqual(other);\n    };\n\n\n  var EMPTY_REPEAT;\n\n  function invariant(condition, error) {\n    if (!condition) throw new Error(error);\n  }\n\n  createClass(Range, IndexedSeq);\n\n    function Range(start, end, step) {\n      if (!(this instanceof Range)) {\n        return new Range(start, end, step);\n      }\n      invariant(step !== 0, 'Cannot step a Range by 0');\n      start = start || 0;\n      if (end === undefined) {\n        end = Infinity;\n      }\n      step = step === undefined ? 1 : Math.abs(step);\n      if (end < start) {\n        step = -step;\n      }\n      this._start = start;\n      this._end = end;\n      this._step = step;\n      this.size = Math.max(0, Math.ceil((end - start) / step - 1) + 1);\n      if (this.size === 0) {\n        if (EMPTY_RANGE) {\n          return EMPTY_RANGE;\n        }\n        EMPTY_RANGE = this;\n      }\n    }\n\n    Range.prototype.toString = function() {\n      if (this.size === 0) {\n        return 'Range []';\n      }\n      return 'Range [ ' +\n        this._start + '...' + this._end +\n        (this._step > 1 ? ' by ' + this._step : '') +\n      ' ]';\n    };\n\n    Range.prototype.get = function(index, notSetValue) {\n      return this.has(index) ?\n        this._start + wrapIndex(this, index) * this._step :\n        notSetValue;\n    };\n\n    Range.prototype.includes = function(searchValue) {\n      var possibleIndex = (searchValue - this._start) / this._step;\n      return possibleIndex >= 0 &&\n        possibleIndex < this.size &&\n        possibleIndex === Math.floor(possibleIndex);\n    };\n\n    Range.prototype.slice = function(begin, end) {\n      if (wholeSlice(begin, end, this.size)) {\n        return this;\n      }\n      begin = resolveBegin(begin, this.size);\n      end = resolveEnd(end, this.size);\n      if (end <= begin) {\n        return new Range(0, 0);\n      }\n      return new Range(this.get(begin, this._end), this.get(end, this._end), this._step);\n    };\n\n    Range.prototype.indexOf = function(searchValue) {\n      var offsetValue = searchValue - this._start;\n      if (offsetValue % this._step === 0) {\n        var index = offsetValue / this._step;\n        if (index >= 0 && index < this.size) {\n          return index\n        }\n      }\n      return -1;\n    };\n\n    Range.prototype.lastIndexOf = function(searchValue) {\n      return this.indexOf(searchValue);\n    };\n\n    Range.prototype.__iterate = function(fn, reverse) {\n      var maxIndex = this.size - 1;\n      var step = this._step;\n      var value = reverse ? this._start + maxIndex * step : this._start;\n      for (var ii = 0; ii <= maxIndex; ii++) {\n        if (fn(value, ii, this) === false) {\n          return ii + 1;\n        }\n        value += reverse ? -step : step;\n      }\n      return ii;\n    };\n\n    Range.prototype.__iterator = function(type, reverse) {\n      var maxIndex = this.size - 1;\n      var step = this._step;\n      var value = reverse ? this._start + maxIndex * step : this._start;\n      var ii = 0;\n      return new Iterator(function()  {\n        var v = value;\n        value += reverse ? -step : step;\n        return ii > maxIndex ? iteratorDone() : iteratorValue(type, ii++, v);\n      });\n    };\n\n    Range.prototype.equals = function(other) {\n      return other instanceof Range ?\n        this._start === other._start &&\n        this._end === other._end &&\n        this._step === other._step :\n        deepEqual(this, other);\n    };\n\n\n  var EMPTY_RANGE;\n\n  createClass(Collection, Iterable);\n    function Collection() {\n      throw TypeError('Abstract');\n    }\n\n\n  createClass(KeyedCollection, Collection);function KeyedCollection() {}\n\n  createClass(IndexedCollection, Collection);function IndexedCollection() {}\n\n  createClass(SetCollection, Collection);function SetCollection() {}\n\n\n  Collection.Keyed = KeyedCollection;\n  Collection.Indexed = IndexedCollection;\n  Collection.Set = SetCollection;\n\n  var imul =\n    typeof Math.imul === 'function' && Math.imul(0xffffffff, 2) === -2 ?\n    Math.imul :\n    function imul(a, b) {\n      a = a | 0; // int\n      b = b | 0; // int\n      var c = a & 0xffff;\n      var d = b & 0xffff;\n      // Shift by 0 fixes the sign on the high part.\n      return (c * d) + ((((a >>> 16) * d + c * (b >>> 16)) << 16) >>> 0) | 0; // int\n    };\n\n  // v8 has an optimization for storing 31-bit signed numbers.\n  // Values which have either 00 or 11 as the high order bits qualify.\n  // This function drops the highest order bit in a signed number, maintaining\n  // the sign bit.\n  function smi(i32) {\n    return ((i32 >>> 1) & 0x40000000) | (i32 & 0xBFFFFFFF);\n  }\n\n  function hash(o) {\n    if (o === false || o === null || o === undefined) {\n      return 0;\n    }\n    if (typeof o.valueOf === 'function') {\n      o = o.valueOf();\n      if (o === false || o === null || o === undefined) {\n        return 0;\n      }\n    }\n    if (o === true) {\n      return 1;\n    }\n    var type = typeof o;\n    if (type === 'number') {\n      var h = o | 0;\n      if (h !== o) {\n        h ^= o * 0xFFFFFFFF;\n      }\n      while (o > 0xFFFFFFFF) {\n        o /= 0xFFFFFFFF;\n        h ^= o;\n      }\n      return smi(h);\n    }\n    if (type === 'string') {\n      return o.length > STRING_HASH_CACHE_MIN_STRLEN ? cachedHashString(o) : hashString(o);\n    }\n    if (typeof o.hashCode === 'function') {\n      return o.hashCode();\n    }\n    if (type === 'object') {\n      return hashJSObj(o);\n    }\n    if (typeof o.toString === 'function') {\n      return hashString(o.toString());\n    }\n    throw new Error('Value type ' + type + ' cannot be hashed.');\n  }\n\n  function cachedHashString(string) {\n    var hash = stringHashCache[string];\n    if (hash === undefined) {\n      hash = hashString(string);\n      if (STRING_HASH_CACHE_SIZE === STRING_HASH_CACHE_MAX_SIZE) {\n        STRING_HASH_CACHE_SIZE = 0;\n        stringHashCache = {};\n      }\n      STRING_HASH_CACHE_SIZE++;\n      stringHashCache[string] = hash;\n    }\n    return hash;\n  }\n\n  // http://jsperf.com/hashing-strings\n  function hashString(string) {\n    // This is the hash from JVM\n    // The hash code for a string is computed as\n    // s[0] * 31 ^ (n - 1) + s[1] * 31 ^ (n - 2) + ... + s[n - 1],\n    // where s[i] is the ith character of the string and n is the length of\n    // the string. We \"mod\" the result to make it between 0 (inclusive) and 2^31\n    // (exclusive) by dropping high bits.\n    var hash = 0;\n    for (var ii = 0; ii < string.length; ii++) {\n      hash = 31 * hash + string.charCodeAt(ii) | 0;\n    }\n    return smi(hash);\n  }\n\n  function hashJSObj(obj) {\n    var hash;\n    if (usingWeakMap) {\n      hash = weakMap.get(obj);\n      if (hash !== undefined) {\n        return hash;\n      }\n    }\n\n    hash = obj[UID_HASH_KEY];\n    if (hash !== undefined) {\n      return hash;\n    }\n\n    if (!canDefineProperty) {\n      hash = obj.propertyIsEnumerable && obj.propertyIsEnumerable[UID_HASH_KEY];\n      if (hash !== undefined) {\n        return hash;\n      }\n\n      hash = getIENodeHash(obj);\n      if (hash !== undefined) {\n        return hash;\n      }\n    }\n\n    hash = ++objHashUID;\n    if (objHashUID & 0x40000000) {\n      objHashUID = 0;\n    }\n\n    if (usingWeakMap) {\n      weakMap.set(obj, hash);\n    } else if (isExtensible !== undefined && isExtensible(obj) === false) {\n      throw new Error('Non-extensible objects are not allowed as keys.');\n    } else if (canDefineProperty) {\n      Object.defineProperty(obj, UID_HASH_KEY, {\n        'enumerable': false,\n        'configurable': false,\n        'writable': false,\n        'value': hash\n      });\n    } else if (obj.propertyIsEnumerable !== undefined &&\n               obj.propertyIsEnumerable === obj.constructor.prototype.propertyIsEnumerable) {\n      // Since we can't define a non-enumerable property on the object\n      // we'll hijack one of the less-used non-enumerable properties to\n      // save our hash on it. Since this is a function it will not show up in\n      // `JSON.stringify` which is what we want.\n      obj.propertyIsEnumerable = function() {\n        return this.constructor.prototype.propertyIsEnumerable.apply(this, arguments);\n      };\n      obj.propertyIsEnumerable[UID_HASH_KEY] = hash;\n    } else if (obj.nodeType !== undefined) {\n      // At this point we couldn't get the IE `uniqueID` to use as a hash\n      // and we couldn't use a non-enumerable property to exploit the\n      // dontEnum bug so we simply add the `UID_HASH_KEY` on the node\n      // itself.\n      obj[UID_HASH_KEY] = hash;\n    } else {\n      throw new Error('Unable to set a non-enumerable property on object.');\n    }\n\n    return hash;\n  }\n\n  // Get references to ES5 object methods.\n  var isExtensible = Object.isExtensible;\n\n  // True if Object.defineProperty works as expected. IE8 fails this test.\n  var canDefineProperty = (function() {\n    try {\n      Object.defineProperty({}, '@', {});\n      return true;\n    } catch (e) {\n      return false;\n    }\n  }());\n\n  // IE has a `uniqueID` property on DOM nodes. We can construct the hash from it\n  // and avoid memory leaks from the IE cloneNode bug.\n  function getIENodeHash(node) {\n    if (node && node.nodeType > 0) {\n      switch (node.nodeType) {\n        case 1: // Element\n          return node.uniqueID;\n        case 9: // Document\n          return node.documentElement && node.documentElement.uniqueID;\n      }\n    }\n  }\n\n  // If possible, use a WeakMap.\n  var usingWeakMap = typeof WeakMap === 'function';\n  var weakMap;\n  if (usingWeakMap) {\n    weakMap = new WeakMap();\n  }\n\n  var objHashUID = 0;\n\n  var UID_HASH_KEY = '__immutablehash__';\n  if (typeof Symbol === 'function') {\n    UID_HASH_KEY = Symbol(UID_HASH_KEY);\n  }\n\n  var STRING_HASH_CACHE_MIN_STRLEN = 16;\n  var STRING_HASH_CACHE_MAX_SIZE = 255;\n  var STRING_HASH_CACHE_SIZE = 0;\n  var stringHashCache = {};\n\n  function assertNotInfinite(size) {\n    invariant(\n      size !== Infinity,\n      'Cannot perform this action with an infinite size.'\n    );\n  }\n\n  createClass(Map, KeyedCollection);\n\n    // @pragma Construction\n\n    function Map(value) {\n      return value === null || value === undefined ? emptyMap() :\n        isMap(value) && !isOrdered(value) ? value :\n        emptyMap().withMutations(function(map ) {\n          var iter = KeyedIterable(value);\n          assertNotInfinite(iter.size);\n          iter.forEach(function(v, k)  {return map.set(k, v)});\n        });\n    }\n\n    Map.prototype.toString = function() {\n      return this.__toString('Map {', '}');\n    };\n\n    // @pragma Access\n\n    Map.prototype.get = function(k, notSetValue) {\n      return this._root ?\n        this._root.get(0, undefined, k, notSetValue) :\n        notSetValue;\n    };\n\n    // @pragma Modification\n\n    Map.prototype.set = function(k, v) {\n      return updateMap(this, k, v);\n    };\n\n    Map.prototype.setIn = function(keyPath, v) {\n      return this.updateIn(keyPath, NOT_SET, function()  {return v});\n    };\n\n    Map.prototype.remove = function(k) {\n      return updateMap(this, k, NOT_SET);\n    };\n\n    Map.prototype.deleteIn = function(keyPath) {\n      return this.updateIn(keyPath, function()  {return NOT_SET});\n    };\n\n    Map.prototype.update = function(k, notSetValue, updater) {\n      return arguments.length === 1 ?\n        k(this) :\n        this.updateIn([k], notSetValue, updater);\n    };\n\n    Map.prototype.updateIn = function(keyPath, notSetValue, updater) {\n      if (!updater) {\n        updater = notSetValue;\n        notSetValue = undefined;\n      }\n      var updatedValue = updateInDeepMap(\n        this,\n        forceIterator(keyPath),\n        notSetValue,\n        updater\n      );\n      return updatedValue === NOT_SET ? undefined : updatedValue;\n    };\n\n    Map.prototype.clear = function() {\n      if (this.size === 0) {\n        return this;\n      }\n      if (this.__ownerID) {\n        this.size = 0;\n        this._root = null;\n        this.__hash = undefined;\n        this.__altered = true;\n        return this;\n      }\n      return emptyMap();\n    };\n\n    // @pragma Composition\n\n    Map.prototype.merge = function(/*...iters*/) {\n      return mergeIntoMapWith(this, undefined, arguments);\n    };\n\n    Map.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1);\n      return mergeIntoMapWith(this, merger, iters);\n    };\n\n    Map.prototype.mergeIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1);\n      return this.updateIn(\n        keyPath,\n        emptyMap(),\n        function(m ) {return typeof m.merge === 'function' ?\n          m.merge.apply(m, iters) :\n          iters[iters.length - 1]}\n      );\n    };\n\n    Map.prototype.mergeDeep = function(/*...iters*/) {\n      return mergeIntoMapWith(this, deepMerger, arguments);\n    };\n\n    Map.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1);\n      return mergeIntoMapWith(this, deepMergerWith(merger), iters);\n    };\n\n    Map.prototype.mergeDeepIn = function(keyPath) {var iters = SLICE$0.call(arguments, 1);\n      return this.updateIn(\n        keyPath,\n        emptyMap(),\n        function(m ) {return typeof m.mergeDeep === 'function' ?\n          m.mergeDeep.apply(m, iters) :\n          iters[iters.length - 1]}\n      );\n    };\n\n    Map.prototype.sort = function(comparator) {\n      // Late binding\n      return OrderedMap(sortFactory(this, comparator));\n    };\n\n    Map.prototype.sortBy = function(mapper, comparator) {\n      // Late binding\n      return OrderedMap(sortFactory(this, comparator, mapper));\n    };\n\n    // @pragma Mutability\n\n    Map.prototype.withMutations = function(fn) {\n      var mutable = this.asMutable();\n      fn(mutable);\n      return mutable.wasAltered() ? mutable.__ensureOwner(this.__ownerID) : this;\n    };\n\n    Map.prototype.asMutable = function() {\n      return this.__ownerID ? this : this.__ensureOwner(new OwnerID());\n    };\n\n    Map.prototype.asImmutable = function() {\n      return this.__ensureOwner();\n    };\n\n    Map.prototype.wasAltered = function() {\n      return this.__altered;\n    };\n\n    Map.prototype.__iterator = function(type, reverse) {\n      return new MapIterator(this, type, reverse);\n    };\n\n    Map.prototype.__iterate = function(fn, reverse) {var this$0 = this;\n      var iterations = 0;\n      this._root && this._root.iterate(function(entry ) {\n        iterations++;\n        return fn(entry[1], entry[0], this$0);\n      }, reverse);\n      return iterations;\n    };\n\n    Map.prototype.__ensureOwner = function(ownerID) {\n      if (ownerID === this.__ownerID) {\n        return this;\n      }\n      if (!ownerID) {\n        this.__ownerID = ownerID;\n        this.__altered = false;\n        return this;\n      }\n      return makeMap(this.size, this._root, ownerID, this.__hash);\n    };\n\n\n  function isMap(maybeMap) {\n    return !!(maybeMap && maybeMap[IS_MAP_SENTINEL]);\n  }\n\n  Map.isMap = isMap;\n\n  var IS_MAP_SENTINEL = '@@__IMMUTABLE_MAP__@@';\n\n  var MapPrototype = Map.prototype;\n  MapPrototype[IS_MAP_SENTINEL] = true;\n  MapPrototype[DELETE] = MapPrototype.remove;\n  MapPrototype.removeIn = MapPrototype.deleteIn;\n\n\n  // #pragma Trie Nodes\n\n\n\n    function ArrayMapNode(ownerID, entries) {\n      this.ownerID = ownerID;\n      this.entries = entries;\n    }\n\n    ArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) {\n      var entries = this.entries;\n      for (var ii = 0, len = entries.length; ii < len; ii++) {\n        if (is(key, entries[ii][0])) {\n          return entries[ii][1];\n        }\n      }\n      return notSetValue;\n    };\n\n    ArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n      var removed = value === NOT_SET;\n\n      var entries = this.entries;\n      var idx = 0;\n      for (var len = entries.length; idx < len; idx++) {\n        if (is(key, entries[idx][0])) {\n          break;\n        }\n      }\n      var exists = idx < len;\n\n      if (exists ? entries[idx][1] === value : removed) {\n        return this;\n      }\n\n      SetRef(didAlter);\n      (removed || !exists) && SetRef(didChangeSize);\n\n      if (removed && entries.length === 1) {\n        return; // undefined\n      }\n\n      if (!exists && !removed && entries.length >= MAX_ARRAY_MAP_SIZE) {\n        return createNodes(ownerID, entries, key, value);\n      }\n\n      var isEditable = ownerID && ownerID === this.ownerID;\n      var newEntries = isEditable ? entries : arrCopy(entries);\n\n      if (exists) {\n        if (removed) {\n          idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop());\n        } else {\n          newEntries[idx] = [key, value];\n        }\n      } else {\n        newEntries.push([key, value]);\n      }\n\n      if (isEditable) {\n        this.entries = newEntries;\n        return this;\n      }\n\n      return new ArrayMapNode(ownerID, newEntries);\n    };\n\n\n\n\n    function BitmapIndexedNode(ownerID, bitmap, nodes) {\n      this.ownerID = ownerID;\n      this.bitmap = bitmap;\n      this.nodes = nodes;\n    }\n\n    BitmapIndexedNode.prototype.get = function(shift, keyHash, key, notSetValue) {\n      if (keyHash === undefined) {\n        keyHash = hash(key);\n      }\n      var bit = (1 << ((shift === 0 ? keyHash : keyHash >>> shift) & MASK));\n      var bitmap = this.bitmap;\n      return (bitmap & bit) === 0 ? notSetValue :\n        this.nodes[popCount(bitmap & (bit - 1))].get(shift + SHIFT, keyHash, key, notSetValue);\n    };\n\n    BitmapIndexedNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n      if (keyHash === undefined) {\n        keyHash = hash(key);\n      }\n      var keyHashFrag = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n      var bit = 1 << keyHashFrag;\n      var bitmap = this.bitmap;\n      var exists = (bitmap & bit) !== 0;\n\n      if (!exists && value === NOT_SET) {\n        return this;\n      }\n\n      var idx = popCount(bitmap & (bit - 1));\n      var nodes = this.nodes;\n      var node = exists ? nodes[idx] : undefined;\n      var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);\n\n      if (newNode === node) {\n        return this;\n      }\n\n      if (!exists && newNode && nodes.length >= MAX_BITMAP_INDEXED_SIZE) {\n        return expandNodes(ownerID, nodes, bitmap, keyHashFrag, newNode);\n      }\n\n      if (exists && !newNode && nodes.length === 2 && isLeafNode(nodes[idx ^ 1])) {\n        return nodes[idx ^ 1];\n      }\n\n      if (exists && newNode && nodes.length === 1 && isLeafNode(newNode)) {\n        return newNode;\n      }\n\n      var isEditable = ownerID && ownerID === this.ownerID;\n      var newBitmap = exists ? newNode ? bitmap : bitmap ^ bit : bitmap | bit;\n      var newNodes = exists ? newNode ?\n        setIn(nodes, idx, newNode, isEditable) :\n        spliceOut(nodes, idx, isEditable) :\n        spliceIn(nodes, idx, newNode, isEditable);\n\n      if (isEditable) {\n        this.bitmap = newBitmap;\n        this.nodes = newNodes;\n        return this;\n      }\n\n      return new BitmapIndexedNode(ownerID, newBitmap, newNodes);\n    };\n\n\n\n\n    function HashArrayMapNode(ownerID, count, nodes) {\n      this.ownerID = ownerID;\n      this.count = count;\n      this.nodes = nodes;\n    }\n\n    HashArrayMapNode.prototype.get = function(shift, keyHash, key, notSetValue) {\n      if (keyHash === undefined) {\n        keyHash = hash(key);\n      }\n      var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n      var node = this.nodes[idx];\n      return node ? node.get(shift + SHIFT, keyHash, key, notSetValue) : notSetValue;\n    };\n\n    HashArrayMapNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n      if (keyHash === undefined) {\n        keyHash = hash(key);\n      }\n      var idx = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n      var removed = value === NOT_SET;\n      var nodes = this.nodes;\n      var node = nodes[idx];\n\n      if (removed && !node) {\n        return this;\n      }\n\n      var newNode = updateNode(node, ownerID, shift + SHIFT, keyHash, key, value, didChangeSize, didAlter);\n      if (newNode === node) {\n        return this;\n      }\n\n      var newCount = this.count;\n      if (!node) {\n        newCount++;\n      } else if (!newNode) {\n        newCount--;\n        if (newCount < MIN_HASH_ARRAY_MAP_SIZE) {\n          return packNodes(ownerID, nodes, newCount, idx);\n        }\n      }\n\n      var isEditable = ownerID && ownerID === this.ownerID;\n      var newNodes = setIn(nodes, idx, newNode, isEditable);\n\n      if (isEditable) {\n        this.count = newCount;\n        this.nodes = newNodes;\n        return this;\n      }\n\n      return new HashArrayMapNode(ownerID, newCount, newNodes);\n    };\n\n\n\n\n    function HashCollisionNode(ownerID, keyHash, entries) {\n      this.ownerID = ownerID;\n      this.keyHash = keyHash;\n      this.entries = entries;\n    }\n\n    HashCollisionNode.prototype.get = function(shift, keyHash, key, notSetValue) {\n      var entries = this.entries;\n      for (var ii = 0, len = entries.length; ii < len; ii++) {\n        if (is(key, entries[ii][0])) {\n          return entries[ii][1];\n        }\n      }\n      return notSetValue;\n    };\n\n    HashCollisionNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n      if (keyHash === undefined) {\n        keyHash = hash(key);\n      }\n\n      var removed = value === NOT_SET;\n\n      if (keyHash !== this.keyHash) {\n        if (removed) {\n          return this;\n        }\n        SetRef(didAlter);\n        SetRef(didChangeSize);\n        return mergeIntoNode(this, ownerID, shift, keyHash, [key, value]);\n      }\n\n      var entries = this.entries;\n      var idx = 0;\n      for (var len = entries.length; idx < len; idx++) {\n        if (is(key, entries[idx][0])) {\n          break;\n        }\n      }\n      var exists = idx < len;\n\n      if (exists ? entries[idx][1] === value : removed) {\n        return this;\n      }\n\n      SetRef(didAlter);\n      (removed || !exists) && SetRef(didChangeSize);\n\n      if (removed && len === 2) {\n        return new ValueNode(ownerID, this.keyHash, entries[idx ^ 1]);\n      }\n\n      var isEditable = ownerID && ownerID === this.ownerID;\n      var newEntries = isEditable ? entries : arrCopy(entries);\n\n      if (exists) {\n        if (removed) {\n          idx === len - 1 ? newEntries.pop() : (newEntries[idx] = newEntries.pop());\n        } else {\n          newEntries[idx] = [key, value];\n        }\n      } else {\n        newEntries.push([key, value]);\n      }\n\n      if (isEditable) {\n        this.entries = newEntries;\n        return this;\n      }\n\n      return new HashCollisionNode(ownerID, this.keyHash, newEntries);\n    };\n\n\n\n\n    function ValueNode(ownerID, keyHash, entry) {\n      this.ownerID = ownerID;\n      this.keyHash = keyHash;\n      this.entry = entry;\n    }\n\n    ValueNode.prototype.get = function(shift, keyHash, key, notSetValue) {\n      return is(key, this.entry[0]) ? this.entry[1] : notSetValue;\n    };\n\n    ValueNode.prototype.update = function(ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n      var removed = value === NOT_SET;\n      var keyMatch = is(key, this.entry[0]);\n      if (keyMatch ? value === this.entry[1] : removed) {\n        return this;\n      }\n\n      SetRef(didAlter);\n\n      if (removed) {\n        SetRef(didChangeSize);\n        return; // undefined\n      }\n\n      if (keyMatch) {\n        if (ownerID && ownerID === this.ownerID) {\n          this.entry[1] = value;\n          return this;\n        }\n        return new ValueNode(ownerID, this.keyHash, [key, value]);\n      }\n\n      SetRef(didChangeSize);\n      return mergeIntoNode(this, ownerID, shift, hash(key), [key, value]);\n    };\n\n\n\n  // #pragma Iterators\n\n  ArrayMapNode.prototype.iterate =\n  HashCollisionNode.prototype.iterate = function (fn, reverse) {\n    var entries = this.entries;\n    for (var ii = 0, maxIndex = entries.length - 1; ii <= maxIndex; ii++) {\n      if (fn(entries[reverse ? maxIndex - ii : ii]) === false) {\n        return false;\n      }\n    }\n  }\n\n  BitmapIndexedNode.prototype.iterate =\n  HashArrayMapNode.prototype.iterate = function (fn, reverse) {\n    var nodes = this.nodes;\n    for (var ii = 0, maxIndex = nodes.length - 1; ii <= maxIndex; ii++) {\n      var node = nodes[reverse ? maxIndex - ii : ii];\n      if (node && node.iterate(fn, reverse) === false) {\n        return false;\n      }\n    }\n  }\n\n  ValueNode.prototype.iterate = function (fn, reverse) {\n    return fn(this.entry);\n  }\n\n  createClass(MapIterator, Iterator);\n\n    function MapIterator(map, type, reverse) {\n      this._type = type;\n      this._reverse = reverse;\n      this._stack = map._root && mapIteratorFrame(map._root);\n    }\n\n    MapIterator.prototype.next = function() {\n      var type = this._type;\n      var stack = this._stack;\n      while (stack) {\n        var node = stack.node;\n        var index = stack.index++;\n        var maxIndex;\n        if (node.entry) {\n          if (index === 0) {\n            return mapIteratorValue(type, node.entry);\n          }\n        } else if (node.entries) {\n          maxIndex = node.entries.length - 1;\n          if (index <= maxIndex) {\n            return mapIteratorValue(type, node.entries[this._reverse ? maxIndex - index : index]);\n          }\n        } else {\n          maxIndex = node.nodes.length - 1;\n          if (index <= maxIndex) {\n            var subNode = node.nodes[this._reverse ? maxIndex - index : index];\n            if (subNode) {\n              if (subNode.entry) {\n                return mapIteratorValue(type, subNode.entry);\n              }\n              stack = this._stack = mapIteratorFrame(subNode, stack);\n            }\n            continue;\n          }\n        }\n        stack = this._stack = this._stack.__prev;\n      }\n      return iteratorDone();\n    };\n\n\n  function mapIteratorValue(type, entry) {\n    return iteratorValue(type, entry[0], entry[1]);\n  }\n\n  function mapIteratorFrame(node, prev) {\n    return {\n      node: node,\n      index: 0,\n      __prev: prev\n    };\n  }\n\n  function makeMap(size, root, ownerID, hash) {\n    var map = Object.create(MapPrototype);\n    map.size = size;\n    map._root = root;\n    map.__ownerID = ownerID;\n    map.__hash = hash;\n    map.__altered = false;\n    return map;\n  }\n\n  var EMPTY_MAP;\n  function emptyMap() {\n    return EMPTY_MAP || (EMPTY_MAP = makeMap(0));\n  }\n\n  function updateMap(map, k, v) {\n    var newRoot;\n    var newSize;\n    if (!map._root) {\n      if (v === NOT_SET) {\n        return map;\n      }\n      newSize = 1;\n      newRoot = new ArrayMapNode(map.__ownerID, [[k, v]]);\n    } else {\n      var didChangeSize = MakeRef(CHANGE_LENGTH);\n      var didAlter = MakeRef(DID_ALTER);\n      newRoot = updateNode(map._root, map.__ownerID, 0, undefined, k, v, didChangeSize, didAlter);\n      if (!didAlter.value) {\n        return map;\n      }\n      newSize = map.size + (didChangeSize.value ? v === NOT_SET ? -1 : 1 : 0);\n    }\n    if (map.__ownerID) {\n      map.size = newSize;\n      map._root = newRoot;\n      map.__hash = undefined;\n      map.__altered = true;\n      return map;\n    }\n    return newRoot ? makeMap(newSize, newRoot) : emptyMap();\n  }\n\n  function updateNode(node, ownerID, shift, keyHash, key, value, didChangeSize, didAlter) {\n    if (!node) {\n      if (value === NOT_SET) {\n        return node;\n      }\n      SetRef(didAlter);\n      SetRef(didChangeSize);\n      return new ValueNode(ownerID, keyHash, [key, value]);\n    }\n    return node.update(ownerID, shift, keyHash, key, value, didChangeSize, didAlter);\n  }\n\n  function isLeafNode(node) {\n    return node.constructor === ValueNode || node.constructor === HashCollisionNode;\n  }\n\n  function mergeIntoNode(node, ownerID, shift, keyHash, entry) {\n    if (node.keyHash === keyHash) {\n      return new HashCollisionNode(ownerID, keyHash, [node.entry, entry]);\n    }\n\n    var idx1 = (shift === 0 ? node.keyHash : node.keyHash >>> shift) & MASK;\n    var idx2 = (shift === 0 ? keyHash : keyHash >>> shift) & MASK;\n\n    var newNode;\n    var nodes = idx1 === idx2 ?\n      [mergeIntoNode(node, ownerID, shift + SHIFT, keyHash, entry)] :\n      ((newNode = new ValueNode(ownerID, keyHash, entry)), idx1 < idx2 ? [node, newNode] : [newNode, node]);\n\n    return new BitmapIndexedNode(ownerID, (1 << idx1) | (1 << idx2), nodes);\n  }\n\n  function createNodes(ownerID, entries, key, value) {\n    if (!ownerID) {\n      ownerID = new OwnerID();\n    }\n    var node = new ValueNode(ownerID, hash(key), [key, value]);\n    for (var ii = 0; ii < entries.length; ii++) {\n      var entry = entries[ii];\n      node = node.update(ownerID, 0, undefined, entry[0], entry[1]);\n    }\n    return node;\n  }\n\n  function packNodes(ownerID, nodes, count, excluding) {\n    var bitmap = 0;\n    var packedII = 0;\n    var packedNodes = new Array(count);\n    for (var ii = 0, bit = 1, len = nodes.length; ii < len; ii++, bit <<= 1) {\n      var node = nodes[ii];\n      if (node !== undefined && ii !== excluding) {\n        bitmap |= bit;\n        packedNodes[packedII++] = node;\n      }\n    }\n    return new BitmapIndexedNode(ownerID, bitmap, packedNodes);\n  }\n\n  function expandNodes(ownerID, nodes, bitmap, including, node) {\n    var count = 0;\n    var expandedNodes = new Array(SIZE);\n    for (var ii = 0; bitmap !== 0; ii++, bitmap >>>= 1) {\n      expandedNodes[ii] = bitmap & 1 ? nodes[count++] : undefined;\n    }\n    expandedNodes[including] = node;\n    return new HashArrayMapNode(ownerID, count + 1, expandedNodes);\n  }\n\n  function mergeIntoMapWith(map, merger, iterables) {\n    var iters = [];\n    for (var ii = 0; ii < iterables.length; ii++) {\n      var value = iterables[ii];\n      var iter = KeyedIterable(value);\n      if (!isIterable(value)) {\n        iter = iter.map(function(v ) {return fromJS(v)});\n      }\n      iters.push(iter);\n    }\n    return mergeIntoCollectionWith(map, merger, iters);\n  }\n\n  function deepMerger(existing, value, key) {\n    return existing && existing.mergeDeep && isIterable(value) ?\n      existing.mergeDeep(value) :\n      is(existing, value) ? existing : value;\n  }\n\n  function deepMergerWith(merger) {\n    return function(existing, value, key)  {\n      if (existing && existing.mergeDeepWith && isIterable(value)) {\n        return existing.mergeDeepWith(merger, value);\n      }\n      var nextValue = merger(existing, value, key);\n      return is(existing, nextValue) ? existing : nextValue;\n    };\n  }\n\n  function mergeIntoCollectionWith(collection, merger, iters) {\n    iters = iters.filter(function(x ) {return x.size !== 0});\n    if (iters.length === 0) {\n      return collection;\n    }\n    if (collection.size === 0 && !collection.__ownerID && iters.length === 1) {\n      return collection.constructor(iters[0]);\n    }\n    return collection.withMutations(function(collection ) {\n      var mergeIntoMap = merger ?\n        function(value, key)  {\n          collection.update(key, NOT_SET, function(existing )\n            {return existing === NOT_SET ? value : merger(existing, value, key)}\n          );\n        } :\n        function(value, key)  {\n          collection.set(key, value);\n        }\n      for (var ii = 0; ii < iters.length; ii++) {\n        iters[ii].forEach(mergeIntoMap);\n      }\n    });\n  }\n\n  function updateInDeepMap(existing, keyPathIter, notSetValue, updater) {\n    var isNotSet = existing === NOT_SET;\n    var step = keyPathIter.next();\n    if (step.done) {\n      var existingValue = isNotSet ? notSetValue : existing;\n      var newValue = updater(existingValue);\n      return newValue === existingValue ? existing : newValue;\n    }\n    invariant(\n      isNotSet || (existing && existing.set),\n      'invalid keyPath'\n    );\n    var key = step.value;\n    var nextExisting = isNotSet ? NOT_SET : existing.get(key, NOT_SET);\n    var nextUpdated = updateInDeepMap(\n      nextExisting,\n      keyPathIter,\n      notSetValue,\n      updater\n    );\n    return nextUpdated === nextExisting ? existing :\n      nextUpdated === NOT_SET ? existing.remove(key) :\n      (isNotSet ? emptyMap() : existing).set(key, nextUpdated);\n  }\n\n  function popCount(x) {\n    x = x - ((x >> 1) & 0x55555555);\n    x = (x & 0x33333333) + ((x >> 2) & 0x33333333);\n    x = (x + (x >> 4)) & 0x0f0f0f0f;\n    x = x + (x >> 8);\n    x = x + (x >> 16);\n    return x & 0x7f;\n  }\n\n  function setIn(array, idx, val, canEdit) {\n    var newArray = canEdit ? array : arrCopy(array);\n    newArray[idx] = val;\n    return newArray;\n  }\n\n  function spliceIn(array, idx, val, canEdit) {\n    var newLen = array.length + 1;\n    if (canEdit && idx + 1 === newLen) {\n      array[idx] = val;\n      return array;\n    }\n    var newArray = new Array(newLen);\n    var after = 0;\n    for (var ii = 0; ii < newLen; ii++) {\n      if (ii === idx) {\n        newArray[ii] = val;\n        after = -1;\n      } else {\n        newArray[ii] = array[ii + after];\n      }\n    }\n    return newArray;\n  }\n\n  function spliceOut(array, idx, canEdit) {\n    var newLen = array.length - 1;\n    if (canEdit && idx === newLen) {\n      array.pop();\n      return array;\n    }\n    var newArray = new Array(newLen);\n    var after = 0;\n    for (var ii = 0; ii < newLen; ii++) {\n      if (ii === idx) {\n        after = 1;\n      }\n      newArray[ii] = array[ii + after];\n    }\n    return newArray;\n  }\n\n  var MAX_ARRAY_MAP_SIZE = SIZE / 4;\n  var MAX_BITMAP_INDEXED_SIZE = SIZE / 2;\n  var MIN_HASH_ARRAY_MAP_SIZE = SIZE / 4;\n\n  createClass(List, IndexedCollection);\n\n    // @pragma Construction\n\n    function List(value) {\n      var empty = emptyList();\n      if (value === null || value === undefined) {\n        return empty;\n      }\n      if (isList(value)) {\n        return value;\n      }\n      var iter = IndexedIterable(value);\n      var size = iter.size;\n      if (size === 0) {\n        return empty;\n      }\n      assertNotInfinite(size);\n      if (size > 0 && size < SIZE) {\n        return makeList(0, size, SHIFT, null, new VNode(iter.toArray()));\n      }\n      return empty.withMutations(function(list ) {\n        list.setSize(size);\n        iter.forEach(function(v, i)  {return list.set(i, v)});\n      });\n    }\n\n    List.of = function(/*...values*/) {\n      return this(arguments);\n    };\n\n    List.prototype.toString = function() {\n      return this.__toString('List [', ']');\n    };\n\n    // @pragma Access\n\n    List.prototype.get = function(index, notSetValue) {\n      index = wrapIndex(this, index);\n      if (index >= 0 && index < this.size) {\n        index += this._origin;\n        var node = listNodeFor(this, index);\n        return node && node.array[index & MASK];\n      }\n      return notSetValue;\n    };\n\n    // @pragma Modification\n\n    List.prototype.set = function(index, value) {\n      return updateList(this, index, value);\n    };\n\n    List.prototype.remove = function(index) {\n      return !this.has(index) ? this :\n        index === 0 ? this.shift() :\n        index === this.size - 1 ? this.pop() :\n        this.splice(index, 1);\n    };\n\n    List.prototype.insert = function(index, value) {\n      return this.splice(index, 0, value);\n    };\n\n    List.prototype.clear = function() {\n      if (this.size === 0) {\n        return this;\n      }\n      if (this.__ownerID) {\n        this.size = this._origin = this._capacity = 0;\n        this._level = SHIFT;\n        this._root = this._tail = null;\n        this.__hash = undefined;\n        this.__altered = true;\n        return this;\n      }\n      return emptyList();\n    };\n\n    List.prototype.push = function(/*...values*/) {\n      var values = arguments;\n      var oldSize = this.size;\n      return this.withMutations(function(list ) {\n        setListBounds(list, 0, oldSize + values.length);\n        for (var ii = 0; ii < values.length; ii++) {\n          list.set(oldSize + ii, values[ii]);\n        }\n      });\n    };\n\n    List.prototype.pop = function() {\n      return setListBounds(this, 0, -1);\n    };\n\n    List.prototype.unshift = function(/*...values*/) {\n      var values = arguments;\n      return this.withMutations(function(list ) {\n        setListBounds(list, -values.length);\n        for (var ii = 0; ii < values.length; ii++) {\n          list.set(ii, values[ii]);\n        }\n      });\n    };\n\n    List.prototype.shift = function() {\n      return setListBounds(this, 1);\n    };\n\n    // @pragma Composition\n\n    List.prototype.merge = function(/*...iters*/) {\n      return mergeIntoListWith(this, undefined, arguments);\n    };\n\n    List.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1);\n      return mergeIntoListWith(this, merger, iters);\n    };\n\n    List.prototype.mergeDeep = function(/*...iters*/) {\n      return mergeIntoListWith(this, deepMerger, arguments);\n    };\n\n    List.prototype.mergeDeepWith = function(merger) {var iters = SLICE$0.call(arguments, 1);\n      return mergeIntoListWith(this, deepMergerWith(merger), iters);\n    };\n\n    List.prototype.setSize = function(size) {\n      return setListBounds(this, 0, size);\n    };\n\n    // @pragma Iteration\n\n    List.prototype.slice = function(begin, end) {\n      var size = this.size;\n      if (wholeSlice(begin, end, size)) {\n        return this;\n      }\n      return setListBounds(\n        this,\n        resolveBegin(begin, size),\n        resolveEnd(end, size)\n      );\n    };\n\n    List.prototype.__iterator = function(type, reverse) {\n      var index = 0;\n      var values = iterateList(this, reverse);\n      return new Iterator(function()  {\n        var value = values();\n        return value === DONE ?\n          iteratorDone() :\n          iteratorValue(type, index++, value);\n      });\n    };\n\n    List.prototype.__iterate = function(fn, reverse) {\n      var index = 0;\n      var values = iterateList(this, reverse);\n      var value;\n      while ((value = values()) !== DONE) {\n        if (fn(value, index++, this) === false) {\n          break;\n        }\n      }\n      return index;\n    };\n\n    List.prototype.__ensureOwner = function(ownerID) {\n      if (ownerID === this.__ownerID) {\n        return this;\n      }\n      if (!ownerID) {\n        this.__ownerID = ownerID;\n        return this;\n      }\n      return makeList(this._origin, this._capacity, this._level, this._root, this._tail, ownerID, this.__hash);\n    };\n\n\n  function isList(maybeList) {\n    return !!(maybeList && maybeList[IS_LIST_SENTINEL]);\n  }\n\n  List.isList = isList;\n\n  var IS_LIST_SENTINEL = '@@__IMMUTABLE_LIST__@@';\n\n  var ListPrototype = List.prototype;\n  ListPrototype[IS_LIST_SENTINEL] = true;\n  ListPrototype[DELETE] = ListPrototype.remove;\n  ListPrototype.setIn = MapPrototype.setIn;\n  ListPrototype.deleteIn =\n  ListPrototype.removeIn = MapPrototype.removeIn;\n  ListPrototype.update = MapPrototype.update;\n  ListPrototype.updateIn = MapPrototype.updateIn;\n  ListPrototype.mergeIn = MapPrototype.mergeIn;\n  ListPrototype.mergeDeepIn = MapPrototype.mergeDeepIn;\n  ListPrototype.withMutations = MapPrototype.withMutations;\n  ListPrototype.asMutable = MapPrototype.asMutable;\n  ListPrototype.asImmutable = MapPrototype.asImmutable;\n  ListPrototype.wasAltered = MapPrototype.wasAltered;\n\n\n\n    function VNode(array, ownerID) {\n      this.array = array;\n      this.ownerID = ownerID;\n    }\n\n    // TODO: seems like these methods are very similar\n\n    VNode.prototype.removeBefore = function(ownerID, level, index) {\n      if (index === level ? 1 << level : 0 || this.array.length === 0) {\n        return this;\n      }\n      var originIndex = (index >>> level) & MASK;\n      if (originIndex >= this.array.length) {\n        return new VNode([], ownerID);\n      }\n      var removingFirst = originIndex === 0;\n      var newChild;\n      if (level > 0) {\n        var oldChild = this.array[originIndex];\n        newChild = oldChild && oldChild.removeBefore(ownerID, level - SHIFT, index);\n        if (newChild === oldChild && removingFirst) {\n          return this;\n        }\n      }\n      if (removingFirst && !newChild) {\n        return this;\n      }\n      var editable = editableVNode(this, ownerID);\n      if (!removingFirst) {\n        for (var ii = 0; ii < originIndex; ii++) {\n          editable.array[ii] = undefined;\n        }\n      }\n      if (newChild) {\n        editable.array[originIndex] = newChild;\n      }\n      return editable;\n    };\n\n    VNode.prototype.removeAfter = function(ownerID, level, index) {\n      if (index === (level ? 1 << level : 0) || this.array.length === 0) {\n        return this;\n      }\n      var sizeIndex = ((index - 1) >>> level) & MASK;\n      if (sizeIndex >= this.array.length) {\n        return this;\n      }\n\n      var newChild;\n      if (level > 0) {\n        var oldChild = this.array[sizeIndex];\n        newChild = oldChild && oldChild.removeAfter(ownerID, level - SHIFT, index);\n        if (newChild === oldChild && sizeIndex === this.array.length - 1) {\n          return this;\n        }\n      }\n\n      var editable = editableVNode(this, ownerID);\n      editable.array.splice(sizeIndex + 1);\n      if (newChild) {\n        editable.array[sizeIndex] = newChild;\n      }\n      return editable;\n    };\n\n\n\n  var DONE = {};\n\n  function iterateList(list, reverse) {\n    var left = list._origin;\n    var right = list._capacity;\n    var tailPos = getTailOffset(right);\n    var tail = list._tail;\n\n    return iterateNodeOrLeaf(list._root, list._level, 0);\n\n    function iterateNodeOrLeaf(node, level, offset) {\n      return level === 0 ?\n        iterateLeaf(node, offset) :\n        iterateNode(node, level, offset);\n    }\n\n    function iterateLeaf(node, offset) {\n      var array = offset === tailPos ? tail && tail.array : node && node.array;\n      var from = offset > left ? 0 : left - offset;\n      var to = right - offset;\n      if (to > SIZE) {\n        to = SIZE;\n      }\n      return function()  {\n        if (from === to) {\n          return DONE;\n        }\n        var idx = reverse ? --to : from++;\n        return array && array[idx];\n      };\n    }\n\n    function iterateNode(node, level, offset) {\n      var values;\n      var array = node && node.array;\n      var from = offset > left ? 0 : (left - offset) >> level;\n      var to = ((right - offset) >> level) + 1;\n      if (to > SIZE) {\n        to = SIZE;\n      }\n      return function()  {\n        do {\n          if (values) {\n            var value = values();\n            if (value !== DONE) {\n              return value;\n            }\n            values = null;\n          }\n          if (from === to) {\n            return DONE;\n          }\n          var idx = reverse ? --to : from++;\n          values = iterateNodeOrLeaf(\n            array && array[idx], level - SHIFT, offset + (idx << level)\n          );\n        } while (true);\n      };\n    }\n  }\n\n  function makeList(origin, capacity, level, root, tail, ownerID, hash) {\n    var list = Object.create(ListPrototype);\n    list.size = capacity - origin;\n    list._origin = origin;\n    list._capacity = capacity;\n    list._level = level;\n    list._root = root;\n    list._tail = tail;\n    list.__ownerID = ownerID;\n    list.__hash = hash;\n    list.__altered = false;\n    return list;\n  }\n\n  var EMPTY_LIST;\n  function emptyList() {\n    return EMPTY_LIST || (EMPTY_LIST = makeList(0, 0, SHIFT));\n  }\n\n  function updateList(list, index, value) {\n    index = wrapIndex(list, index);\n\n    if (index !== index) {\n      return list;\n    }\n\n    if (index >= list.size || index < 0) {\n      return list.withMutations(function(list ) {\n        index < 0 ?\n          setListBounds(list, index).set(0, value) :\n          setListBounds(list, 0, index + 1).set(index, value)\n      });\n    }\n\n    index += list._origin;\n\n    var newTail = list._tail;\n    var newRoot = list._root;\n    var didAlter = MakeRef(DID_ALTER);\n    if (index >= getTailOffset(list._capacity)) {\n      newTail = updateVNode(newTail, list.__ownerID, 0, index, value, didAlter);\n    } else {\n      newRoot = updateVNode(newRoot, list.__ownerID, list._level, index, value, didAlter);\n    }\n\n    if (!didAlter.value) {\n      return list;\n    }\n\n    if (list.__ownerID) {\n      list._root = newRoot;\n      list._tail = newTail;\n      list.__hash = undefined;\n      list.__altered = true;\n      return list;\n    }\n    return makeList(list._origin, list._capacity, list._level, newRoot, newTail);\n  }\n\n  function updateVNode(node, ownerID, level, index, value, didAlter) {\n    var idx = (index >>> level) & MASK;\n    var nodeHas = node && idx < node.array.length;\n    if (!nodeHas && value === undefined) {\n      return node;\n    }\n\n    var newNode;\n\n    if (level > 0) {\n      var lowerNode = node && node.array[idx];\n      var newLowerNode = updateVNode(lowerNode, ownerID, level - SHIFT, index, value, didAlter);\n      if (newLowerNode === lowerNode) {\n        return node;\n      }\n      newNode = editableVNode(node, ownerID);\n      newNode.array[idx] = newLowerNode;\n      return newNode;\n    }\n\n    if (nodeHas && node.array[idx] === value) {\n      return node;\n    }\n\n    SetRef(didAlter);\n\n    newNode = editableVNode(node, ownerID);\n    if (value === undefined && idx === newNode.array.length - 1) {\n      newNode.array.pop();\n    } else {\n      newNode.array[idx] = value;\n    }\n    return newNode;\n  }\n\n  function editableVNode(node, ownerID) {\n    if (ownerID && node && ownerID === node.ownerID) {\n      return node;\n    }\n    return new VNode(node ? node.array.slice() : [], ownerID);\n  }\n\n  function listNodeFor(list, rawIndex) {\n    if (rawIndex >= getTailOffset(list._capacity)) {\n      return list._tail;\n    }\n    if (rawIndex < 1 << (list._level + SHIFT)) {\n      var node = list._root;\n      var level = list._level;\n      while (node && level > 0) {\n        node = node.array[(rawIndex >>> level) & MASK];\n        level -= SHIFT;\n      }\n      return node;\n    }\n  }\n\n  function setListBounds(list, begin, end) {\n    // Sanitize begin & end using this shorthand for ToInt32(argument)\n    // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32\n    if (begin !== undefined) {\n      begin = begin | 0;\n    }\n    if (end !== undefined) {\n      end = end | 0;\n    }\n    var owner = list.__ownerID || new OwnerID();\n    var oldOrigin = list._origin;\n    var oldCapacity = list._capacity;\n    var newOrigin = oldOrigin + begin;\n    var newCapacity = end === undefined ? oldCapacity : end < 0 ? oldCapacity + end : oldOrigin + end;\n    if (newOrigin === oldOrigin && newCapacity === oldCapacity) {\n      return list;\n    }\n\n    // If it's going to end after it starts, it's empty.\n    if (newOrigin >= newCapacity) {\n      return list.clear();\n    }\n\n    var newLevel = list._level;\n    var newRoot = list._root;\n\n    // New origin might need creating a higher root.\n    var offsetShift = 0;\n    while (newOrigin + offsetShift < 0) {\n      newRoot = new VNode(newRoot && newRoot.array.length ? [undefined, newRoot] : [], owner);\n      newLevel += SHIFT;\n      offsetShift += 1 << newLevel;\n    }\n    if (offsetShift) {\n      newOrigin += offsetShift;\n      oldOrigin += offsetShift;\n      newCapacity += offsetShift;\n      oldCapacity += offsetShift;\n    }\n\n    var oldTailOffset = getTailOffset(oldCapacity);\n    var newTailOffset = getTailOffset(newCapacity);\n\n    // New size might need creating a higher root.\n    while (newTailOffset >= 1 << (newLevel + SHIFT)) {\n      newRoot = new VNode(newRoot && newRoot.array.length ? [newRoot] : [], owner);\n      newLevel += SHIFT;\n    }\n\n    // Locate or create the new tail.\n    var oldTail = list._tail;\n    var newTail = newTailOffset < oldTailOffset ?\n      listNodeFor(list, newCapacity - 1) :\n      newTailOffset > oldTailOffset ? new VNode([], owner) : oldTail;\n\n    // Merge Tail into tree.\n    if (oldTail && newTailOffset > oldTailOffset && newOrigin < oldCapacity && oldTail.array.length) {\n      newRoot = editableVNode(newRoot, owner);\n      var node = newRoot;\n      for (var level = newLevel; level > SHIFT; level -= SHIFT) {\n        var idx = (oldTailOffset >>> level) & MASK;\n        node = node.array[idx] = editableVNode(node.array[idx], owner);\n      }\n      node.array[(oldTailOffset >>> SHIFT) & MASK] = oldTail;\n    }\n\n    // If the size has been reduced, there's a chance the tail needs to be trimmed.\n    if (newCapacity < oldCapacity) {\n      newTail = newTail && newTail.removeAfter(owner, 0, newCapacity);\n    }\n\n    // If the new origin is within the tail, then we do not need a root.\n    if (newOrigin >= newTailOffset) {\n      newOrigin -= newTailOffset;\n      newCapacity -= newTailOffset;\n      newLevel = SHIFT;\n      newRoot = null;\n      newTail = newTail && newTail.removeBefore(owner, 0, newOrigin);\n\n    // Otherwise, if the root has been trimmed, garbage collect.\n    } else if (newOrigin > oldOrigin || newTailOffset < oldTailOffset) {\n      offsetShift = 0;\n\n      // Identify the new top root node of the subtree of the old root.\n      while (newRoot) {\n        var beginIndex = (newOrigin >>> newLevel) & MASK;\n        if (beginIndex !== (newTailOffset >>> newLevel) & MASK) {\n          break;\n        }\n        if (beginIndex) {\n          offsetShift += (1 << newLevel) * beginIndex;\n        }\n        newLevel -= SHIFT;\n        newRoot = newRoot.array[beginIndex];\n      }\n\n      // Trim the new sides of the new root.\n      if (newRoot && newOrigin > oldOrigin) {\n        newRoot = newRoot.removeBefore(owner, newLevel, newOrigin - offsetShift);\n      }\n      if (newRoot && newTailOffset < oldTailOffset) {\n        newRoot = newRoot.removeAfter(owner, newLevel, newTailOffset - offsetShift);\n      }\n      if (offsetShift) {\n        newOrigin -= offsetShift;\n        newCapacity -= offsetShift;\n      }\n    }\n\n    if (list.__ownerID) {\n      list.size = newCapacity - newOrigin;\n      list._origin = newOrigin;\n      list._capacity = newCapacity;\n      list._level = newLevel;\n      list._root = newRoot;\n      list._tail = newTail;\n      list.__hash = undefined;\n      list.__altered = true;\n      return list;\n    }\n    return makeList(newOrigin, newCapacity, newLevel, newRoot, newTail);\n  }\n\n  function mergeIntoListWith(list, merger, iterables) {\n    var iters = [];\n    var maxSize = 0;\n    for (var ii = 0; ii < iterables.length; ii++) {\n      var value = iterables[ii];\n      var iter = IndexedIterable(value);\n      if (iter.size > maxSize) {\n        maxSize = iter.size;\n      }\n      if (!isIterable(value)) {\n        iter = iter.map(function(v ) {return fromJS(v)});\n      }\n      iters.push(iter);\n    }\n    if (maxSize > list.size) {\n      list = list.setSize(maxSize);\n    }\n    return mergeIntoCollectionWith(list, merger, iters);\n  }\n\n  function getTailOffset(size) {\n    return size < SIZE ? 0 : (((size - 1) >>> SHIFT) << SHIFT);\n  }\n\n  createClass(OrderedMap, Map);\n\n    // @pragma Construction\n\n    function OrderedMap(value) {\n      return value === null || value === undefined ? emptyOrderedMap() :\n        isOrderedMap(value) ? value :\n        emptyOrderedMap().withMutations(function(map ) {\n          var iter = KeyedIterable(value);\n          assertNotInfinite(iter.size);\n          iter.forEach(function(v, k)  {return map.set(k, v)});\n        });\n    }\n\n    OrderedMap.of = function(/*...values*/) {\n      return this(arguments);\n    };\n\n    OrderedMap.prototype.toString = function() {\n      return this.__toString('OrderedMap {', '}');\n    };\n\n    // @pragma Access\n\n    OrderedMap.prototype.get = function(k, notSetValue) {\n      var index = this._map.get(k);\n      return index !== undefined ? this._list.get(index)[1] : notSetValue;\n    };\n\n    // @pragma Modification\n\n    OrderedMap.prototype.clear = function() {\n      if (this.size === 0) {\n        return this;\n      }\n      if (this.__ownerID) {\n        this.size = 0;\n        this._map.clear();\n        this._list.clear();\n        return this;\n      }\n      return emptyOrderedMap();\n    };\n\n    OrderedMap.prototype.set = function(k, v) {\n      return updateOrderedMap(this, k, v);\n    };\n\n    OrderedMap.prototype.remove = function(k) {\n      return updateOrderedMap(this, k, NOT_SET);\n    };\n\n    OrderedMap.prototype.wasAltered = function() {\n      return this._map.wasAltered() || this._list.wasAltered();\n    };\n\n    OrderedMap.prototype.__iterate = function(fn, reverse) {var this$0 = this;\n      return this._list.__iterate(\n        function(entry ) {return entry && fn(entry[1], entry[0], this$0)},\n        reverse\n      );\n    };\n\n    OrderedMap.prototype.__iterator = function(type, reverse) {\n      return this._list.fromEntrySeq().__iterator(type, reverse);\n    };\n\n    OrderedMap.prototype.__ensureOwner = function(ownerID) {\n      if (ownerID === this.__ownerID) {\n        return this;\n      }\n      var newMap = this._map.__ensureOwner(ownerID);\n      var newList = this._list.__ensureOwner(ownerID);\n      if (!ownerID) {\n        this.__ownerID = ownerID;\n        this._map = newMap;\n        this._list = newList;\n        return this;\n      }\n      return makeOrderedMap(newMap, newList, ownerID, this.__hash);\n    };\n\n\n  function isOrderedMap(maybeOrderedMap) {\n    return isMap(maybeOrderedMap) && isOrdered(maybeOrderedMap);\n  }\n\n  OrderedMap.isOrderedMap = isOrderedMap;\n\n  OrderedMap.prototype[IS_ORDERED_SENTINEL] = true;\n  OrderedMap.prototype[DELETE] = OrderedMap.prototype.remove;\n\n\n\n  function makeOrderedMap(map, list, ownerID, hash) {\n    var omap = Object.create(OrderedMap.prototype);\n    omap.size = map ? map.size : 0;\n    omap._map = map;\n    omap._list = list;\n    omap.__ownerID = ownerID;\n    omap.__hash = hash;\n    return omap;\n  }\n\n  var EMPTY_ORDERED_MAP;\n  function emptyOrderedMap() {\n    return EMPTY_ORDERED_MAP || (EMPTY_ORDERED_MAP = makeOrderedMap(emptyMap(), emptyList()));\n  }\n\n  function updateOrderedMap(omap, k, v) {\n    var map = omap._map;\n    var list = omap._list;\n    var i = map.get(k);\n    var has = i !== undefined;\n    var newMap;\n    var newList;\n    if (v === NOT_SET) { // removed\n      if (!has) {\n        return omap;\n      }\n      if (list.size >= SIZE && list.size >= map.size * 2) {\n        newList = list.filter(function(entry, idx)  {return entry !== undefined && i !== idx});\n        newMap = newList.toKeyedSeq().map(function(entry ) {return entry[0]}).flip().toMap();\n        if (omap.__ownerID) {\n          newMap.__ownerID = newList.__ownerID = omap.__ownerID;\n        }\n      } else {\n        newMap = map.remove(k);\n        newList = i === list.size - 1 ? list.pop() : list.set(i, undefined);\n      }\n    } else {\n      if (has) {\n        if (v === list.get(i)[1]) {\n          return omap;\n        }\n        newMap = map;\n        newList = list.set(i, [k, v]);\n      } else {\n        newMap = map.set(k, list.size);\n        newList = list.set(list.size, [k, v]);\n      }\n    }\n    if (omap.__ownerID) {\n      omap.size = newMap.size;\n      omap._map = newMap;\n      omap._list = newList;\n      omap.__hash = undefined;\n      return omap;\n    }\n    return makeOrderedMap(newMap, newList);\n  }\n\n  createClass(ToKeyedSequence, KeyedSeq);\n    function ToKeyedSequence(indexed, useKeys) {\n      this._iter = indexed;\n      this._useKeys = useKeys;\n      this.size = indexed.size;\n    }\n\n    ToKeyedSequence.prototype.get = function(key, notSetValue) {\n      return this._iter.get(key, notSetValue);\n    };\n\n    ToKeyedSequence.prototype.has = function(key) {\n      return this._iter.has(key);\n    };\n\n    ToKeyedSequence.prototype.valueSeq = function() {\n      return this._iter.valueSeq();\n    };\n\n    ToKeyedSequence.prototype.reverse = function() {var this$0 = this;\n      var reversedSequence = reverseFactory(this, true);\n      if (!this._useKeys) {\n        reversedSequence.valueSeq = function()  {return this$0._iter.toSeq().reverse()};\n      }\n      return reversedSequence;\n    };\n\n    ToKeyedSequence.prototype.map = function(mapper, context) {var this$0 = this;\n      var mappedSequence = mapFactory(this, mapper, context);\n      if (!this._useKeys) {\n        mappedSequence.valueSeq = function()  {return this$0._iter.toSeq().map(mapper, context)};\n      }\n      return mappedSequence;\n    };\n\n    ToKeyedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;\n      var ii;\n      return this._iter.__iterate(\n        this._useKeys ?\n          function(v, k)  {return fn(v, k, this$0)} :\n          ((ii = reverse ? resolveSize(this) : 0),\n            function(v ) {return fn(v, reverse ? --ii : ii++, this$0)}),\n        reverse\n      );\n    };\n\n    ToKeyedSequence.prototype.__iterator = function(type, reverse) {\n      if (this._useKeys) {\n        return this._iter.__iterator(type, reverse);\n      }\n      var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n      var ii = reverse ? resolveSize(this) : 0;\n      return new Iterator(function()  {\n        var step = iterator.next();\n        return step.done ? step :\n          iteratorValue(type, reverse ? --ii : ii++, step.value, step);\n      });\n    };\n\n  ToKeyedSequence.prototype[IS_ORDERED_SENTINEL] = true;\n\n\n  createClass(ToIndexedSequence, IndexedSeq);\n    function ToIndexedSequence(iter) {\n      this._iter = iter;\n      this.size = iter.size;\n    }\n\n    ToIndexedSequence.prototype.includes = function(value) {\n      return this._iter.includes(value);\n    };\n\n    ToIndexedSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;\n      var iterations = 0;\n      return this._iter.__iterate(function(v ) {return fn(v, iterations++, this$0)}, reverse);\n    };\n\n    ToIndexedSequence.prototype.__iterator = function(type, reverse) {\n      var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n      var iterations = 0;\n      return new Iterator(function()  {\n        var step = iterator.next();\n        return step.done ? step :\n          iteratorValue(type, iterations++, step.value, step)\n      });\n    };\n\n\n\n  createClass(ToSetSequence, SetSeq);\n    function ToSetSequence(iter) {\n      this._iter = iter;\n      this.size = iter.size;\n    }\n\n    ToSetSequence.prototype.has = function(key) {\n      return this._iter.includes(key);\n    };\n\n    ToSetSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;\n      return this._iter.__iterate(function(v ) {return fn(v, v, this$0)}, reverse);\n    };\n\n    ToSetSequence.prototype.__iterator = function(type, reverse) {\n      var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n      return new Iterator(function()  {\n        var step = iterator.next();\n        return step.done ? step :\n          iteratorValue(type, step.value, step.value, step);\n      });\n    };\n\n\n\n  createClass(FromEntriesSequence, KeyedSeq);\n    function FromEntriesSequence(entries) {\n      this._iter = entries;\n      this.size = entries.size;\n    }\n\n    FromEntriesSequence.prototype.entrySeq = function() {\n      return this._iter.toSeq();\n    };\n\n    FromEntriesSequence.prototype.__iterate = function(fn, reverse) {var this$0 = this;\n      return this._iter.__iterate(function(entry ) {\n        // Check if entry exists first so array access doesn't throw for holes\n        // in the parent iteration.\n        if (entry) {\n          validateEntry(entry);\n          var indexedIterable = isIterable(entry);\n          return fn(\n            indexedIterable ? entry.get(1) : entry[1],\n            indexedIterable ? entry.get(0) : entry[0],\n            this$0\n          );\n        }\n      }, reverse);\n    };\n\n    FromEntriesSequence.prototype.__iterator = function(type, reverse) {\n      var iterator = this._iter.__iterator(ITERATE_VALUES, reverse);\n      return new Iterator(function()  {\n        while (true) {\n          var step = iterator.next();\n          if (step.done) {\n            return step;\n          }\n          var entry = step.value;\n          // Check if entry exists first so array access doesn't throw for holes\n          // in the parent iteration.\n          if (entry) {\n            validateEntry(entry);\n            var indexedIterable = isIterable(entry);\n            return iteratorValue(\n              type,\n              indexedIterable ? entry.get(0) : entry[0],\n              indexedIterable ? entry.get(1) : entry[1],\n              step\n            );\n          }\n        }\n      });\n    };\n\n\n  ToIndexedSequence.prototype.cacheResult =\n  ToKeyedSequence.prototype.cacheResult =\n  ToSetSequence.prototype.cacheResult =\n  FromEntriesSequence.prototype.cacheResult =\n    cacheResultThrough;\n\n\n  function flipFactory(iterable) {\n    var flipSequence = makeSequence(iterable);\n    flipSequence._iter = iterable;\n    flipSequence.size = iterable.size;\n    flipSequence.flip = function()  {return iterable};\n    flipSequence.reverse = function () {\n      var reversedSequence = iterable.reverse.apply(this); // super.reverse()\n      reversedSequence.flip = function()  {return iterable.reverse()};\n      return reversedSequence;\n    };\n    flipSequence.has = function(key ) {return iterable.includes(key)};\n    flipSequence.includes = function(key ) {return iterable.has(key)};\n    flipSequence.cacheResult = cacheResultThrough;\n    flipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;\n      return iterable.__iterate(function(v, k)  {return fn(k, v, this$0) !== false}, reverse);\n    }\n    flipSequence.__iteratorUncached = function(type, reverse) {\n      if (type === ITERATE_ENTRIES) {\n        var iterator = iterable.__iterator(type, reverse);\n        return new Iterator(function()  {\n          var step = iterator.next();\n          if (!step.done) {\n            var k = step.value[0];\n            step.value[0] = step.value[1];\n            step.value[1] = k;\n          }\n          return step;\n        });\n      }\n      return iterable.__iterator(\n        type === ITERATE_VALUES ? ITERATE_KEYS : ITERATE_VALUES,\n        reverse\n      );\n    }\n    return flipSequence;\n  }\n\n\n  function mapFactory(iterable, mapper, context) {\n    var mappedSequence = makeSequence(iterable);\n    mappedSequence.size = iterable.size;\n    mappedSequence.has = function(key ) {return iterable.has(key)};\n    mappedSequence.get = function(key, notSetValue)  {\n      var v = iterable.get(key, NOT_SET);\n      return v === NOT_SET ?\n        notSetValue :\n        mapper.call(context, v, key, iterable);\n    };\n    mappedSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;\n      return iterable.__iterate(\n        function(v, k, c)  {return fn(mapper.call(context, v, k, c), k, this$0) !== false},\n        reverse\n      );\n    }\n    mappedSequence.__iteratorUncached = function (type, reverse) {\n      var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n      return new Iterator(function()  {\n        var step = iterator.next();\n        if (step.done) {\n          return step;\n        }\n        var entry = step.value;\n        var key = entry[0];\n        return iteratorValue(\n          type,\n          key,\n          mapper.call(context, entry[1], key, iterable),\n          step\n        );\n      });\n    }\n    return mappedSequence;\n  }\n\n\n  function reverseFactory(iterable, useKeys) {\n    var reversedSequence = makeSequence(iterable);\n    reversedSequence._iter = iterable;\n    reversedSequence.size = iterable.size;\n    reversedSequence.reverse = function()  {return iterable};\n    if (iterable.flip) {\n      reversedSequence.flip = function () {\n        var flipSequence = flipFactory(iterable);\n        flipSequence.reverse = function()  {return iterable.flip()};\n        return flipSequence;\n      };\n    }\n    reversedSequence.get = function(key, notSetValue) \n      {return iterable.get(useKeys ? key : -1 - key, notSetValue)};\n    reversedSequence.has = function(key )\n      {return iterable.has(useKeys ? key : -1 - key)};\n    reversedSequence.includes = function(value ) {return iterable.includes(value)};\n    reversedSequence.cacheResult = cacheResultThrough;\n    reversedSequence.__iterate = function (fn, reverse) {var this$0 = this;\n      return iterable.__iterate(function(v, k)  {return fn(v, k, this$0)}, !reverse);\n    };\n    reversedSequence.__iterator =\n      function(type, reverse)  {return iterable.__iterator(type, !reverse)};\n    return reversedSequence;\n  }\n\n\n  function filterFactory(iterable, predicate, context, useKeys) {\n    var filterSequence = makeSequence(iterable);\n    if (useKeys) {\n      filterSequence.has = function(key ) {\n        var v = iterable.get(key, NOT_SET);\n        return v !== NOT_SET && !!predicate.call(context, v, key, iterable);\n      };\n      filterSequence.get = function(key, notSetValue)  {\n        var v = iterable.get(key, NOT_SET);\n        return v !== NOT_SET && predicate.call(context, v, key, iterable) ?\n          v : notSetValue;\n      };\n    }\n    filterSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;\n      var iterations = 0;\n      iterable.__iterate(function(v, k, c)  {\n        if (predicate.call(context, v, k, c)) {\n          iterations++;\n          return fn(v, useKeys ? k : iterations - 1, this$0);\n        }\n      }, reverse);\n      return iterations;\n    };\n    filterSequence.__iteratorUncached = function (type, reverse) {\n      var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n      var iterations = 0;\n      return new Iterator(function()  {\n        while (true) {\n          var step = iterator.next();\n          if (step.done) {\n            return step;\n          }\n          var entry = step.value;\n          var key = entry[0];\n          var value = entry[1];\n          if (predicate.call(context, value, key, iterable)) {\n            return iteratorValue(type, useKeys ? key : iterations++, value, step);\n          }\n        }\n      });\n    }\n    return filterSequence;\n  }\n\n\n  function countByFactory(iterable, grouper, context) {\n    var groups = Map().asMutable();\n    iterable.__iterate(function(v, k)  {\n      groups.update(\n        grouper.call(context, v, k, iterable),\n        0,\n        function(a ) {return a + 1}\n      );\n    });\n    return groups.asImmutable();\n  }\n\n\n  function groupByFactory(iterable, grouper, context) {\n    var isKeyedIter = isKeyed(iterable);\n    var groups = (isOrdered(iterable) ? OrderedMap() : Map()).asMutable();\n    iterable.__iterate(function(v, k)  {\n      groups.update(\n        grouper.call(context, v, k, iterable),\n        function(a ) {return (a = a || [], a.push(isKeyedIter ? [k, v] : v), a)}\n      );\n    });\n    var coerce = iterableClass(iterable);\n    return groups.map(function(arr ) {return reify(iterable, coerce(arr))});\n  }\n\n\n  function sliceFactory(iterable, begin, end, useKeys) {\n    var originalSize = iterable.size;\n\n    // Sanitize begin & end using this shorthand for ToInt32(argument)\n    // http://www.ecma-international.org/ecma-262/6.0/#sec-toint32\n    if (begin !== undefined) {\n      begin = begin | 0;\n    }\n    if (end !== undefined) {\n      end = end | 0;\n    }\n\n    if (wholeSlice(begin, end, originalSize)) {\n      return iterable;\n    }\n\n    var resolvedBegin = resolveBegin(begin, originalSize);\n    var resolvedEnd = resolveEnd(end, originalSize);\n\n    // begin or end will be NaN if they were provided as negative numbers and\n    // this iterable's size is unknown. In that case, cache first so there is\n    // a known size and these do not resolve to NaN.\n    if (resolvedBegin !== resolvedBegin || resolvedEnd !== resolvedEnd) {\n      return sliceFactory(iterable.toSeq().cacheResult(), begin, end, useKeys);\n    }\n\n    // Note: resolvedEnd is undefined when the original sequence's length is\n    // unknown and this slice did not supply an end and should contain all\n    // elements after resolvedBegin.\n    // In that case, resolvedSize will be NaN and sliceSize will remain undefined.\n    var resolvedSize = resolvedEnd - resolvedBegin;\n    var sliceSize;\n    if (resolvedSize === resolvedSize) {\n      sliceSize = resolvedSize < 0 ? 0 : resolvedSize;\n    }\n\n    var sliceSeq = makeSequence(iterable);\n\n    // If iterable.size is undefined, the size of the realized sliceSeq is\n    // unknown at this point unless the number of items to slice is 0\n    sliceSeq.size = sliceSize === 0 ? sliceSize : iterable.size && sliceSize || undefined;\n\n    if (!useKeys && isSeq(iterable) && sliceSize >= 0) {\n      sliceSeq.get = function (index, notSetValue) {\n        index = wrapIndex(this, index);\n        return index >= 0 && index < sliceSize ?\n          iterable.get(index + resolvedBegin, notSetValue) :\n          notSetValue;\n      }\n    }\n\n    sliceSeq.__iterateUncached = function(fn, reverse) {var this$0 = this;\n      if (sliceSize === 0) {\n        return 0;\n      }\n      if (reverse) {\n        return this.cacheResult().__iterate(fn, reverse);\n      }\n      var skipped = 0;\n      var isSkipping = true;\n      var iterations = 0;\n      iterable.__iterate(function(v, k)  {\n        if (!(isSkipping && (isSkipping = skipped++ < resolvedBegin))) {\n          iterations++;\n          return fn(v, useKeys ? k : iterations - 1, this$0) !== false &&\n                 iterations !== sliceSize;\n        }\n      });\n      return iterations;\n    };\n\n    sliceSeq.__iteratorUncached = function(type, reverse) {\n      if (sliceSize !== 0 && reverse) {\n        return this.cacheResult().__iterator(type, reverse);\n      }\n      // Don't bother instantiating parent iterator if taking 0.\n      var iterator = sliceSize !== 0 && iterable.__iterator(type, reverse);\n      var skipped = 0;\n      var iterations = 0;\n      return new Iterator(function()  {\n        while (skipped++ < resolvedBegin) {\n          iterator.next();\n        }\n        if (++iterations > sliceSize) {\n          return iteratorDone();\n        }\n        var step = iterator.next();\n        if (useKeys || type === ITERATE_VALUES) {\n          return step;\n        } else if (type === ITERATE_KEYS) {\n          return iteratorValue(type, iterations - 1, undefined, step);\n        } else {\n          return iteratorValue(type, iterations - 1, step.value[1], step);\n        }\n      });\n    }\n\n    return sliceSeq;\n  }\n\n\n  function takeWhileFactory(iterable, predicate, context) {\n    var takeSequence = makeSequence(iterable);\n    takeSequence.__iterateUncached = function(fn, reverse) {var this$0 = this;\n      if (reverse) {\n        return this.cacheResult().__iterate(fn, reverse);\n      }\n      var iterations = 0;\n      iterable.__iterate(function(v, k, c) \n        {return predicate.call(context, v, k, c) && ++iterations && fn(v, k, this$0)}\n      );\n      return iterations;\n    };\n    takeSequence.__iteratorUncached = function(type, reverse) {var this$0 = this;\n      if (reverse) {\n        return this.cacheResult().__iterator(type, reverse);\n      }\n      var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n      var iterating = true;\n      return new Iterator(function()  {\n        if (!iterating) {\n          return iteratorDone();\n        }\n        var step = iterator.next();\n        if (step.done) {\n          return step;\n        }\n        var entry = step.value;\n        var k = entry[0];\n        var v = entry[1];\n        if (!predicate.call(context, v, k, this$0)) {\n          iterating = false;\n          return iteratorDone();\n        }\n        return type === ITERATE_ENTRIES ? step :\n          iteratorValue(type, k, v, step);\n      });\n    };\n    return takeSequence;\n  }\n\n\n  function skipWhileFactory(iterable, predicate, context, useKeys) {\n    var skipSequence = makeSequence(iterable);\n    skipSequence.__iterateUncached = function (fn, reverse) {var this$0 = this;\n      if (reverse) {\n        return this.cacheResult().__iterate(fn, reverse);\n      }\n      var isSkipping = true;\n      var iterations = 0;\n      iterable.__iterate(function(v, k, c)  {\n        if (!(isSkipping && (isSkipping = predicate.call(context, v, k, c)))) {\n          iterations++;\n          return fn(v, useKeys ? k : iterations - 1, this$0);\n        }\n      });\n      return iterations;\n    };\n    skipSequence.__iteratorUncached = function(type, reverse) {var this$0 = this;\n      if (reverse) {\n        return this.cacheResult().__iterator(type, reverse);\n      }\n      var iterator = iterable.__iterator(ITERATE_ENTRIES, reverse);\n      var skipping = true;\n      var iterations = 0;\n      return new Iterator(function()  {\n        var step, k, v;\n        do {\n          step = iterator.next();\n          if (step.done) {\n            if (useKeys || type === ITERATE_VALUES) {\n              return step;\n            } else if (type === ITERATE_KEYS) {\n              return iteratorValue(type, iterations++, undefined, step);\n            } else {\n              return iteratorValue(type, iterations++, step.value[1], step);\n            }\n          }\n          var entry = step.value;\n          k = entry[0];\n          v = entry[1];\n          skipping && (skipping = predicate.call(context, v, k, this$0));\n        } while (skipping);\n        return type === ITERATE_ENTRIES ? step :\n          iteratorValue(type, k, v, step);\n      });\n    };\n    return skipSequence;\n  }\n\n\n  function concatFactory(iterable, values) {\n    var isKeyedIterable = isKeyed(iterable);\n    var iters = [iterable].concat(values).map(function(v ) {\n      if (!isIterable(v)) {\n        v = isKeyedIterable ?\n          keyedSeqFromValue(v) :\n          indexedSeqFromValue(Array.isArray(v) ? v : [v]);\n      } else if (isKeyedIterable) {\n        v = KeyedIterable(v);\n      }\n      return v;\n    }).filter(function(v ) {return v.size !== 0});\n\n    if (iters.length === 0) {\n      return iterable;\n    }\n\n    if (iters.length === 1) {\n      var singleton = iters[0];\n      if (singleton === iterable ||\n          isKeyedIterable && isKeyed(singleton) ||\n          isIndexed(iterable) && isIndexed(singleton)) {\n        return singleton;\n      }\n    }\n\n    var concatSeq = new ArraySeq(iters);\n    if (isKeyedIterable) {\n      concatSeq = concatSeq.toKeyedSeq();\n    } else if (!isIndexed(iterable)) {\n      concatSeq = concatSeq.toSetSeq();\n    }\n    concatSeq = concatSeq.flatten(true);\n    concatSeq.size = iters.reduce(\n      function(sum, seq)  {\n        if (sum !== undefined) {\n          var size = seq.size;\n          if (size !== undefined) {\n            return sum + size;\n          }\n        }\n      },\n      0\n    );\n    return concatSeq;\n  }\n\n\n  function flattenFactory(iterable, depth, useKeys) {\n    var flatSequence = makeSequence(iterable);\n    flatSequence.__iterateUncached = function(fn, reverse) {\n      var iterations = 0;\n      var stopped = false;\n      function flatDeep(iter, currentDepth) {var this$0 = this;\n        iter.__iterate(function(v, k)  {\n          if ((!depth || currentDepth < depth) && isIterable(v)) {\n            flatDeep(v, currentDepth + 1);\n          } else if (fn(v, useKeys ? k : iterations++, this$0) === false) {\n            stopped = true;\n          }\n          return !stopped;\n        }, reverse);\n      }\n      flatDeep(iterable, 0);\n      return iterations;\n    }\n    flatSequence.__iteratorUncached = function(type, reverse) {\n      var iterator = iterable.__iterator(type, reverse);\n      var stack = [];\n      var iterations = 0;\n      return new Iterator(function()  {\n        while (iterator) {\n          var step = iterator.next();\n          if (step.done !== false) {\n            iterator = stack.pop();\n            continue;\n          }\n          var v = step.value;\n          if (type === ITERATE_ENTRIES) {\n            v = v[1];\n          }\n          if ((!depth || stack.length < depth) && isIterable(v)) {\n            stack.push(iterator);\n            iterator = v.__iterator(type, reverse);\n          } else {\n            return useKeys ? step : iteratorValue(type, iterations++, v, step);\n          }\n        }\n        return iteratorDone();\n      });\n    }\n    return flatSequence;\n  }\n\n\n  function flatMapFactory(iterable, mapper, context) {\n    var coerce = iterableClass(iterable);\n    return iterable.toSeq().map(\n      function(v, k)  {return coerce(mapper.call(context, v, k, iterable))}\n    ).flatten(true);\n  }\n\n\n  function interposeFactory(iterable, separator) {\n    var interposedSequence = makeSequence(iterable);\n    interposedSequence.size = iterable.size && iterable.size * 2 -1;\n    interposedSequence.__iterateUncached = function(fn, reverse) {var this$0 = this;\n      var iterations = 0;\n      iterable.__iterate(function(v, k) \n        {return (!iterations || fn(separator, iterations++, this$0) !== false) &&\n        fn(v, iterations++, this$0) !== false},\n        reverse\n      );\n      return iterations;\n    };\n    interposedSequence.__iteratorUncached = function(type, reverse) {\n      var iterator = iterable.__iterator(ITERATE_VALUES, reverse);\n      var iterations = 0;\n      var step;\n      return new Iterator(function()  {\n        if (!step || iterations % 2) {\n          step = iterator.next();\n          if (step.done) {\n            return step;\n          }\n        }\n        return iterations % 2 ?\n          iteratorValue(type, iterations++, separator) :\n          iteratorValue(type, iterations++, step.value, step);\n      });\n    };\n    return interposedSequence;\n  }\n\n\n  function sortFactory(iterable, comparator, mapper) {\n    if (!comparator) {\n      comparator = defaultComparator;\n    }\n    var isKeyedIterable = isKeyed(iterable);\n    var index = 0;\n    var entries = iterable.toSeq().map(\n      function(v, k)  {return [k, v, index++, mapper ? mapper(v, k, iterable) : v]}\n    ).toArray();\n    entries.sort(function(a, b)  {return comparator(a[3], b[3]) || a[2] - b[2]}).forEach(\n      isKeyedIterable ?\n      function(v, i)  { entries[i].length = 2; } :\n      function(v, i)  { entries[i] = v[1]; }\n    );\n    return isKeyedIterable ? KeyedSeq(entries) :\n      isIndexed(iterable) ? IndexedSeq(entries) :\n      SetSeq(entries);\n  }\n\n\n  function maxFactory(iterable, comparator, mapper) {\n    if (!comparator) {\n      comparator = defaultComparator;\n    }\n    if (mapper) {\n      var entry = iterable.toSeq()\n        .map(function(v, k)  {return [v, mapper(v, k, iterable)]})\n        .reduce(function(a, b)  {return maxCompare(comparator, a[1], b[1]) ? b : a});\n      return entry && entry[0];\n    } else {\n      return iterable.reduce(function(a, b)  {return maxCompare(comparator, a, b) ? b : a});\n    }\n  }\n\n  function maxCompare(comparator, a, b) {\n    var comp = comparator(b, a);\n    // b is considered the new max if the comparator declares them equal, but\n    // they are not equal and b is in fact a nullish value.\n    return (comp === 0 && b !== a && (b === undefined || b === null || b !== b)) || comp > 0;\n  }\n\n\n  function zipWithFactory(keyIter, zipper, iters) {\n    var zipSequence = makeSequence(keyIter);\n    zipSequence.size = new ArraySeq(iters).map(function(i ) {return i.size}).min();\n    // Note: this a generic base implementation of __iterate in terms of\n    // __iterator which may be more generically useful in the future.\n    zipSequence.__iterate = function(fn, reverse) {\n      /* generic:\n      var iterator = this.__iterator(ITERATE_ENTRIES, reverse);\n      var step;\n      var iterations = 0;\n      while (!(step = iterator.next()).done) {\n        iterations++;\n        if (fn(step.value[1], step.value[0], this) === false) {\n          break;\n        }\n      }\n      return iterations;\n      */\n      // indexed:\n      var iterator = this.__iterator(ITERATE_VALUES, reverse);\n      var step;\n      var iterations = 0;\n      while (!(step = iterator.next()).done) {\n        if (fn(step.value, iterations++, this) === false) {\n          break;\n        }\n      }\n      return iterations;\n    };\n    zipSequence.__iteratorUncached = function(type, reverse) {\n      var iterators = iters.map(function(i )\n        {return (i = Iterable(i), getIterator(reverse ? i.reverse() : i))}\n      );\n      var iterations = 0;\n      var isDone = false;\n      return new Iterator(function()  {\n        var steps;\n        if (!isDone) {\n          steps = iterators.map(function(i ) {return i.next()});\n          isDone = steps.some(function(s ) {return s.done});\n        }\n        if (isDone) {\n          return iteratorDone();\n        }\n        return iteratorValue(\n          type,\n          iterations++,\n          zipper.apply(null, steps.map(function(s ) {return s.value}))\n        );\n      });\n    };\n    return zipSequence\n  }\n\n\n  // #pragma Helper Functions\n\n  function reify(iter, seq) {\n    return isSeq(iter) ? seq : iter.constructor(seq);\n  }\n\n  function validateEntry(entry) {\n    if (entry !== Object(entry)) {\n      throw new TypeError('Expected [K, V] tuple: ' + entry);\n    }\n  }\n\n  function resolveSize(iter) {\n    assertNotInfinite(iter.size);\n    return ensureSize(iter);\n  }\n\n  function iterableClass(iterable) {\n    return isKeyed(iterable) ? KeyedIterable :\n      isIndexed(iterable) ? IndexedIterable :\n      SetIterable;\n  }\n\n  function makeSequence(iterable) {\n    return Object.create(\n      (\n        isKeyed(iterable) ? KeyedSeq :\n        isIndexed(iterable) ? IndexedSeq :\n        SetSeq\n      ).prototype\n    );\n  }\n\n  function cacheResultThrough() {\n    if (this._iter.cacheResult) {\n      this._iter.cacheResult();\n      this.size = this._iter.size;\n      return this;\n    } else {\n      return Seq.prototype.cacheResult.call(this);\n    }\n  }\n\n  function defaultComparator(a, b) {\n    return a > b ? 1 : a < b ? -1 : 0;\n  }\n\n  function forceIterator(keyPath) {\n    var iter = getIterator(keyPath);\n    if (!iter) {\n      // Array might not be iterable in this environment, so we need a fallback\n      // to our wrapped type.\n      if (!isArrayLike(keyPath)) {\n        throw new TypeError('Expected iterable or array-like: ' + keyPath);\n      }\n      iter = getIterator(Iterable(keyPath));\n    }\n    return iter;\n  }\n\n  createClass(Record, KeyedCollection);\n\n    function Record(defaultValues, name) {\n      var hasInitialized;\n\n      var RecordType = function Record(values) {\n        if (values instanceof RecordType) {\n          return values;\n        }\n        if (!(this instanceof RecordType)) {\n          return new RecordType(values);\n        }\n        if (!hasInitialized) {\n          hasInitialized = true;\n          var keys = Object.keys(defaultValues);\n          setProps(RecordTypePrototype, keys);\n          RecordTypePrototype.size = keys.length;\n          RecordTypePrototype._name = name;\n          RecordTypePrototype._keys = keys;\n          RecordTypePrototype._defaultValues = defaultValues;\n        }\n        this._map = Map(values);\n      };\n\n      var RecordTypePrototype = RecordType.prototype = Object.create(RecordPrototype);\n      RecordTypePrototype.constructor = RecordType;\n\n      return RecordType;\n    }\n\n    Record.prototype.toString = function() {\n      return this.__toString(recordName(this) + ' {', '}');\n    };\n\n    // @pragma Access\n\n    Record.prototype.has = function(k) {\n      return this._defaultValues.hasOwnProperty(k);\n    };\n\n    Record.prototype.get = function(k, notSetValue) {\n      if (!this.has(k)) {\n        return notSetValue;\n      }\n      var defaultVal = this._defaultValues[k];\n      return this._map ? this._map.get(k, defaultVal) : defaultVal;\n    };\n\n    // @pragma Modification\n\n    Record.prototype.clear = function() {\n      if (this.__ownerID) {\n        this._map && this._map.clear();\n        return this;\n      }\n      var RecordType = this.constructor;\n      return RecordType._empty || (RecordType._empty = makeRecord(this, emptyMap()));\n    };\n\n    Record.prototype.set = function(k, v) {\n      if (!this.has(k)) {\n        throw new Error('Cannot set unknown key \"' + k + '\" on ' + recordName(this));\n      }\n      var newMap = this._map && this._map.set(k, v);\n      if (this.__ownerID || newMap === this._map) {\n        return this;\n      }\n      return makeRecord(this, newMap);\n    };\n\n    Record.prototype.remove = function(k) {\n      if (!this.has(k)) {\n        return this;\n      }\n      var newMap = this._map && this._map.remove(k);\n      if (this.__ownerID || newMap === this._map) {\n        return this;\n      }\n      return makeRecord(this, newMap);\n    };\n\n    Record.prototype.wasAltered = function() {\n      return this._map.wasAltered();\n    };\n\n    Record.prototype.__iterator = function(type, reverse) {var this$0 = this;\n      return KeyedIterable(this._defaultValues).map(function(_, k)  {return this$0.get(k)}).__iterator(type, reverse);\n    };\n\n    Record.prototype.__iterate = function(fn, reverse) {var this$0 = this;\n      return KeyedIterable(this._defaultValues).map(function(_, k)  {return this$0.get(k)}).__iterate(fn, reverse);\n    };\n\n    Record.prototype.__ensureOwner = function(ownerID) {\n      if (ownerID === this.__ownerID) {\n        return this;\n      }\n      var newMap = this._map && this._map.__ensureOwner(ownerID);\n      if (!ownerID) {\n        this.__ownerID = ownerID;\n        this._map = newMap;\n        return this;\n      }\n      return makeRecord(this, newMap, ownerID);\n    };\n\n\n  var RecordPrototype = Record.prototype;\n  RecordPrototype[DELETE] = RecordPrototype.remove;\n  RecordPrototype.deleteIn =\n  RecordPrototype.removeIn = MapPrototype.removeIn;\n  RecordPrototype.merge = MapPrototype.merge;\n  RecordPrototype.mergeWith = MapPrototype.mergeWith;\n  RecordPrototype.mergeIn = MapPrototype.mergeIn;\n  RecordPrototype.mergeDeep = MapPrototype.mergeDeep;\n  RecordPrototype.mergeDeepWith = MapPrototype.mergeDeepWith;\n  RecordPrototype.mergeDeepIn = MapPrototype.mergeDeepIn;\n  RecordPrototype.setIn = MapPrototype.setIn;\n  RecordPrototype.update = MapPrototype.update;\n  RecordPrototype.updateIn = MapPrototype.updateIn;\n  RecordPrototype.withMutations = MapPrototype.withMutations;\n  RecordPrototype.asMutable = MapPrototype.asMutable;\n  RecordPrototype.asImmutable = MapPrototype.asImmutable;\n\n\n  function makeRecord(likeRecord, map, ownerID) {\n    var record = Object.create(Object.getPrototypeOf(likeRecord));\n    record._map = map;\n    record.__ownerID = ownerID;\n    return record;\n  }\n\n  function recordName(record) {\n    return record._name || record.constructor.name || 'Record';\n  }\n\n  function setProps(prototype, names) {\n    try {\n      names.forEach(setProp.bind(undefined, prototype));\n    } catch (error) {\n      // Object.defineProperty failed. Probably IE8.\n    }\n  }\n\n  function setProp(prototype, name) {\n    Object.defineProperty(prototype, name, {\n      get: function() {\n        return this.get(name);\n      },\n      set: function(value) {\n        invariant(this.__ownerID, 'Cannot set on an immutable record.');\n        this.set(name, value);\n      }\n    });\n  }\n\n  createClass(Set, SetCollection);\n\n    // @pragma Construction\n\n    function Set(value) {\n      return value === null || value === undefined ? emptySet() :\n        isSet(value) && !isOrdered(value) ? value :\n        emptySet().withMutations(function(set ) {\n          var iter = SetIterable(value);\n          assertNotInfinite(iter.size);\n          iter.forEach(function(v ) {return set.add(v)});\n        });\n    }\n\n    Set.of = function(/*...values*/) {\n      return this(arguments);\n    };\n\n    Set.fromKeys = function(value) {\n      return this(KeyedIterable(value).keySeq());\n    };\n\n    Set.prototype.toString = function() {\n      return this.__toString('Set {', '}');\n    };\n\n    // @pragma Access\n\n    Set.prototype.has = function(value) {\n      return this._map.has(value);\n    };\n\n    // @pragma Modification\n\n    Set.prototype.add = function(value) {\n      return updateSet(this, this._map.set(value, true));\n    };\n\n    Set.prototype.remove = function(value) {\n      return updateSet(this, this._map.remove(value));\n    };\n\n    Set.prototype.clear = function() {\n      return updateSet(this, this._map.clear());\n    };\n\n    // @pragma Composition\n\n    Set.prototype.union = function() {var iters = SLICE$0.call(arguments, 0);\n      iters = iters.filter(function(x ) {return x.size !== 0});\n      if (iters.length === 0) {\n        return this;\n      }\n      if (this.size === 0 && !this.__ownerID && iters.length === 1) {\n        return this.constructor(iters[0]);\n      }\n      return this.withMutations(function(set ) {\n        for (var ii = 0; ii < iters.length; ii++) {\n          SetIterable(iters[ii]).forEach(function(value ) {return set.add(value)});\n        }\n      });\n    };\n\n    Set.prototype.intersect = function() {var iters = SLICE$0.call(arguments, 0);\n      if (iters.length === 0) {\n        return this;\n      }\n      iters = iters.map(function(iter ) {return SetIterable(iter)});\n      var originalSet = this;\n      return this.withMutations(function(set ) {\n        originalSet.forEach(function(value ) {\n          if (!iters.every(function(iter ) {return iter.includes(value)})) {\n            set.remove(value);\n          }\n        });\n      });\n    };\n\n    Set.prototype.subtract = function() {var iters = SLICE$0.call(arguments, 0);\n      if (iters.length === 0) {\n        return this;\n      }\n      iters = iters.map(function(iter ) {return SetIterable(iter)});\n      var originalSet = this;\n      return this.withMutations(function(set ) {\n        originalSet.forEach(function(value ) {\n          if (iters.some(function(iter ) {return iter.includes(value)})) {\n            set.remove(value);\n          }\n        });\n      });\n    };\n\n    Set.prototype.merge = function() {\n      return this.union.apply(this, arguments);\n    };\n\n    Set.prototype.mergeWith = function(merger) {var iters = SLICE$0.call(arguments, 1);\n      return this.union.apply(this, iters);\n    };\n\n    Set.prototype.sort = function(comparator) {\n      // Late binding\n      return OrderedSet(sortFactory(this, comparator));\n    };\n\n    Set.prototype.sortBy = function(mapper, comparator) {\n      // Late binding\n      return OrderedSet(sortFactory(this, comparator, mapper));\n    };\n\n    Set.prototype.wasAltered = function() {\n      return this._map.wasAltered();\n    };\n\n    Set.prototype.__iterate = function(fn, reverse) {var this$0 = this;\n      return this._map.__iterate(function(_, k)  {return fn(k, k, this$0)}, reverse);\n    };\n\n    Set.prototype.__iterator = function(type, reverse) {\n      return this._map.map(function(_, k)  {return k}).__iterator(type, reverse);\n    };\n\n    Set.prototype.__ensureOwner = function(ownerID) {\n      if (ownerID === this.__ownerID) {\n        return this;\n      }\n      var newMap = this._map.__ensureOwner(ownerID);\n      if (!ownerID) {\n        this.__ownerID = ownerID;\n        this._map = newMap;\n        return this;\n      }\n      return this.__make(newMap, ownerID);\n    };\n\n\n  function isSet(maybeSet) {\n    return !!(maybeSet && maybeSet[IS_SET_SENTINEL]);\n  }\n\n  Set.isSet = isSet;\n\n  var IS_SET_SENTINEL = '@@__IMMUTABLE_SET__@@';\n\n  var SetPrototype = Set.prototype;\n  SetPrototype[IS_SET_SENTINEL] = true;\n  SetPrototype[DELETE] = SetPrototype.remove;\n  SetPrototype.mergeDeep = SetPrototype.merge;\n  SetPrototype.mergeDeepWith = SetPrototype.mergeWith;\n  SetPrototype.withMutations = MapPrototype.withMutations;\n  SetPrototype.asMutable = MapPrototype.asMutable;\n  SetPrototype.asImmutable = MapPrototype.asImmutable;\n\n  SetPrototype.__empty = emptySet;\n  SetPrototype.__make = makeSet;\n\n  function updateSet(set, newMap) {\n    if (set.__ownerID) {\n      set.size = newMap.size;\n      set._map = newMap;\n      return set;\n    }\n    return newMap === set._map ? set :\n      newMap.size === 0 ? set.__empty() :\n      set.__make(newMap);\n  }\n\n  function makeSet(map, ownerID) {\n    var set = Object.create(SetPrototype);\n    set.size = map ? map.size : 0;\n    set._map = map;\n    set.__ownerID = ownerID;\n    return set;\n  }\n\n  var EMPTY_SET;\n  function emptySet() {\n    return EMPTY_SET || (EMPTY_SET = makeSet(emptyMap()));\n  }\n\n  createClass(OrderedSet, Set);\n\n    // @pragma Construction\n\n    function OrderedSet(value) {\n      return value === null || value === undefined ? emptyOrderedSet() :\n        isOrderedSet(value) ? value :\n        emptyOrderedSet().withMutations(function(set ) {\n          var iter = SetIterable(value);\n          assertNotInfinite(iter.size);\n          iter.forEach(function(v ) {return set.add(v)});\n        });\n    }\n\n    OrderedSet.of = function(/*...values*/) {\n      return this(arguments);\n    };\n\n    OrderedSet.fromKeys = function(value) {\n      return this(KeyedIterable(value).keySeq());\n    };\n\n    OrderedSet.prototype.toString = function() {\n      return this.__toString('OrderedSet {', '}');\n    };\n\n\n  function isOrderedSet(maybeOrderedSet) {\n    return isSet(maybeOrderedSet) && isOrdered(maybeOrderedSet);\n  }\n\n  OrderedSet.isOrderedSet = isOrderedSet;\n\n  var OrderedSetPrototype = OrderedSet.prototype;\n  OrderedSetPrototype[IS_ORDERED_SENTINEL] = true;\n\n  OrderedSetPrototype.__empty = emptyOrderedSet;\n  OrderedSetPrototype.__make = makeOrderedSet;\n\n  function makeOrderedSet(map, ownerID) {\n    var set = Object.create(OrderedSetPrototype);\n    set.size = map ? map.size : 0;\n    set._map = map;\n    set.__ownerID = ownerID;\n    return set;\n  }\n\n  var EMPTY_ORDERED_SET;\n  function emptyOrderedSet() {\n    return EMPTY_ORDERED_SET || (EMPTY_ORDERED_SET = makeOrderedSet(emptyOrderedMap()));\n  }\n\n  createClass(Stack, IndexedCollection);\n\n    // @pragma Construction\n\n    function Stack(value) {\n      return value === null || value === undefined ? emptyStack() :\n        isStack(value) ? value :\n        emptyStack().unshiftAll(value);\n    }\n\n    Stack.of = function(/*...values*/) {\n      return this(arguments);\n    };\n\n    Stack.prototype.toString = function() {\n      return this.__toString('Stack [', ']');\n    };\n\n    // @pragma Access\n\n    Stack.prototype.get = function(index, notSetValue) {\n      var head = this._head;\n      index = wrapIndex(this, index);\n      while (head && index--) {\n        head = head.next;\n      }\n      return head ? head.value : notSetValue;\n    };\n\n    Stack.prototype.peek = function() {\n      return this._head && this._head.value;\n    };\n\n    // @pragma Modification\n\n    Stack.prototype.push = function(/*...values*/) {\n      if (arguments.length === 0) {\n        return this;\n      }\n      var newSize = this.size + arguments.length;\n      var head = this._head;\n      for (var ii = arguments.length - 1; ii >= 0; ii--) {\n        head = {\n          value: arguments[ii],\n          next: head\n        };\n      }\n      if (this.__ownerID) {\n        this.size = newSize;\n        this._head = head;\n        this.__hash = undefined;\n        this.__altered = true;\n        return this;\n      }\n      return makeStack(newSize, head);\n    };\n\n    Stack.prototype.pushAll = function(iter) {\n      iter = IndexedIterable(iter);\n      if (iter.size === 0) {\n        return this;\n      }\n      assertNotInfinite(iter.size);\n      var newSize = this.size;\n      var head = this._head;\n      iter.reverse().forEach(function(value ) {\n        newSize++;\n        head = {\n          value: value,\n          next: head\n        };\n      });\n      if (this.__ownerID) {\n        this.size = newSize;\n        this._head = head;\n        this.__hash = undefined;\n        this.__altered = true;\n        return this;\n      }\n      return makeStack(newSize, head);\n    };\n\n    Stack.prototype.pop = function() {\n      return this.slice(1);\n    };\n\n    Stack.prototype.unshift = function(/*...values*/) {\n      return this.push.apply(this, arguments);\n    };\n\n    Stack.prototype.unshiftAll = function(iter) {\n      return this.pushAll(iter);\n    };\n\n    Stack.prototype.shift = function() {\n      return this.pop.apply(this, arguments);\n    };\n\n    Stack.prototype.clear = function() {\n      if (this.size === 0) {\n        return this;\n      }\n      if (this.__ownerID) {\n        this.size = 0;\n        this._head = undefined;\n        this.__hash = undefined;\n        this.__altered = true;\n        return this;\n      }\n      return emptyStack();\n    };\n\n    Stack.prototype.slice = function(begin, end) {\n      if (wholeSlice(begin, end, this.size)) {\n        return this;\n      }\n      var resolvedBegin = resolveBegin(begin, this.size);\n      var resolvedEnd = resolveEnd(end, this.size);\n      if (resolvedEnd !== this.size) {\n        // super.slice(begin, end);\n        return IndexedCollection.prototype.slice.call(this, begin, end);\n      }\n      var newSize = this.size - resolvedBegin;\n      var head = this._head;\n      while (resolvedBegin--) {\n        head = head.next;\n      }\n      if (this.__ownerID) {\n        this.size = newSize;\n        this._head = head;\n        this.__hash = undefined;\n        this.__altered = true;\n        return this;\n      }\n      return makeStack(newSize, head);\n    };\n\n    // @pragma Mutability\n\n    Stack.prototype.__ensureOwner = function(ownerID) {\n      if (ownerID === this.__ownerID) {\n        return this;\n      }\n      if (!ownerID) {\n        this.__ownerID = ownerID;\n        this.__altered = false;\n        return this;\n      }\n      return makeStack(this.size, this._head, ownerID, this.__hash);\n    };\n\n    // @pragma Iteration\n\n    Stack.prototype.__iterate = function(fn, reverse) {\n      if (reverse) {\n        return this.reverse().__iterate(fn);\n      }\n      var iterations = 0;\n      var node = this._head;\n      while (node) {\n        if (fn(node.value, iterations++, this) === false) {\n          break;\n        }\n        node = node.next;\n      }\n      return iterations;\n    };\n\n    Stack.prototype.__iterator = function(type, reverse) {\n      if (reverse) {\n        return this.reverse().__iterator(type);\n      }\n      var iterations = 0;\n      var node = this._head;\n      return new Iterator(function()  {\n        if (node) {\n          var value = node.value;\n          node = node.next;\n          return iteratorValue(type, iterations++, value);\n        }\n        return iteratorDone();\n      });\n    };\n\n\n  function isStack(maybeStack) {\n    return !!(maybeStack && maybeStack[IS_STACK_SENTINEL]);\n  }\n\n  Stack.isStack = isStack;\n\n  var IS_STACK_SENTINEL = '@@__IMMUTABLE_STACK__@@';\n\n  var StackPrototype = Stack.prototype;\n  StackPrototype[IS_STACK_SENTINEL] = true;\n  StackPrototype.withMutations = MapPrototype.withMutations;\n  StackPrototype.asMutable = MapPrototype.asMutable;\n  StackPrototype.asImmutable = MapPrototype.asImmutable;\n  StackPrototype.wasAltered = MapPrototype.wasAltered;\n\n\n  function makeStack(size, head, ownerID, hash) {\n    var map = Object.create(StackPrototype);\n    map.size = size;\n    map._head = head;\n    map.__ownerID = ownerID;\n    map.__hash = hash;\n    map.__altered = false;\n    return map;\n  }\n\n  var EMPTY_STACK;\n  function emptyStack() {\n    return EMPTY_STACK || (EMPTY_STACK = makeStack(0));\n  }\n\n  /**\n   * Contributes additional methods to a constructor\n   */\n  function mixin(ctor, methods) {\n    var keyCopier = function(key ) { ctor.prototype[key] = methods[key]; };\n    Object.keys(methods).forEach(keyCopier);\n    Object.getOwnPropertySymbols &&\n      Object.getOwnPropertySymbols(methods).forEach(keyCopier);\n    return ctor;\n  }\n\n  Iterable.Iterator = Iterator;\n\n  mixin(Iterable, {\n\n    // ### Conversion to other types\n\n    toArray: function() {\n      assertNotInfinite(this.size);\n      var array = new Array(this.size || 0);\n      this.valueSeq().__iterate(function(v, i)  { array[i] = v; });\n      return array;\n    },\n\n    toIndexedSeq: function() {\n      return new ToIndexedSequence(this);\n    },\n\n    toJS: function() {\n      return this.toSeq().map(\n        function(value ) {return value && typeof value.toJS === 'function' ? value.toJS() : value}\n      ).__toJS();\n    },\n\n    toJSON: function() {\n      return this.toSeq().map(\n        function(value ) {return value && typeof value.toJSON === 'function' ? value.toJSON() : value}\n      ).__toJS();\n    },\n\n    toKeyedSeq: function() {\n      return new ToKeyedSequence(this, true);\n    },\n\n    toMap: function() {\n      // Use Late Binding here to solve the circular dependency.\n      return Map(this.toKeyedSeq());\n    },\n\n    toObject: function() {\n      assertNotInfinite(this.size);\n      var object = {};\n      this.__iterate(function(v, k)  { object[k] = v; });\n      return object;\n    },\n\n    toOrderedMap: function() {\n      // Use Late Binding here to solve the circular dependency.\n      return OrderedMap(this.toKeyedSeq());\n    },\n\n    toOrderedSet: function() {\n      // Use Late Binding here to solve the circular dependency.\n      return OrderedSet(isKeyed(this) ? this.valueSeq() : this);\n    },\n\n    toSet: function() {\n      // Use Late Binding here to solve the circular dependency.\n      return Set(isKeyed(this) ? this.valueSeq() : this);\n    },\n\n    toSetSeq: function() {\n      return new ToSetSequence(this);\n    },\n\n    toSeq: function() {\n      return isIndexed(this) ? this.toIndexedSeq() :\n        isKeyed(this) ? this.toKeyedSeq() :\n        this.toSetSeq();\n    },\n\n    toStack: function() {\n      // Use Late Binding here to solve the circular dependency.\n      return Stack(isKeyed(this) ? this.valueSeq() : this);\n    },\n\n    toList: function() {\n      // Use Late Binding here to solve the circular dependency.\n      return List(isKeyed(this) ? this.valueSeq() : this);\n    },\n\n\n    // ### Common JavaScript methods and properties\n\n    toString: function() {\n      return '[Iterable]';\n    },\n\n    __toString: function(head, tail) {\n      if (this.size === 0) {\n        return head + tail;\n      }\n      return head + ' ' + this.toSeq().map(this.__toStringMapper).join(', ') + ' ' + tail;\n    },\n\n\n    // ### ES6 Collection methods (ES6 Array and Map)\n\n    concat: function() {var values = SLICE$0.call(arguments, 0);\n      return reify(this, concatFactory(this, values));\n    },\n\n    includes: function(searchValue) {\n      return this.some(function(value ) {return is(value, searchValue)});\n    },\n\n    entries: function() {\n      return this.__iterator(ITERATE_ENTRIES);\n    },\n\n    every: function(predicate, context) {\n      assertNotInfinite(this.size);\n      var returnValue = true;\n      this.__iterate(function(v, k, c)  {\n        if (!predicate.call(context, v, k, c)) {\n          returnValue = false;\n          return false;\n        }\n      });\n      return returnValue;\n    },\n\n    filter: function(predicate, context) {\n      return reify(this, filterFactory(this, predicate, context, true));\n    },\n\n    find: function(predicate, context, notSetValue) {\n      var entry = this.findEntry(predicate, context);\n      return entry ? entry[1] : notSetValue;\n    },\n\n    findEntry: function(predicate, context) {\n      var found;\n      this.__iterate(function(v, k, c)  {\n        if (predicate.call(context, v, k, c)) {\n          found = [k, v];\n          return false;\n        }\n      });\n      return found;\n    },\n\n    findLastEntry: function(predicate, context) {\n      return this.toSeq().reverse().findEntry(predicate, context);\n    },\n\n    forEach: function(sideEffect, context) {\n      assertNotInfinite(this.size);\n      return this.__iterate(context ? sideEffect.bind(context) : sideEffect);\n    },\n\n    join: function(separator) {\n      assertNotInfinite(this.size);\n      separator = separator !== undefined ? '' + separator : ',';\n      var joined = '';\n      var isFirst = true;\n      this.__iterate(function(v ) {\n        isFirst ? (isFirst = false) : (joined += separator);\n        joined += v !== null && v !== undefined ? v.toString() : '';\n      });\n      return joined;\n    },\n\n    keys: function() {\n      return this.__iterator(ITERATE_KEYS);\n    },\n\n    map: function(mapper, context) {\n      return reify(this, mapFactory(this, mapper, context));\n    },\n\n    reduce: function(reducer, initialReduction, context) {\n      assertNotInfinite(this.size);\n      var reduction;\n      var useFirst;\n      if (arguments.length < 2) {\n        useFirst = true;\n      } else {\n        reduction = initialReduction;\n      }\n      this.__iterate(function(v, k, c)  {\n        if (useFirst) {\n          useFirst = false;\n          reduction = v;\n        } else {\n          reduction = reducer.call(context, reduction, v, k, c);\n        }\n      });\n      return reduction;\n    },\n\n    reduceRight: function(reducer, initialReduction, context) {\n      var reversed = this.toKeyedSeq().reverse();\n      return reversed.reduce.apply(reversed, arguments);\n    },\n\n    reverse: function() {\n      return reify(this, reverseFactory(this, true));\n    },\n\n    slice: function(begin, end) {\n      return reify(this, sliceFactory(this, begin, end, true));\n    },\n\n    some: function(predicate, context) {\n      return !this.every(not(predicate), context);\n    },\n\n    sort: function(comparator) {\n      return reify(this, sortFactory(this, comparator));\n    },\n\n    values: function() {\n      return this.__iterator(ITERATE_VALUES);\n    },\n\n\n    // ### More sequential methods\n\n    butLast: function() {\n      return this.slice(0, -1);\n    },\n\n    isEmpty: function() {\n      return this.size !== undefined ? this.size === 0 : !this.some(function()  {return true});\n    },\n\n    count: function(predicate, context) {\n      return ensureSize(\n        predicate ? this.toSeq().filter(predicate, context) : this\n      );\n    },\n\n    countBy: function(grouper, context) {\n      return countByFactory(this, grouper, context);\n    },\n\n    equals: function(other) {\n      return deepEqual(this, other);\n    },\n\n    entrySeq: function() {\n      var iterable = this;\n      if (iterable._cache) {\n        // We cache as an entries array, so we can just return the cache!\n        return new ArraySeq(iterable._cache);\n      }\n      var entriesSequence = iterable.toSeq().map(entryMapper).toIndexedSeq();\n      entriesSequence.fromEntrySeq = function()  {return iterable.toSeq()};\n      return entriesSequence;\n    },\n\n    filterNot: function(predicate, context) {\n      return this.filter(not(predicate), context);\n    },\n\n    findLast: function(predicate, context, notSetValue) {\n      return this.toKeyedSeq().reverse().find(predicate, context, notSetValue);\n    },\n\n    first: function() {\n      return this.find(returnTrue);\n    },\n\n    flatMap: function(mapper, context) {\n      return reify(this, flatMapFactory(this, mapper, context));\n    },\n\n    flatten: function(depth) {\n      return reify(this, flattenFactory(this, depth, true));\n    },\n\n    fromEntrySeq: function() {\n      return new FromEntriesSequence(this);\n    },\n\n    get: function(searchKey, notSetValue) {\n      return this.find(function(_, key)  {return is(key, searchKey)}, undefined, notSetValue);\n    },\n\n    getIn: function(searchKeyPath, notSetValue) {\n      var nested = this;\n      // Note: in an ES6 environment, we would prefer:\n      // for (var key of searchKeyPath) {\n      var iter = forceIterator(searchKeyPath);\n      var step;\n      while (!(step = iter.next()).done) {\n        var key = step.value;\n        nested = nested && nested.get ? nested.get(key, NOT_SET) : NOT_SET;\n        if (nested === NOT_SET) {\n          return notSetValue;\n        }\n      }\n      return nested;\n    },\n\n    groupBy: function(grouper, context) {\n      return groupByFactory(this, grouper, context);\n    },\n\n    has: function(searchKey) {\n      return this.get(searchKey, NOT_SET) !== NOT_SET;\n    },\n\n    hasIn: function(searchKeyPath) {\n      return this.getIn(searchKeyPath, NOT_SET) !== NOT_SET;\n    },\n\n    isSubset: function(iter) {\n      iter = typeof iter.includes === 'function' ? iter : Iterable(iter);\n      return this.every(function(value ) {return iter.includes(value)});\n    },\n\n    isSuperset: function(iter) {\n      iter = typeof iter.isSubset === 'function' ? iter : Iterable(iter);\n      return iter.isSubset(this);\n    },\n\n    keySeq: function() {\n      return this.toSeq().map(keyMapper).toIndexedSeq();\n    },\n\n    last: function() {\n      return this.toSeq().reverse().first();\n    },\n\n    max: function(comparator) {\n      return maxFactory(this, comparator);\n    },\n\n    maxBy: function(mapper, comparator) {\n      return maxFactory(this, comparator, mapper);\n    },\n\n    min: function(comparator) {\n      return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator);\n    },\n\n    minBy: function(mapper, comparator) {\n      return maxFactory(this, comparator ? neg(comparator) : defaultNegComparator, mapper);\n    },\n\n    rest: function() {\n      return this.slice(1);\n    },\n\n    skip: function(amount) {\n      return this.slice(Math.max(0, amount));\n    },\n\n    skipLast: function(amount) {\n      return reify(this, this.toSeq().reverse().skip(amount).reverse());\n    },\n\n    skipWhile: function(predicate, context) {\n      return reify(this, skipWhileFactory(this, predicate, context, true));\n    },\n\n    skipUntil: function(predicate, context) {\n      return this.skipWhile(not(predicate), context);\n    },\n\n    sortBy: function(mapper, comparator) {\n      return reify(this, sortFactory(this, comparator, mapper));\n    },\n\n    take: function(amount) {\n      return this.slice(0, Math.max(0, amount));\n    },\n\n    takeLast: function(amount) {\n      return reify(this, this.toSeq().reverse().take(amount).reverse());\n    },\n\n    takeWhile: function(predicate, context) {\n      return reify(this, takeWhileFactory(this, predicate, context));\n    },\n\n    takeUntil: function(predicate, context) {\n      return this.takeWhile(not(predicate), context);\n    },\n\n    valueSeq: function() {\n      return this.toIndexedSeq();\n    },\n\n\n    // ### Hashable Object\n\n    hashCode: function() {\n      return this.__hash || (this.__hash = hashIterable(this));\n    }\n\n\n    // ### Internal\n\n    // abstract __iterate(fn, reverse)\n\n    // abstract __iterator(type, reverse)\n  });\n\n  // var IS_ITERABLE_SENTINEL = '@@__IMMUTABLE_ITERABLE__@@';\n  // var IS_KEYED_SENTINEL = '@@__IMMUTABLE_KEYED__@@';\n  // var IS_INDEXED_SENTINEL = '@@__IMMUTABLE_INDEXED__@@';\n  // var IS_ORDERED_SENTINEL = '@@__IMMUTABLE_ORDERED__@@';\n\n  var IterablePrototype = Iterable.prototype;\n  IterablePrototype[IS_ITERABLE_SENTINEL] = true;\n  IterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.values;\n  IterablePrototype.__toJS = IterablePrototype.toArray;\n  IterablePrototype.__toStringMapper = quoteString;\n  IterablePrototype.inspect =\n  IterablePrototype.toSource = function() { return this.toString(); };\n  IterablePrototype.chain = IterablePrototype.flatMap;\n  IterablePrototype.contains = IterablePrototype.includes;\n\n  // Temporary warning about using length\n  (function () {\n    try {\n      Object.defineProperty(IterablePrototype, 'length', {\n        get: function () {\n          if (!Iterable.noLengthWarning) {\n            var stack;\n            try {\n              throw new Error();\n            } catch (error) {\n              stack = error.stack;\n            }\n            if (stack.indexOf('_wrapObject') === -1) {\n              console && console.warn && console.warn(\n                'iterable.length has been deprecated, '+\n                'use iterable.size or iterable.count(). '+\n                'This warning will become a silent error in a future version. ' +\n                stack\n              );\n              return this.size;\n            }\n          }\n        }\n      });\n    } catch (e) {}\n  })();\n\n\n\n  mixin(KeyedIterable, {\n\n    // ### More sequential methods\n\n    flip: function() {\n      return reify(this, flipFactory(this));\n    },\n\n    findKey: function(predicate, context) {\n      var entry = this.findEntry(predicate, context);\n      return entry && entry[0];\n    },\n\n    findLastKey: function(predicate, context) {\n      return this.toSeq().reverse().findKey(predicate, context);\n    },\n\n    keyOf: function(searchValue) {\n      return this.findKey(function(value ) {return is(value, searchValue)});\n    },\n\n    lastKeyOf: function(searchValue) {\n      return this.findLastKey(function(value ) {return is(value, searchValue)});\n    },\n\n    mapEntries: function(mapper, context) {var this$0 = this;\n      var iterations = 0;\n      return reify(this,\n        this.toSeq().map(\n          function(v, k)  {return mapper.call(context, [k, v], iterations++, this$0)}\n        ).fromEntrySeq()\n      );\n    },\n\n    mapKeys: function(mapper, context) {var this$0 = this;\n      return reify(this,\n        this.toSeq().flip().map(\n          function(k, v)  {return mapper.call(context, k, v, this$0)}\n        ).flip()\n      );\n    }\n\n  });\n\n  var KeyedIterablePrototype = KeyedIterable.prototype;\n  KeyedIterablePrototype[IS_KEYED_SENTINEL] = true;\n  KeyedIterablePrototype[ITERATOR_SYMBOL] = IterablePrototype.entries;\n  KeyedIterablePrototype.__toJS = IterablePrototype.toObject;\n  KeyedIterablePrototype.__toStringMapper = function(v, k)  {return JSON.stringify(k) + ': ' + quoteString(v)};\n\n\n\n  mixin(IndexedIterable, {\n\n    // ### Conversion to other types\n\n    toKeyedSeq: function() {\n      return new ToKeyedSequence(this, false);\n    },\n\n\n    // ### ES6 Collection methods (ES6 Array and Map)\n\n    filter: function(predicate, context) {\n      return reify(this, filterFactory(this, predicate, context, false));\n    },\n\n    findIndex: function(predicate, context) {\n      var entry = this.findEntry(predicate, context);\n      return entry ? entry[0] : -1;\n    },\n\n    indexOf: function(searchValue) {\n      var key = this.toKeyedSeq().keyOf(searchValue);\n      return key === undefined ? -1 : key;\n    },\n\n    lastIndexOf: function(searchValue) {\n      var key = this.toKeyedSeq().reverse().keyOf(searchValue);\n      return key === undefined ? -1 : key;\n\n      // var index =\n      // return this.toSeq().reverse().indexOf(searchValue);\n    },\n\n    reverse: function() {\n      return reify(this, reverseFactory(this, false));\n    },\n\n    slice: function(begin, end) {\n      return reify(this, sliceFactory(this, begin, end, false));\n    },\n\n    splice: function(index, removeNum /*, ...values*/) {\n      var numArgs = arguments.length;\n      removeNum = Math.max(removeNum | 0, 0);\n      if (numArgs === 0 || (numArgs === 2 && !removeNum)) {\n        return this;\n      }\n      // If index is negative, it should resolve relative to the size of the\n      // collection. However size may be expensive to compute if not cached, so\n      // only call count() if the number is in fact negative.\n      index = resolveBegin(index, index < 0 ? this.count() : this.size);\n      var spliced = this.slice(0, index);\n      return reify(\n        this,\n        numArgs === 1 ?\n          spliced :\n          spliced.concat(arrCopy(arguments, 2), this.slice(index + removeNum))\n      );\n    },\n\n\n    // ### More collection methods\n\n    findLastIndex: function(predicate, context) {\n      var key = this.toKeyedSeq().findLastKey(predicate, context);\n      return key === undefined ? -1 : key;\n    },\n\n    first: function() {\n      return this.get(0);\n    },\n\n    flatten: function(depth) {\n      return reify(this, flattenFactory(this, depth, false));\n    },\n\n    get: function(index, notSetValue) {\n      index = wrapIndex(this, index);\n      return (index < 0 || (this.size === Infinity ||\n          (this.size !== undefined && index > this.size))) ?\n        notSetValue :\n        this.find(function(_, key)  {return key === index}, undefined, notSetValue);\n    },\n\n    has: function(index) {\n      index = wrapIndex(this, index);\n      return index >= 0 && (this.size !== undefined ?\n        this.size === Infinity || index < this.size :\n        this.indexOf(index) !== -1\n      );\n    },\n\n    interpose: function(separator) {\n      return reify(this, interposeFactory(this, separator));\n    },\n\n    interleave: function(/*...iterables*/) {\n      var iterables = [this].concat(arrCopy(arguments));\n      var zipped = zipWithFactory(this.toSeq(), IndexedSeq.of, iterables);\n      var interleaved = zipped.flatten(true);\n      if (zipped.size) {\n        interleaved.size = zipped.size * iterables.length;\n      }\n      return reify(this, interleaved);\n    },\n\n    last: function() {\n      return this.get(-1);\n    },\n\n    skipWhile: function(predicate, context) {\n      return reify(this, skipWhileFactory(this, predicate, context, false));\n    },\n\n    zip: function(/*, ...iterables */) {\n      var iterables = [this].concat(arrCopy(arguments));\n      return reify(this, zipWithFactory(this, defaultZipper, iterables));\n    },\n\n    zipWith: function(zipper/*, ...iterables */) {\n      var iterables = arrCopy(arguments);\n      iterables[0] = this;\n      return reify(this, zipWithFactory(this, zipper, iterables));\n    }\n\n  });\n\n  IndexedIterable.prototype[IS_INDEXED_SENTINEL] = true;\n  IndexedIterable.prototype[IS_ORDERED_SENTINEL] = true;\n\n\n\n  mixin(SetIterable, {\n\n    // ### ES6 Collection methods (ES6 Array and Map)\n\n    get: function(value, notSetValue) {\n      return this.has(value) ? value : notSetValue;\n    },\n\n    includes: function(value) {\n      return this.has(value);\n    },\n\n\n    // ### More sequential methods\n\n    keySeq: function() {\n      return this.valueSeq();\n    }\n\n  });\n\n  SetIterable.prototype.has = IterablePrototype.includes;\n\n\n  // Mixin subclasses\n\n  mixin(KeyedSeq, KeyedIterable.prototype);\n  mixin(IndexedSeq, IndexedIterable.prototype);\n  mixin(SetSeq, SetIterable.prototype);\n\n  mixin(KeyedCollection, KeyedIterable.prototype);\n  mixin(IndexedCollection, IndexedIterable.prototype);\n  mixin(SetCollection, SetIterable.prototype);\n\n\n  // #pragma Helper functions\n\n  function keyMapper(v, k) {\n    return k;\n  }\n\n  function entryMapper(v, k) {\n    return [k, v];\n  }\n\n  function not(predicate) {\n    return function() {\n      return !predicate.apply(this, arguments);\n    }\n  }\n\n  function neg(predicate) {\n    return function() {\n      return -predicate.apply(this, arguments);\n    }\n  }\n\n  function quoteString(value) {\n    return typeof value === 'string' ? JSON.stringify(value) : value;\n  }\n\n  function defaultZipper() {\n    return arrCopy(arguments);\n  }\n\n  function defaultNegComparator(a, b) {\n    return a < b ? 1 : a > b ? -1 : 0;\n  }\n\n  function hashIterable(iterable) {\n    if (iterable.size === Infinity) {\n      return 0;\n    }\n    var ordered = isOrdered(iterable);\n    var keyed = isKeyed(iterable);\n    var h = ordered ? 1 : 0;\n    var size = iterable.__iterate(\n      keyed ?\n        ordered ?\n          function(v, k)  { h = 31 * h + hashMerge(hash(v), hash(k)) | 0; } :\n          function(v, k)  { h = h + hashMerge(hash(v), hash(k)) | 0; } :\n        ordered ?\n          function(v ) { h = 31 * h + hash(v) | 0; } :\n          function(v ) { h = h + hash(v) | 0; }\n    );\n    return murmurHashOfSize(size, h);\n  }\n\n  function murmurHashOfSize(size, h) {\n    h = imul(h, 0xCC9E2D51);\n    h = imul(h << 15 | h >>> -15, 0x1B873593);\n    h = imul(h << 13 | h >>> -13, 5);\n    h = (h + 0xE6546B64 | 0) ^ size;\n    h = imul(h ^ h >>> 16, 0x85EBCA6B);\n    h = imul(h ^ h >>> 13, 0xC2B2AE35);\n    h = smi(h ^ h >>> 16);\n    return h;\n  }\n\n  function hashMerge(a, b) {\n    return a ^ b + 0x9E3779B9 + (a << 6) + (a >> 2) | 0; // int\n  }\n\n  var Immutable = {\n\n    Iterable: Iterable,\n\n    Seq: Seq,\n    Collection: Collection,\n    Map: Map,\n    OrderedMap: OrderedMap,\n    List: List,\n    Stack: Stack,\n    Set: Set,\n    OrderedSet: OrderedSet,\n\n    Record: Record,\n    Range: Range,\n    Repeat: Repeat,\n\n    is: is,\n    fromJS: fromJS\n\n  };\n\n  return Immutable;\n\n}));","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule EditorBidiService\n * @format\n * \n */\n\n'use strict';\n\nvar Immutable = require('immutable');\nvar UnicodeBidiService = require('fbjs/lib/UnicodeBidiService');\n\nvar nullthrows = require('fbjs/lib/nullthrows');\n\nvar OrderedMap = Immutable.OrderedMap;\n\n\nvar bidiService;\n\nvar EditorBidiService = {\n  getDirectionMap: function getDirectionMap(content, prevBidiMap) {\n    if (!bidiService) {\n      bidiService = new UnicodeBidiService();\n    } else {\n      bidiService.reset();\n    }\n\n    var blockMap = content.getBlockMap();\n    var nextBidi = blockMap.valueSeq().map(function (block) {\n      return nullthrows(bidiService).getDirection(block.getText());\n    });\n    var bidiMap = OrderedMap(blockMap.keySeq().zip(nextBidi));\n\n    if (prevBidiMap != null && Immutable.is(prevBidiMap, bidiMap)) {\n      return prevBidiMap;\n    }\n\n    return bidiMap;\n  }\n};\n\nmodule.exports = EditorBidiService;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule insertTextIntoContentState\n * @format\n * \n */\n\n'use strict';\n\nvar Immutable = require('immutable');\n\nvar insertIntoList = require('./insertIntoList');\nvar invariant = require('fbjs/lib/invariant');\n\nvar Repeat = Immutable.Repeat;\n\n\nfunction insertTextIntoContentState(contentState, selectionState, text, characterMetadata) {\n  !selectionState.isCollapsed() ? process.env.NODE_ENV !== 'production' ? invariant(false, '`insertText` should only be called with a collapsed range.') : invariant(false) : void 0;\n\n  var len = text.length;\n  if (!len) {\n    return contentState;\n  }\n\n  var blockMap = contentState.getBlockMap();\n  var key = selectionState.getStartKey();\n  var offset = selectionState.getStartOffset();\n  var block = blockMap.get(key);\n  var blockText = block.getText();\n\n  var newBlock = block.merge({\n    text: blockText.slice(0, offset) + text + blockText.slice(offset, block.getLength()),\n    characterList: insertIntoList(block.getCharacterList(), Repeat(characterMetadata, len).toList(), offset)\n  });\n\n  var newOffset = offset + len;\n\n  return contentState.merge({\n    blockMap: blockMap.set(key, newBlock),\n    selectionAfter: selectionState.merge({\n      anchorOffset: newOffset,\n      focusOffset: newOffset\n    })\n  });\n}\n\nmodule.exports = insertTextIntoContentState;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule generateRandomKey\n * @format\n * \n */\n\n'use strict';\n\nvar seenKeys = {};\nvar MULTIPLIER = Math.pow(2, 24);\n\nfunction generateRandomKey() {\n  var key = void 0;\n  while (key === undefined || seenKeys.hasOwnProperty(key) || !isNaN(+key)) {\n    key = Math.floor(Math.random() * MULTIPLIER).toString(32);\n  }\n  seenKeys[key] = true;\n  return key;\n}\n\nmodule.exports = generateRandomKey;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getVisibleSelectionRect\n * @format\n * \n */\n\n'use strict';\n\nvar getRangeBoundingClientRect = require('./getRangeBoundingClientRect');\n\n/**\n * Return the bounding ClientRect for the visible DOM selection, if any.\n * In cases where there are no selected ranges or the bounding rect is\n * temporarily invalid, return null.\n */\nfunction getVisibleSelectionRect(global) {\n  var selection = global.getSelection();\n  if (!selection.rangeCount) {\n    return null;\n  }\n\n  var range = selection.getRangeAt(0);\n  var boundingRect = getRangeBoundingClientRect(range);\n  var top = boundingRect.top,\n      right = boundingRect.right,\n      bottom = boundingRect.bottom,\n      left = boundingRect.left;\n\n  // When a re-render leads to a node being removed, the DOM selection will\n  // temporarily be placed on an ancestor node, which leads to an invalid\n  // bounding rect. Discard this state.\n\n  if (top === 0 && right === 0 && bottom === 0 && left === 0) {\n    return null;\n  }\n\n  return boundingRect;\n}\n\nmodule.exports = getVisibleSelectionRect;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule EditorState\n * @format\n * \n */\n\n'use strict';\n\nvar _assign = require('object-assign');\n\nvar _extends = _assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar BlockTree = require('./BlockTree');\nvar ContentState = require('./ContentState');\nvar EditorBidiService = require('./EditorBidiService');\nvar Immutable = require('immutable');\nvar SelectionState = require('./SelectionState');\n\nvar OrderedSet = Immutable.OrderedSet,\n    Record = Immutable.Record,\n    Stack = Immutable.Stack;\n\n\nvar defaultRecord = {\n  allowUndo: true,\n  currentContent: null,\n  decorator: null,\n  directionMap: null,\n  forceSelection: false,\n  inCompositionMode: false,\n  inlineStyleOverride: null,\n  lastChangeType: null,\n  nativelyRenderedContent: null,\n  redoStack: Stack(),\n  selection: null,\n  treeMap: null,\n  undoStack: Stack()\n};\n\nvar EditorStateRecord = Record(defaultRecord);\n\nvar EditorState = function () {\n  EditorState.createEmpty = function createEmpty(decorator) {\n    return EditorState.createWithContent(ContentState.createFromText(''), decorator);\n  };\n\n  EditorState.createWithContent = function createWithContent(contentState, decorator) {\n    var firstKey = contentState.getBlockMap().first().getKey();\n    return EditorState.create({\n      currentContent: contentState,\n      undoStack: Stack(),\n      redoStack: Stack(),\n      decorator: decorator || null,\n      selection: SelectionState.createEmpty(firstKey)\n    });\n  };\n\n  EditorState.create = function create(config) {\n    var currentContent = config.currentContent,\n        decorator = config.decorator;\n\n    var recordConfig = _extends({}, config, {\n      treeMap: generateNewTreeMap(currentContent, decorator),\n      directionMap: EditorBidiService.getDirectionMap(currentContent)\n    });\n    return new EditorState(new EditorStateRecord(recordConfig));\n  };\n\n  EditorState.set = function set(editorState, put) {\n    var map = editorState.getImmutable().withMutations(function (state) {\n      var existingDecorator = state.get('decorator');\n      var decorator = existingDecorator;\n      if (put.decorator === null) {\n        decorator = null;\n      } else if (put.decorator) {\n        decorator = put.decorator;\n      }\n\n      var newContent = put.currentContent || editorState.getCurrentContent();\n\n      if (decorator !== existingDecorator) {\n        var treeMap = state.get('treeMap');\n        var newTreeMap;\n        if (decorator && existingDecorator) {\n          newTreeMap = regenerateTreeForNewDecorator(newContent, newContent.getBlockMap(), treeMap, decorator, existingDecorator);\n        } else {\n          newTreeMap = generateNewTreeMap(newContent, decorator);\n        }\n\n        state.merge({\n          decorator: decorator,\n          treeMap: newTreeMap,\n          nativelyRenderedContent: null\n        });\n        return;\n      }\n\n      var existingContent = editorState.getCurrentContent();\n      if (newContent !== existingContent) {\n        state.set('treeMap', regenerateTreeForNewBlocks(editorState, newContent.getBlockMap(), newContent.getEntityMap(), decorator));\n      }\n\n      state.merge(put);\n    });\n\n    return new EditorState(map);\n  };\n\n  EditorState.prototype.toJS = function toJS() {\n    return this.getImmutable().toJS();\n  };\n\n  EditorState.prototype.getAllowUndo = function getAllowUndo() {\n    return this.getImmutable().get('allowUndo');\n  };\n\n  EditorState.prototype.getCurrentContent = function getCurrentContent() {\n    return this.getImmutable().get('currentContent');\n  };\n\n  EditorState.prototype.getUndoStack = function getUndoStack() {\n    return this.getImmutable().get('undoStack');\n  };\n\n  EditorState.prototype.getRedoStack = function getRedoStack() {\n    return this.getImmutable().get('redoStack');\n  };\n\n  EditorState.prototype.getSelection = function getSelection() {\n    return this.getImmutable().get('selection');\n  };\n\n  EditorState.prototype.getDecorator = function getDecorator() {\n    return this.getImmutable().get('decorator');\n  };\n\n  EditorState.prototype.isInCompositionMode = function isInCompositionMode() {\n    return this.getImmutable().get('inCompositionMode');\n  };\n\n  EditorState.prototype.mustForceSelection = function mustForceSelection() {\n    return this.getImmutable().get('forceSelection');\n  };\n\n  EditorState.prototype.getNativelyRenderedContent = function getNativelyRenderedContent() {\n    return this.getImmutable().get('nativelyRenderedContent');\n  };\n\n  EditorState.prototype.getLastChangeType = function getLastChangeType() {\n    return this.getImmutable().get('lastChangeType');\n  };\n\n  /**\n   * While editing, the user may apply inline style commands with a collapsed\n   * cursor, intending to type text that adopts the specified style. In this\n   * case, we track the specified style as an \"override\" that takes precedence\n   * over the inline style of the text adjacent to the cursor.\n   *\n   * If null, there is no override in place.\n   */\n\n\n  EditorState.prototype.getInlineStyleOverride = function getInlineStyleOverride() {\n    return this.getImmutable().get('inlineStyleOverride');\n  };\n\n  EditorState.setInlineStyleOverride = function setInlineStyleOverride(editorState, inlineStyleOverride) {\n    return EditorState.set(editorState, { inlineStyleOverride: inlineStyleOverride });\n  };\n\n  /**\n   * Get the appropriate inline style for the editor state. If an\n   * override is in place, use it. Otherwise, the current style is\n   * based on the location of the selection state.\n   */\n\n\n  EditorState.prototype.getCurrentInlineStyle = function getCurrentInlineStyle() {\n    var override = this.getInlineStyleOverride();\n    if (override != null) {\n      return override;\n    }\n\n    var content = this.getCurrentContent();\n    var selection = this.getSelection();\n\n    if (selection.isCollapsed()) {\n      return getInlineStyleForCollapsedSelection(content, selection);\n    }\n\n    return getInlineStyleForNonCollapsedSelection(content, selection);\n  };\n\n  EditorState.prototype.getBlockTree = function getBlockTree(blockKey) {\n    return this.getImmutable().getIn(['treeMap', blockKey]);\n  };\n\n  EditorState.prototype.isSelectionAtStartOfContent = function isSelectionAtStartOfContent() {\n    var firstKey = this.getCurrentContent().getBlockMap().first().getKey();\n    return this.getSelection().hasEdgeWithin(firstKey, 0, 0);\n  };\n\n  EditorState.prototype.isSelectionAtEndOfContent = function isSelectionAtEndOfContent() {\n    var content = this.getCurrentContent();\n    var blockMap = content.getBlockMap();\n    var last = blockMap.last();\n    var end = last.getLength();\n    return this.getSelection().hasEdgeWithin(last.getKey(), end, end);\n  };\n\n  EditorState.prototype.getDirectionMap = function getDirectionMap() {\n    return this.getImmutable().get('directionMap');\n  };\n\n  /**\n   * Incorporate native DOM selection changes into the EditorState. This\n   * method can be used when we simply want to accept whatever the DOM\n   * has given us to represent selection, and we do not need to re-render\n   * the editor.\n   *\n   * To forcibly move the DOM selection, see `EditorState.forceSelection`.\n   */\n\n\n  EditorState.acceptSelection = function acceptSelection(editorState, selection) {\n    return updateSelection(editorState, selection, false);\n  };\n\n  /**\n   * At times, we need to force the DOM selection to be where we\n   * need it to be. This can occur when the anchor or focus nodes\n   * are non-text nodes, for instance. In this case, we want to trigger\n   * a re-render of the editor, which in turn forces selection into\n   * the correct place in the DOM. The `forceSelection` method\n   * accomplishes this.\n   *\n   * This method should be used in cases where you need to explicitly\n   * move the DOM selection from one place to another without a change\n   * in ContentState.\n   */\n\n\n  EditorState.forceSelection = function forceSelection(editorState, selection) {\n    if (!selection.getHasFocus()) {\n      selection = selection.set('hasFocus', true);\n    }\n    return updateSelection(editorState, selection, true);\n  };\n\n  /**\n   * Move selection to the end of the editor without forcing focus.\n   */\n\n\n  EditorState.moveSelectionToEnd = function moveSelectionToEnd(editorState) {\n    var content = editorState.getCurrentContent();\n    var lastBlock = content.getLastBlock();\n    var lastKey = lastBlock.getKey();\n    var length = lastBlock.getLength();\n\n    return EditorState.acceptSelection(editorState, new SelectionState({\n      anchorKey: lastKey,\n      anchorOffset: length,\n      focusKey: lastKey,\n      focusOffset: length,\n      isBackward: false\n    }));\n  };\n\n  /**\n   * Force focus to the end of the editor. This is useful in scenarios\n   * where we want to programmatically focus the input and it makes sense\n   * to allow the user to continue working seamlessly.\n   */\n\n\n  EditorState.moveFocusToEnd = function moveFocusToEnd(editorState) {\n    var afterSelectionMove = EditorState.moveSelectionToEnd(editorState);\n    return EditorState.forceSelection(afterSelectionMove, afterSelectionMove.getSelection());\n  };\n\n  /**\n   * Push the current ContentState onto the undo stack if it should be\n   * considered a boundary state, and set the provided ContentState as the\n   * new current content.\n   */\n\n\n  EditorState.push = function push(editorState, contentState, changeType) {\n    if (editorState.getCurrentContent() === contentState) {\n      return editorState;\n    }\n\n    var forceSelection = changeType !== 'insert-characters';\n    var directionMap = EditorBidiService.getDirectionMap(contentState, editorState.getDirectionMap());\n\n    if (!editorState.getAllowUndo()) {\n      return EditorState.set(editorState, {\n        currentContent: contentState,\n        directionMap: directionMap,\n        lastChangeType: changeType,\n        selection: contentState.getSelectionAfter(),\n        forceSelection: forceSelection,\n        inlineStyleOverride: null\n      });\n    }\n\n    var selection = editorState.getSelection();\n    var currentContent = editorState.getCurrentContent();\n    var undoStack = editorState.getUndoStack();\n    var newContent = contentState;\n\n    if (selection !== currentContent.getSelectionAfter() || mustBecomeBoundary(editorState, changeType)) {\n      undoStack = undoStack.push(currentContent);\n      newContent = newContent.set('selectionBefore', selection);\n    } else if (changeType === 'insert-characters' || changeType === 'backspace-character' || changeType === 'delete-character') {\n      // Preserve the previous selection.\n      newContent = newContent.set('selectionBefore', currentContent.getSelectionBefore());\n    }\n\n    var inlineStyleOverride = editorState.getInlineStyleOverride();\n\n    // Don't discard inline style overrides for the following change types:\n    var overrideChangeTypes = ['adjust-depth', 'change-block-type', 'split-block'];\n\n    if (overrideChangeTypes.indexOf(changeType) === -1) {\n      inlineStyleOverride = null;\n    }\n\n    var editorStateChanges = {\n      currentContent: newContent,\n      directionMap: directionMap,\n      undoStack: undoStack,\n      redoStack: Stack(),\n      lastChangeType: changeType,\n      selection: contentState.getSelectionAfter(),\n      forceSelection: forceSelection,\n      inlineStyleOverride: inlineStyleOverride\n    };\n\n    return EditorState.set(editorState, editorStateChanges);\n  };\n\n  /**\n   * Make the top ContentState in the undo stack the new current content and\n   * push the current content onto the redo stack.\n   */\n\n\n  EditorState.undo = function undo(editorState) {\n    if (!editorState.getAllowUndo()) {\n      return editorState;\n    }\n\n    var undoStack = editorState.getUndoStack();\n    var newCurrentContent = undoStack.peek();\n    if (!newCurrentContent) {\n      return editorState;\n    }\n\n    var currentContent = editorState.getCurrentContent();\n    var directionMap = EditorBidiService.getDirectionMap(newCurrentContent, editorState.getDirectionMap());\n\n    return EditorState.set(editorState, {\n      currentContent: newCurrentContent,\n      directionMap: directionMap,\n      undoStack: undoStack.shift(),\n      redoStack: editorState.getRedoStack().push(currentContent),\n      forceSelection: true,\n      inlineStyleOverride: null,\n      lastChangeType: 'undo',\n      nativelyRenderedContent: null,\n      selection: currentContent.getSelectionBefore()\n    });\n  };\n\n  /**\n   * Make the top ContentState in the redo stack the new current content and\n   * push the current content onto the undo stack.\n   */\n\n\n  EditorState.redo = function redo(editorState) {\n    if (!editorState.getAllowUndo()) {\n      return editorState;\n    }\n\n    var redoStack = editorState.getRedoStack();\n    var newCurrentContent = redoStack.peek();\n    if (!newCurrentContent) {\n      return editorState;\n    }\n\n    var currentContent = editorState.getCurrentContent();\n    var directionMap = EditorBidiService.getDirectionMap(newCurrentContent, editorState.getDirectionMap());\n\n    return EditorState.set(editorState, {\n      currentContent: newCurrentContent,\n      directionMap: directionMap,\n      undoStack: editorState.getUndoStack().push(currentContent),\n      redoStack: redoStack.shift(),\n      forceSelection: true,\n      inlineStyleOverride: null,\n      lastChangeType: 'redo',\n      nativelyRenderedContent: null,\n      selection: newCurrentContent.getSelectionAfter()\n    });\n  };\n\n  /**\n   * Not for public consumption.\n   */\n\n\n  function EditorState(immutable) {\n    _classCallCheck(this, EditorState);\n\n    this._immutable = immutable;\n  }\n\n  /**\n   * Not for public consumption.\n   */\n\n\n  EditorState.prototype.getImmutable = function getImmutable() {\n    return this._immutable;\n  };\n\n  return EditorState;\n}();\n\n/**\n * Set the supplied SelectionState as the new current selection, and set\n * the `force` flag to trigger manual selection placement by the view.\n */\n\n\nfunction updateSelection(editorState, selection, forceSelection) {\n  return EditorState.set(editorState, {\n    selection: selection,\n    forceSelection: forceSelection,\n    nativelyRenderedContent: null,\n    inlineStyleOverride: null\n  });\n}\n\n/**\n * Regenerate the entire tree map for a given ContentState and decorator.\n * Returns an OrderedMap that maps all available ContentBlock objects.\n */\nfunction generateNewTreeMap(contentState, decorator) {\n  return contentState.getBlockMap().map(function (block) {\n    return BlockTree.generate(contentState, block, decorator);\n  }).toOrderedMap();\n}\n\n/**\n * Regenerate tree map objects for all ContentBlocks that have changed\n * between the current editorState and newContent. Returns an OrderedMap\n * with only changed regenerated tree map objects.\n */\nfunction regenerateTreeForNewBlocks(editorState, newBlockMap, newEntityMap, decorator) {\n  var contentState = editorState.getCurrentContent().set('entityMap', newEntityMap);\n  var prevBlockMap = contentState.getBlockMap();\n  var prevTreeMap = editorState.getImmutable().get('treeMap');\n  return prevTreeMap.merge(newBlockMap.toSeq().filter(function (block, key) {\n    return block !== prevBlockMap.get(key);\n  }).map(function (block) {\n    return BlockTree.generate(contentState, block, decorator);\n  }));\n}\n\n/**\n * Generate tree map objects for a new decorator object, preserving any\n * decorations that are unchanged from the previous decorator.\n *\n * Note that in order for this to perform optimally, decoration Lists for\n * decorators should be preserved when possible to allow for direct immutable\n * List comparison.\n */\nfunction regenerateTreeForNewDecorator(content, blockMap, previousTreeMap, decorator, existingDecorator) {\n  return previousTreeMap.merge(blockMap.toSeq().filter(function (block) {\n    return decorator.getDecorations(block, content) !== existingDecorator.getDecorations(block, content);\n  }).map(function (block) {\n    return BlockTree.generate(content, block, decorator);\n  }));\n}\n\n/**\n * Return whether a change should be considered a boundary state, given\n * the previous change type. Allows us to discard potential boundary states\n * during standard typing or deletion behavior.\n */\nfunction mustBecomeBoundary(editorState, changeType) {\n  var lastChangeType = editorState.getLastChangeType();\n  return changeType !== lastChangeType || changeType !== 'insert-characters' && changeType !== 'backspace-character' && changeType !== 'delete-character';\n}\n\nfunction getInlineStyleForCollapsedSelection(content, selection) {\n  var startKey = selection.getStartKey();\n  var startOffset = selection.getStartOffset();\n  var startBlock = content.getBlockForKey(startKey);\n\n  // If the cursor is not at the start of the block, look backward to\n  // preserve the style of the preceding character.\n  if (startOffset > 0) {\n    return startBlock.getInlineStyleAt(startOffset - 1);\n  }\n\n  // The caret is at position zero in this block. If the block has any\n  // text at all, use the style of the first character.\n  if (startBlock.getLength()) {\n    return startBlock.getInlineStyleAt(0);\n  }\n\n  // Otherwise, look upward in the document to find the closest character.\n  return lookUpwardForInlineStyle(content, startKey);\n}\n\nfunction getInlineStyleForNonCollapsedSelection(content, selection) {\n  var startKey = selection.getStartKey();\n  var startOffset = selection.getStartOffset();\n  var startBlock = content.getBlockForKey(startKey);\n\n  // If there is a character just inside the selection, use its style.\n  if (startOffset < startBlock.getLength()) {\n    return startBlock.getInlineStyleAt(startOffset);\n  }\n\n  // Check if the selection at the end of a non-empty block. Use the last\n  // style in the block.\n  if (startOffset > 0) {\n    return startBlock.getInlineStyleAt(startOffset - 1);\n  }\n\n  // Otherwise, look upward in the document to find the closest character.\n  return lookUpwardForInlineStyle(content, startKey);\n}\n\nfunction lookUpwardForInlineStyle(content, fromKey) {\n  var lastNonEmpty = content.getBlockMap().reverse().skipUntil(function (_, k) {\n    return k === fromKey;\n  }).skip(1).skipUntil(function (block, _) {\n    return block.getLength();\n  }).first();\n\n  if (lastNonEmpty) return lastNonEmpty.getInlineStyleAt(lastNonEmpty.getLength() - 1);\n  return OrderedSet();\n}\n\nmodule.exports = EditorState;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule sanitizeDraftText\n * @format\n * \n */\n\n'use strict';\n\nvar REGEX_BLOCK_DELIMITER = new RegExp('\\r', 'g');\n\nfunction sanitizeDraftText(input) {\n  return input.replace(REGEX_BLOCK_DELIMITER, '');\n}\n\nmodule.exports = sanitizeDraftText;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule applyEntityToContentBlock\n * @format\n * \n */\n\n'use strict';\n\nvar CharacterMetadata = require('./CharacterMetadata');\n\nfunction applyEntityToContentBlock(contentBlock, start, end, entityKey) {\n  var characterList = contentBlock.getCharacterList();\n  while (start < end) {\n    characterList = characterList.set(start, CharacterMetadata.applyEntity(characterList.get(start), entityKey));\n    start++;\n  }\n  return contentBlock.set('characterList', characterList);\n}\n\nmodule.exports = applyEntityToContentBlock;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule BlockMapBuilder\n * @format\n * \n */\n\n'use strict';\n\nvar Immutable = require('immutable');\n\nvar OrderedMap = Immutable.OrderedMap;\n\n\nvar BlockMapBuilder = {\n  createFromArray: function createFromArray(blocks) {\n    return OrderedMap(blocks.map(function (block) {\n      return [block.getKey(), block];\n    }));\n  }\n};\n\nmodule.exports = BlockMapBuilder;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule encodeInlineStyleRanges\n * @format\n * \n */\n\n'use strict';\n\nvar UnicodeUtils = require('fbjs/lib/UnicodeUtils');\n\nvar findRangesImmutable = require('./findRangesImmutable');\n\nvar areEqual = function areEqual(a, b) {\n  return a === b;\n};\nvar isTruthy = function isTruthy(a) {\n  return !!a;\n};\nvar EMPTY_ARRAY = [];\n\n/**\n * Helper function for getting encoded styles for each inline style. Convert\n * to UTF-8 character counts for storage.\n */\nfunction getEncodedInlinesForType(block, styleList, styleToEncode) {\n  var ranges = [];\n\n  // Obtain an array with ranges for only the specified style.\n  var filteredInlines = styleList.map(function (style) {\n    return style.has(styleToEncode);\n  }).toList();\n\n  findRangesImmutable(filteredInlines, areEqual,\n  // We only want to keep ranges with nonzero style values.\n  isTruthy, function (start, end) {\n    var text = block.getText();\n    ranges.push({\n      offset: UnicodeUtils.strlen(text.slice(0, start)),\n      length: UnicodeUtils.strlen(text.slice(start, end)),\n      style: styleToEncode\n    });\n  });\n\n  return ranges;\n}\n\n/*\n * Retrieve the encoded arrays of inline styles, with each individual style\n * treated separately.\n */\nfunction encodeInlineStyleRanges(block) {\n  var styleList = block.getCharacterList().map(function (c) {\n    return c.getStyle();\n  }).toList();\n  var ranges = styleList.flatten().toSet().map(function (style) {\n    return getEncodedInlinesForType(block, styleList, style);\n  });\n\n  return Array.prototype.concat.apply(EMPTY_ARRAY, ranges.toJS());\n}\n\nmodule.exports = encodeInlineStyleRanges;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule randomizeBlockMapKeys\n * @format\n * \n */\n\n'use strict';\n\nvar ContentBlockNode = require('./ContentBlockNode');\nvar Immutable = require('immutable');\n\nvar generateRandomKey = require('./generateRandomKey');\n\nvar OrderedMap = Immutable.OrderedMap;\n\n\nvar randomizeContentBlockNodeKeys = function randomizeContentBlockNodeKeys(blockMap) {\n  var newKeysRef = {};\n\n  // we keep track of root blocks in order to update subsequent sibling links\n  var lastRootBlock = void 0;\n\n  return OrderedMap(blockMap.withMutations(function (blockMapState) {\n    blockMapState.forEach(function (block, index) {\n      var oldKey = block.getKey();\n      var nextKey = block.getNextSiblingKey();\n      var prevKey = block.getPrevSiblingKey();\n      var childrenKeys = block.getChildKeys();\n      var parentKey = block.getParentKey();\n\n      // new key that we will use to build linking\n      var key = generateRandomKey();\n\n      // we will add it here to re-use it later\n      newKeysRef[oldKey] = key;\n\n      if (nextKey) {\n        var nextBlock = blockMapState.get(nextKey);\n        if (nextBlock) {\n          blockMapState.setIn([nextKey, 'prevSibling'], key);\n        } else {\n          // this can happen when generating random keys for fragments\n          blockMapState.setIn([oldKey, 'nextSibling'], null);\n        }\n      }\n\n      if (prevKey) {\n        var prevBlock = blockMapState.get(prevKey);\n        if (prevBlock) {\n          blockMapState.setIn([prevKey, 'nextSibling'], key);\n        } else {\n          // this can happen when generating random keys for fragments\n          blockMapState.setIn([oldKey, 'prevSibling'], null);\n        }\n      }\n\n      if (parentKey && blockMapState.get(parentKey)) {\n        var parentBlock = blockMapState.get(parentKey);\n        var parentChildrenList = parentBlock.getChildKeys();\n        blockMapState.setIn([parentKey, 'children'], parentChildrenList.set(parentChildrenList.indexOf(block.getKey()), key));\n      } else {\n        // blocks will then be treated as root block nodes\n        blockMapState.setIn([oldKey, 'parent'], null);\n\n        if (lastRootBlock) {\n          blockMapState.setIn([lastRootBlock.getKey(), 'nextSibling'], key);\n          blockMapState.setIn([oldKey, 'prevSibling'], newKeysRef[lastRootBlock.getKey()]);\n        }\n\n        lastRootBlock = blockMapState.get(oldKey);\n      }\n\n      childrenKeys.forEach(function (childKey) {\n        var childBlock = blockMapState.get(childKey);\n        if (childBlock) {\n          blockMapState.setIn([childKey, 'parent'], key);\n        } else {\n          blockMapState.setIn([oldKey, 'children'], block.getChildKeys().filter(function (child) {\n            return child !== childKey;\n          }));\n        }\n      });\n    });\n  }).toArray().map(function (block) {\n    return [newKeysRef[block.getKey()], block.set('key', newKeysRef[block.getKey()])];\n  }));\n};\n\nvar randomizeContentBlockKeys = function randomizeContentBlockKeys(blockMap) {\n  return OrderedMap(blockMap.toArray().map(function (block) {\n    var key = generateRandomKey();\n    return [key, block.set('key', key)];\n  }));\n};\n\nvar randomizeBlockMapKeys = function randomizeBlockMapKeys(blockMap) {\n  var isTreeBasedBlockMap = blockMap.first() instanceof ContentBlockNode;\n\n  if (!isTreeBasedBlockMap) {\n    return randomizeContentBlockKeys(blockMap);\n  }\n\n  return randomizeContentBlockNodeKeys(blockMap);\n};\n\nmodule.exports = randomizeBlockMapKeys;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule CompositeDraftDecorator\n * @format\n * \n */\n\n'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nvar Immutable = require('immutable');\n\nvar List = Immutable.List;\n\n\nvar DELIMITER = '.';\n\n/**\n * A CompositeDraftDecorator traverses through a list of DraftDecorator\n * instances to identify sections of a ContentBlock that should be rendered\n * in a \"decorated\" manner. For example, hashtags, mentions, and links may\n * be intended to stand out visually, be rendered as anchors, etc.\n *\n * The list of decorators supplied to the constructor will be used in the\n * order they are provided. This allows the caller to specify a priority for\n * string matching, in case of match collisions among decorators.\n *\n * For instance, I may have a link with a `#` in its text. Though this section\n * of text may match our hashtag decorator, it should not be treated as a\n * hashtag. I should therefore list my link DraftDecorator\n * before my hashtag DraftDecorator when constructing this composite\n * decorator instance.\n *\n * Thus, when a collision like this is encountered, the earlier match is\n * preserved and the new match is discarded.\n */\n\nvar CompositeDraftDecorator = function () {\n  function CompositeDraftDecorator(decorators) {\n    _classCallCheck(this, CompositeDraftDecorator);\n\n    // Copy the decorator array, since we use this array order to determine\n    // precedence of decoration matching. If the array is mutated externally,\n    // we don't want to be affected here.\n    this._decorators = decorators.slice();\n  }\n\n  CompositeDraftDecorator.prototype.getDecorations = function getDecorations(block, contentState) {\n    var decorations = Array(block.getText().length).fill(null);\n\n    this._decorators.forEach(function ( /*object*/decorator, /*number*/ii) {\n      var counter = 0;\n      var strategy = decorator.strategy;\n      var callback = function callback( /*number*/start, /*number*/end) {\n        // Find out if any of our matching range is already occupied\n        // by another decorator. If so, discard the match. Otherwise, store\n        // the component key for rendering.\n        if (canOccupySlice(decorations, start, end)) {\n          occupySlice(decorations, start, end, ii + DELIMITER + counter);\n          counter++;\n        }\n      };\n      strategy(block, callback, contentState);\n    });\n\n    return List(decorations);\n  };\n\n  CompositeDraftDecorator.prototype.getComponentForKey = function getComponentForKey(key) {\n    var componentKey = parseInt(key.split(DELIMITER)[0], 10);\n    return this._decorators[componentKey].component;\n  };\n\n  CompositeDraftDecorator.prototype.getPropsForKey = function getPropsForKey(key) {\n    var componentKey = parseInt(key.split(DELIMITER)[0], 10);\n    return this._decorators[componentKey].props;\n  };\n\n  return CompositeDraftDecorator;\n}();\n\n/**\n * Determine whether we can occupy the specified slice of the decorations\n * array.\n */\n\n\nfunction canOccupySlice(decorations, start, end) {\n  for (var ii = start; ii < end; ii++) {\n    if (decorations[ii] != null) {\n      return false;\n    }\n  }\n  return true;\n}\n\n/**\n * Splice the specified component into our decoration array at the desired\n * range.\n */\nfunction occupySlice(targetArr, start, end, componentKey) {\n  for (var ii = start; ii < end; ii++) {\n    targetArr[ii] = componentKey;\n  }\n}\n\nmodule.exports = CompositeDraftDecorator;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DraftRemovableWord\n * @format\n * \n */\n\n'use strict';\n\nvar TokenizeUtil = require('fbjs/lib/TokenizeUtil');\n\nvar punctuation = TokenizeUtil.getPunctuation();\n\n// The apostrophe and curly single quotes behave in a curious way: when\n// surrounded on both sides by word characters, they behave as word chars; when\n// either neighbor is punctuation or an end of the string, they behave as\n// punctuation.\nvar CHAMELEON_CHARS = '[\\'\\u2018\\u2019]';\n\n// Remove the underscore, which should count as part of the removable word. The\n// \"chameleon chars\" also count as punctuation in this regex.\nvar WHITESPACE_AND_PUNCTUATION = '\\\\s|(?![_])' + punctuation;\n\nvar DELETE_STRING = '^' + '(?:' + WHITESPACE_AND_PUNCTUATION + ')*' + '(?:' + CHAMELEON_CHARS + '|(?!' + WHITESPACE_AND_PUNCTUATION + ').)*' + '(?:(?!' + WHITESPACE_AND_PUNCTUATION + ').)';\nvar DELETE_REGEX = new RegExp(DELETE_STRING);\n\nvar BACKSPACE_STRING = '(?:(?!' + WHITESPACE_AND_PUNCTUATION + ').)' + '(?:' + CHAMELEON_CHARS + '|(?!' + WHITESPACE_AND_PUNCTUATION + ').)*' + '(?:' + WHITESPACE_AND_PUNCTUATION + ')*' + '$';\nvar BACKSPACE_REGEX = new RegExp(BACKSPACE_STRING);\n\nfunction getRemovableWord(text, isBackward) {\n  var matches = isBackward ? BACKSPACE_REGEX.exec(text) : DELETE_REGEX.exec(text);\n  return matches ? matches[0] : text;\n}\n\nvar DraftRemovableWord = {\n  getBackward: function getBackward(text) {\n    return getRemovableWord(text, true);\n  },\n\n  getForward: function getForward(text) {\n    return getRemovableWord(text, false);\n  }\n};\n\nmodule.exports = DraftRemovableWord;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getDefaultKeyBinding\n * @format\n * \n */\n\n'use strict';\n\nvar KeyBindingUtil = require('./KeyBindingUtil');\nvar Keys = require('fbjs/lib/Keys');\nvar UserAgent = require('fbjs/lib/UserAgent');\n\nvar isOSX = UserAgent.isPlatform('Mac OS X');\nvar isWindows = UserAgent.isPlatform('Windows');\n\n// Firefox on OSX had a bug resulting in navigation instead of cursor movement.\n// This bug was fixed in Firefox 29. Feature detection is virtually impossible\n// so we just check the version number. See #342765.\nvar shouldFixFirefoxMovement = isOSX && UserAgent.isBrowser('Firefox < 29');\n\nvar hasCommandModifier = KeyBindingUtil.hasCommandModifier,\n    isCtrlKeyCommand = KeyBindingUtil.isCtrlKeyCommand;\n\n\nfunction shouldRemoveWord(e) {\n  return isOSX && e.altKey || isCtrlKeyCommand(e);\n}\n\n/**\n * Get the appropriate undo/redo command for a Z key command.\n */\nfunction getZCommand(e) {\n  if (!hasCommandModifier(e)) {\n    return null;\n  }\n  return e.shiftKey ? 'redo' : 'undo';\n}\n\nfunction getDeleteCommand(e) {\n  // Allow default \"cut\" behavior for Windows on Shift + Delete.\n  if (isWindows && e.shiftKey) {\n    return null;\n  }\n  return shouldRemoveWord(e) ? 'delete-word' : 'delete';\n}\n\nfunction getBackspaceCommand(e) {\n  if (hasCommandModifier(e) && isOSX) {\n    return 'backspace-to-start-of-line';\n  }\n  return shouldRemoveWord(e) ? 'backspace-word' : 'backspace';\n}\n\n/**\n * Retrieve a bound key command for the given event.\n */\nfunction getDefaultKeyBinding(e) {\n  switch (e.keyCode) {\n    case 66:\n      // B\n      return hasCommandModifier(e) ? 'bold' : null;\n    case 68:\n      // D\n      return isCtrlKeyCommand(e) ? 'delete' : null;\n    case 72:\n      // H\n      return isCtrlKeyCommand(e) ? 'backspace' : null;\n    case 73:\n      // I\n      return hasCommandModifier(e) ? 'italic' : null;\n    case 74:\n      // J\n      return hasCommandModifier(e) ? 'code' : null;\n    case 75:\n      // K\n      return !isWindows && isCtrlKeyCommand(e) ? 'secondary-cut' : null;\n    case 77:\n      // M\n      return isCtrlKeyCommand(e) ? 'split-block' : null;\n    case 79:\n      // O\n      return isCtrlKeyCommand(e) ? 'split-block' : null;\n    case 84:\n      // T\n      return isOSX && isCtrlKeyCommand(e) ? 'transpose-characters' : null;\n    case 85:\n      // U\n      return hasCommandModifier(e) ? 'underline' : null;\n    case 87:\n      // W\n      return isOSX && isCtrlKeyCommand(e) ? 'backspace-word' : null;\n    case 89:\n      // Y\n      if (isCtrlKeyCommand(e)) {\n        return isWindows ? 'redo' : 'secondary-paste';\n      }\n      return null;\n    case 90:\n      // Z\n      return getZCommand(e) || null;\n    case Keys.RETURN:\n      return 'split-block';\n    case Keys.DELETE:\n      return getDeleteCommand(e);\n    case Keys.BACKSPACE:\n      return getBackspaceCommand(e);\n    // LEFT/RIGHT handlers serve as a workaround for a Firefox bug.\n    case Keys.LEFT:\n      return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-start-of-block' : null;\n    case Keys.RIGHT:\n      return shouldFixFirefoxMovement && hasCommandModifier(e) ? 'move-selection-to-end-of-block' : null;\n    default:\n      return null;\n  }\n}\n\nmodule.exports = getDefaultKeyBinding;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule editOnDragOver\n * @format\n * \n */\n\n'use strict';\n\n/**\n * Drag behavior has begun from outside the editor element.\n */\nfunction editOnDragOver(editor, e) {\n  editor._internalDrag = false;\n  editor.setMode('drag');\n  e.preventDefault();\n}\n\nmodule.exports = editOnDragOver;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule AtomicBlockUtils\n * @format\n * \n */\n\n'use strict';\n\nvar _assign = require('object-assign');\n\nvar _extends = _assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar BlockMapBuilder = require('./BlockMapBuilder');\nvar CharacterMetadata = require('./CharacterMetadata');\nvar ContentBlock = require('./ContentBlock');\nvar ContentBlockNode = require('./ContentBlockNode');\nvar DraftFeatureFlags = require('./DraftFeatureFlags');\nvar DraftModifier = require('./DraftModifier');\nvar EditorState = require('./EditorState');\nvar Immutable = require('immutable');\nvar SelectionState = require('./SelectionState');\n\nvar generateRandomKey = require('./generateRandomKey');\nvar moveBlockInContentState = require('./moveBlockInContentState');\n\nvar experimentalTreeDataSupport = DraftFeatureFlags.draft_tree_data_support;\nvar ContentBlockRecord = experimentalTreeDataSupport ? ContentBlockNode : ContentBlock;\n\nvar List = Immutable.List,\n    Repeat = Immutable.Repeat;\n\n\nvar AtomicBlockUtils = {\n  insertAtomicBlock: function insertAtomicBlock(editorState, entityKey, character) {\n    var contentState = editorState.getCurrentContent();\n    var selectionState = editorState.getSelection();\n\n    var afterRemoval = DraftModifier.removeRange(contentState, selectionState, 'backward');\n\n    var targetSelection = afterRemoval.getSelectionAfter();\n    var afterSplit = DraftModifier.splitBlock(afterRemoval, targetSelection);\n    var insertionTarget = afterSplit.getSelectionAfter();\n\n    var asAtomicBlock = DraftModifier.setBlockType(afterSplit, insertionTarget, 'atomic');\n\n    var charData = CharacterMetadata.create({ entity: entityKey });\n\n    var atomicBlockConfig = {\n      key: generateRandomKey(),\n      type: 'atomic',\n      text: character,\n      characterList: List(Repeat(charData, character.length))\n    };\n\n    var atomicDividerBlockConfig = {\n      key: generateRandomKey(),\n      type: 'unstyled'\n    };\n\n    if (experimentalTreeDataSupport) {\n      atomicBlockConfig = _extends({}, atomicBlockConfig, {\n        nextSibling: atomicDividerBlockConfig.key\n      });\n      atomicDividerBlockConfig = _extends({}, atomicDividerBlockConfig, {\n        prevSibling: atomicBlockConfig.key\n      });\n    }\n\n    var fragmentArray = [new ContentBlockRecord(atomicBlockConfig), new ContentBlockRecord(atomicDividerBlockConfig)];\n\n    var fragment = BlockMapBuilder.createFromArray(fragmentArray);\n\n    var withAtomicBlock = DraftModifier.replaceWithFragment(asAtomicBlock, insertionTarget, fragment);\n\n    var newContent = withAtomicBlock.merge({\n      selectionBefore: selectionState,\n      selectionAfter: withAtomicBlock.getSelectionAfter().set('hasFocus', true)\n    });\n\n    return EditorState.push(editorState, newContent, 'insert-fragment');\n  },\n\n  moveAtomicBlock: function moveAtomicBlock(editorState, atomicBlock, targetRange, insertionMode) {\n    var contentState = editorState.getCurrentContent();\n    var selectionState = editorState.getSelection();\n\n    var withMovedAtomicBlock = void 0;\n\n    if (insertionMode === 'before' || insertionMode === 'after') {\n      var targetBlock = contentState.getBlockForKey(insertionMode === 'before' ? targetRange.getStartKey() : targetRange.getEndKey());\n\n      withMovedAtomicBlock = moveBlockInContentState(contentState, atomicBlock, targetBlock, insertionMode);\n    } else {\n      var afterRemoval = DraftModifier.removeRange(contentState, targetRange, 'backward');\n\n      var selectionAfterRemoval = afterRemoval.getSelectionAfter();\n      var _targetBlock = afterRemoval.getBlockForKey(selectionAfterRemoval.getFocusKey());\n\n      if (selectionAfterRemoval.getStartOffset() === 0) {\n        withMovedAtomicBlock = moveBlockInContentState(afterRemoval, atomicBlock, _targetBlock, 'before');\n      } else if (selectionAfterRemoval.getEndOffset() === _targetBlock.getLength()) {\n        withMovedAtomicBlock = moveBlockInContentState(afterRemoval, atomicBlock, _targetBlock, 'after');\n      } else {\n        var afterSplit = DraftModifier.splitBlock(afterRemoval, selectionAfterRemoval);\n\n        var selectionAfterSplit = afterSplit.getSelectionAfter();\n        var _targetBlock2 = afterSplit.getBlockForKey(selectionAfterSplit.getFocusKey());\n\n        withMovedAtomicBlock = moveBlockInContentState(afterSplit, atomicBlock, _targetBlock2, 'before');\n      }\n    }\n\n    var newContent = withMovedAtomicBlock.merge({\n      selectionBefore: selectionState,\n      selectionAfter: withMovedAtomicBlock.getSelectionAfter().set('hasFocus', true)\n    });\n\n    return EditorState.push(editorState, newContent, 'move-block');\n  }\n};\n\nmodule.exports = AtomicBlockUtils;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule findRangesImmutable\n * @format\n * \n */\n\n'use strict';\n\n/**\n * Search through an array to find contiguous stretches of elements that\n * match a specified filter function.\n *\n * When ranges are found, execute a specified `found` function to supply\n * the values to the caller.\n */\nfunction findRangesImmutable(haystack, areEqualFn, filterFn, foundFn) {\n  if (!haystack.size) {\n    return;\n  }\n\n  var cursor = 0;\n\n  haystack.reduce(function (value, nextValue, nextIndex) {\n    if (!areEqualFn(value, nextValue)) {\n      if (filterFn(value)) {\n        foundFn(cursor, nextIndex);\n      }\n      cursor = nextIndex;\n    }\n    return nextValue;\n  });\n\n  filterFn(haystack.last()) && foundFn(cursor, haystack.count());\n}\n\nmodule.exports = findRangesImmutable;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule BlockTree\n * @format\n * \n */\n\n'use strict';\n\nvar Immutable = require('immutable');\n\nvar emptyFunction = require('fbjs/lib/emptyFunction');\nvar findRangesImmutable = require('./findRangesImmutable');\n\nvar List = Immutable.List,\n    Repeat = Immutable.Repeat,\n    Record = Immutable.Record;\n\n\nvar returnTrue = emptyFunction.thatReturnsTrue;\n\nvar FINGERPRINT_DELIMITER = '-';\n\nvar defaultLeafRange = {\n  start: null,\n  end: null\n};\n\nvar LeafRange = Record(defaultLeafRange);\n\nvar defaultDecoratorRange = {\n  start: null,\n  end: null,\n  decoratorKey: null,\n  leaves: null\n};\n\nvar DecoratorRange = Record(defaultDecoratorRange);\n\nvar BlockTree = {\n  /**\n   * Generate a block tree for a given ContentBlock/decorator pair.\n   */\n  generate: function generate(contentState, block, decorator) {\n    var textLength = block.getLength();\n    if (!textLength) {\n      return List.of(new DecoratorRange({\n        start: 0,\n        end: 0,\n        decoratorKey: null,\n        leaves: List.of(new LeafRange({ start: 0, end: 0 }))\n      }));\n    }\n\n    var leafSets = [];\n    var decorations = decorator ? decorator.getDecorations(block, contentState) : List(Repeat(null, textLength));\n\n    var chars = block.getCharacterList();\n\n    findRangesImmutable(decorations, areEqual, returnTrue, function (start, end) {\n      leafSets.push(new DecoratorRange({\n        start: start,\n        end: end,\n        decoratorKey: decorations.get(start),\n        leaves: generateLeaves(chars.slice(start, end).toList(), start)\n      }));\n    });\n\n    return List(leafSets);\n  },\n\n  /**\n   * Create a string representation of the given tree map. This allows us\n   * to rapidly determine whether a tree has undergone a significant\n   * structural change.\n   */\n  getFingerprint: function getFingerprint(tree) {\n    return tree.map(function (leafSet) {\n      var decoratorKey = leafSet.get('decoratorKey');\n      var fingerprintString = decoratorKey !== null ? decoratorKey + '.' + (leafSet.get('end') - leafSet.get('start')) : '';\n      return '' + fingerprintString + '.' + leafSet.get('leaves').size;\n    }).join(FINGERPRINT_DELIMITER);\n  }\n};\n\n/**\n * Generate LeafRange records for a given character list.\n */\nfunction generateLeaves(characters, offset) {\n  var leaves = [];\n  var inlineStyles = characters.map(function (c) {\n    return c.getStyle();\n  }).toList();\n  findRangesImmutable(inlineStyles, areEqual, returnTrue, function (start, end) {\n    leaves.push(new LeafRange({\n      start: start + offset,\n      end: end + offset\n    }));\n  });\n  return List(leaves);\n}\n\nfunction areEqual(a, b) {\n  return a === b;\n}\n\nmodule.exports = BlockTree;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getRangeBoundingClientRect\n * @format\n * \n */\n\n'use strict';\n\nvar getRangeClientRects = require('./getRangeClientRects');\n\n/**\n * Like range.getBoundingClientRect() but normalizes for browser bugs.\n */\nfunction getRangeBoundingClientRect(range) {\n  // \"Return a DOMRect object describing the smallest rectangle that includes\n  // the first rectangle in list and all of the remaining rectangles of which\n  // the height or width is not zero.\"\n  // http://www.w3.org/TR/cssom-view/#dom-range-getboundingclientrect\n  var rects = getRangeClientRects(range);\n  var top = 0;\n  var right = 0;\n  var bottom = 0;\n  var left = 0;\n\n  if (rects.length) {\n    // If the first rectangle has 0 width, we use the second, this is needed\n    // because Chrome renders a 0 width rectangle when the selection contains\n    // a line break.\n    if (rects.length > 1 && rects[0].width === 0) {\n      var _rects$ = rects[1];\n      top = _rects$.top;\n      right = _rects$.right;\n      bottom = _rects$.bottom;\n      left = _rects$.left;\n    } else {\n      var _rects$2 = rects[0];\n      top = _rects$2.top;\n      right = _rects$2.right;\n      bottom = _rects$2.bottom;\n      left = _rects$2.left;\n    }\n\n    for (var ii = 1; ii < rects.length; ii++) {\n      var rect = rects[ii];\n      if (rect.height !== 0 && rect.width !== 0) {\n        top = Math.min(top, rect.top);\n        right = Math.max(right, rect.right);\n        bottom = Math.max(bottom, rect.bottom);\n        left = Math.min(left, rect.left);\n      }\n    }\n  }\n\n  return {\n    top: top,\n    right: right,\n    bottom: bottom,\n    left: left,\n    width: right - left,\n    height: bottom - top\n  };\n}\n\nmodule.exports = getRangeBoundingClientRect;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule removeEntitiesAtEdges\n * @format\n * \n */\n\n'use strict';\n\nvar CharacterMetadata = require('./CharacterMetadata');\n\nvar findRangesImmutable = require('./findRangesImmutable');\nvar invariant = require('fbjs/lib/invariant');\n\nfunction removeEntitiesAtEdges(contentState, selectionState) {\n  var blockMap = contentState.getBlockMap();\n  var entityMap = contentState.getEntityMap();\n\n  var updatedBlocks = {};\n\n  var startKey = selectionState.getStartKey();\n  var startOffset = selectionState.getStartOffset();\n  var startBlock = blockMap.get(startKey);\n  var updatedStart = removeForBlock(entityMap, startBlock, startOffset);\n\n  if (updatedStart !== startBlock) {\n    updatedBlocks[startKey] = updatedStart;\n  }\n\n  var endKey = selectionState.getEndKey();\n  var endOffset = selectionState.getEndOffset();\n  var endBlock = blockMap.get(endKey);\n  if (startKey === endKey) {\n    endBlock = updatedStart;\n  }\n\n  var updatedEnd = removeForBlock(entityMap, endBlock, endOffset);\n\n  if (updatedEnd !== endBlock) {\n    updatedBlocks[endKey] = updatedEnd;\n  }\n\n  if (!Object.keys(updatedBlocks).length) {\n    return contentState.set('selectionAfter', selectionState);\n  }\n\n  return contentState.merge({\n    blockMap: blockMap.merge(updatedBlocks),\n    selectionAfter: selectionState\n  });\n}\n\nfunction getRemovalRange(characters, key, offset) {\n  var removalRange;\n  findRangesImmutable(characters, function (a, b) {\n    return a.getEntity() === b.getEntity();\n  }, function (element) {\n    return element.getEntity() === key;\n  }, function (start, end) {\n    if (start <= offset && end >= offset) {\n      removalRange = { start: start, end: end };\n    }\n  });\n  !(typeof removalRange === 'object') ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Removal range must exist within character list.') : invariant(false) : void 0;\n  return removalRange;\n}\n\nfunction removeForBlock(entityMap, block, offset) {\n  var chars = block.getCharacterList();\n  var charBefore = offset > 0 ? chars.get(offset - 1) : undefined;\n  var charAfter = offset < chars.count() ? chars.get(offset) : undefined;\n  var entityBeforeCursor = charBefore ? charBefore.getEntity() : undefined;\n  var entityAfterCursor = charAfter ? charAfter.getEntity() : undefined;\n\n  if (entityAfterCursor && entityAfterCursor === entityBeforeCursor) {\n    var entity = entityMap.__get(entityAfterCursor);\n    if (entity.getMutability() !== 'MUTABLE') {\n      var _getRemovalRange = getRemovalRange(chars, entityAfterCursor, offset),\n          start = _getRemovalRange.start,\n          end = _getRemovalRange.end;\n\n      var current;\n      while (start < end) {\n        current = chars.get(start);\n        chars = chars.set(start, CharacterMetadata.applyEntity(current, null));\n        start++;\n      }\n      return block.set('characterList', chars);\n    }\n  }\n\n  return block;\n}\n\nmodule.exports = removeEntitiesAtEdges;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DraftEditorDragHandler\n * @format\n * \n */\n\n'use strict';\n\nvar DataTransfer = require('fbjs/lib/DataTransfer');\nvar DraftModifier = require('./DraftModifier');\nvar EditorState = require('./EditorState');\n\nvar findAncestorOffsetKey = require('./findAncestorOffsetKey');\nvar getTextContentFromFiles = require('./getTextContentFromFiles');\nvar getUpdatedSelectionState = require('./getUpdatedSelectionState');\nvar isEventHandled = require('./isEventHandled');\nvar nullthrows = require('fbjs/lib/nullthrows');\n\n/**\n * Get a SelectionState for the supplied mouse event.\n */\nfunction getSelectionForEvent(event, editorState) {\n  var node = null;\n  var offset = null;\n\n  if (typeof document.caretRangeFromPoint === 'function') {\n    var dropRange = document.caretRangeFromPoint(event.x, event.y);\n    node = dropRange.startContainer;\n    offset = dropRange.startOffset;\n  } else if (event.rangeParent) {\n    node = event.rangeParent;\n    offset = event.rangeOffset;\n  } else {\n    return null;\n  }\n\n  node = nullthrows(node);\n  offset = nullthrows(offset);\n  var offsetKey = nullthrows(findAncestorOffsetKey(node));\n\n  return getUpdatedSelectionState(editorState, offsetKey, offset, offsetKey, offset);\n}\n\nvar DraftEditorDragHandler = {\n  /**\n   * Drag originating from input terminated.\n   */\n  onDragEnd: function onDragEnd(editor) {\n    editor.exitCurrentMode();\n  },\n\n  /**\n   * Handle data being dropped.\n   */\n  onDrop: function onDrop(editor, e) {\n    var data = new DataTransfer(e.nativeEvent.dataTransfer);\n\n    var editorState = editor._latestEditorState;\n    var dropSelection = getSelectionForEvent(e.nativeEvent, editorState);\n\n    e.preventDefault();\n    editor.exitCurrentMode();\n\n    if (dropSelection == null) {\n      return;\n    }\n\n    var files = data.getFiles();\n    if (files.length > 0) {\n      if (editor.props.handleDroppedFiles && isEventHandled(editor.props.handleDroppedFiles(dropSelection, files))) {\n        return;\n      }\n\n      getTextContentFromFiles(files, function (fileText) {\n        fileText && editor.update(insertTextAtSelection(editorState, dropSelection, fileText));\n      });\n      return;\n    }\n\n    var dragType = editor._internalDrag ? 'internal' : 'external';\n    if (editor.props.handleDrop && isEventHandled(editor.props.handleDrop(dropSelection, data, dragType))) {\n      return;\n    }\n\n    if (editor._internalDrag) {\n      editor.update(moveText(editorState, dropSelection));\n      return;\n    }\n\n    editor.update(insertTextAtSelection(editorState, dropSelection, data.getText()));\n  }\n};\n\nfunction moveText(editorState, targetSelection) {\n  var newContentState = DraftModifier.moveText(editorState.getCurrentContent(), editorState.getSelection(), targetSelection);\n  return EditorState.push(editorState, newContentState, 'insert-fragment');\n}\n\n/**\n * Insert text at a specified selection.\n */\nfunction insertTextAtSelection(editorState, selection, text) {\n  var newContentState = DraftModifier.insertText(editorState.getCurrentContent(), selection, text, editorState.getCurrentInlineStyle());\n  return EditorState.push(editorState, newContentState, 'insert-fragment');\n}\n\nmodule.exports = DraftEditorDragHandler;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule createCharacterList\n * @format\n * \n */\n\n'use strict';\n\nvar CharacterMetadata = require('./CharacterMetadata');\nvar Immutable = require('immutable');\n\nvar List = Immutable.List;\n\n\nfunction createCharacterList(inlineStyles, entities) {\n  var characterArray = inlineStyles.map(function (style, ii) {\n    var entity = entities[ii];\n    return CharacterMetadata.create({ style: style, entity: entity });\n  });\n  return List(characterArray);\n}\n\nmodule.exports = createCharacterList;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DraftEditorPlaceholder.react\n * @format\n * \n */\n\n'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar React = require('react');\n\nvar cx = require('fbjs/lib/cx');\n\n/**\n * This component is responsible for rendering placeholder text for the\n * `DraftEditor` component.\n *\n * Override placeholder style via CSS.\n */\nvar DraftEditorPlaceholder = function (_React$Component) {\n  _inherits(DraftEditorPlaceholder, _React$Component);\n\n  function DraftEditorPlaceholder() {\n    _classCallCheck(this, DraftEditorPlaceholder);\n\n    return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n  }\n\n  DraftEditorPlaceholder.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {\n    return this.props.text !== nextProps.text || this.props.editorState.getSelection().getHasFocus() !== nextProps.editorState.getSelection().getHasFocus();\n  };\n\n  DraftEditorPlaceholder.prototype.render = function render() {\n    var hasFocus = this.props.editorState.getSelection().getHasFocus();\n\n    var className = cx({\n      'public/DraftEditorPlaceholder/root': true,\n      'public/DraftEditorPlaceholder/hasFocus': hasFocus\n    });\n\n    var contentStyle = {\n      whiteSpace: 'pre-wrap'\n    };\n\n    return React.createElement(\n      'div',\n      { className: className },\n      React.createElement(\n        'div',\n        {\n          className: cx('public/DraftEditorPlaceholder/inner'),\n          id: this.props.accessibilityID,\n          style: contentStyle },\n        this.props.text\n      )\n    );\n  };\n\n  return DraftEditorPlaceholder;\n}(React.Component);\n\nmodule.exports = DraftEditorPlaceholder;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule adjustBlockDepthForContentState\n * @format\n * \n */\n\n'use strict';\n\nfunction adjustBlockDepthForContentState(contentState, selectionState, adjustment, maxDepth) {\n  var startKey = selectionState.getStartKey();\n  var endKey = selectionState.getEndKey();\n  var blockMap = contentState.getBlockMap();\n  var blocks = blockMap.toSeq().skipUntil(function (_, k) {\n    return k === startKey;\n  }).takeUntil(function (_, k) {\n    return k === endKey;\n  }).concat([[endKey, blockMap.get(endKey)]]).map(function (block) {\n    var depth = block.getDepth() + adjustment;\n    depth = Math.max(0, Math.min(depth, maxDepth));\n    return block.set('depth', depth);\n  });\n\n  blockMap = blockMap.merge(blocks);\n\n  return contentState.merge({\n    blockMap: blockMap,\n    selectionBefore: selectionState,\n    selectionAfter: selectionState\n  });\n}\n\nmodule.exports = adjustBlockDepthForContentState;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule editOnPaste\n * @format\n * \n */\n\n'use strict';\n\nvar BlockMapBuilder = require('./BlockMapBuilder');\nvar CharacterMetadata = require('./CharacterMetadata');\nvar DataTransfer = require('fbjs/lib/DataTransfer');\nvar DraftModifier = require('./DraftModifier');\nvar DraftPasteProcessor = require('./DraftPasteProcessor');\nvar EditorState = require('./EditorState');\nvar RichTextEditorUtil = require('./RichTextEditorUtil');\n\nvar getEntityKeyForSelection = require('./getEntityKeyForSelection');\nvar getTextContentFromFiles = require('./getTextContentFromFiles');\nvar isEventHandled = require('./isEventHandled');\nvar splitTextIntoTextBlocks = require('./splitTextIntoTextBlocks');\n\n/**\n * Paste content.\n */\nfunction editOnPaste(editor, e) {\n  e.preventDefault();\n  var data = new DataTransfer(e.clipboardData);\n\n  // Get files, unless this is likely to be a string the user wants inline.\n  if (!data.isRichText()) {\n    var files = data.getFiles();\n    var defaultFileText = data.getText();\n    if (files.length > 0) {\n      // Allow customized paste handling for images, etc. Otherwise, fall\n      // through to insert text contents into the editor.\n      if (editor.props.handlePastedFiles && isEventHandled(editor.props.handlePastedFiles(files))) {\n        return;\n      }\n\n      getTextContentFromFiles(files, function ( /*string*/fileText) {\n        fileText = fileText || defaultFileText;\n        if (!fileText) {\n          return;\n        }\n\n        var editorState = editor._latestEditorState;\n        var blocks = splitTextIntoTextBlocks(fileText);\n        var character = CharacterMetadata.create({\n          style: editorState.getCurrentInlineStyle(),\n          entity: getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection())\n        });\n        var currentBlockType = RichTextEditorUtil.getCurrentBlockType(editorState);\n\n        var text = DraftPasteProcessor.processText(blocks, character, currentBlockType);\n        var fragment = BlockMapBuilder.createFromArray(text);\n\n        var withInsertedText = DraftModifier.replaceWithFragment(editorState.getCurrentContent(), editorState.getSelection(), fragment);\n\n        editor.update(EditorState.push(editorState, withInsertedText, 'insert-fragment'));\n      });\n\n      return;\n    }\n  }\n\n  var textBlocks = [];\n  var text = data.getText();\n  var html = data.getHTML();\n  var editorState = editor._latestEditorState;\n\n  if (editor.props.handlePastedText && isEventHandled(editor.props.handlePastedText(text, html, editorState))) {\n    return;\n  }\n\n  if (text) {\n    textBlocks = splitTextIntoTextBlocks(text);\n  }\n\n  if (!editor.props.stripPastedStyles) {\n    // If the text from the paste event is rich content that matches what we\n    // already have on the internal clipboard, assume that we should just use\n    // the clipboard fragment for the paste. This will allow us to preserve\n    // styling and entities, if any are present. Note that newlines are\n    // stripped during comparison -- this is because copy/paste within the\n    // editor in Firefox and IE will not include empty lines. The resulting\n    // paste will preserve the newlines correctly.\n    var internalClipboard = editor.getClipboard();\n    if (data.isRichText() && internalClipboard) {\n      if (\n      // If the editorKey is present in the pasted HTML, it should be safe to\n      // assume this is an internal paste.\n      html.indexOf(editor.getEditorKey()) !== -1 ||\n      // The copy may have been made within a single block, in which case the\n      // editor key won't be part of the paste. In this case, just check\n      // whether the pasted text matches the internal clipboard.\n      textBlocks.length === 1 && internalClipboard.size === 1 && internalClipboard.first().getText() === text) {\n        editor.update(insertFragment(editor._latestEditorState, internalClipboard));\n        return;\n      }\n    } else if (internalClipboard && data.types.includes('com.apple.webarchive') && !data.types.includes('text/html') && areTextBlocksAndClipboardEqual(textBlocks, internalClipboard)) {\n      // Safari does not properly store text/html in some cases.\n      // Use the internalClipboard if present and equal to what is on\n      // the clipboard. See https://bugs.webkit.org/show_bug.cgi?id=19893.\n      editor.update(insertFragment(editor._latestEditorState, internalClipboard));\n      return;\n    }\n\n    // If there is html paste data, try to parse that.\n    if (html) {\n      var htmlFragment = DraftPasteProcessor.processHTML(html, editor.props.blockRenderMap);\n      if (htmlFragment) {\n        var contentBlocks = htmlFragment.contentBlocks,\n            entityMap = htmlFragment.entityMap;\n\n        if (contentBlocks) {\n          var htmlMap = BlockMapBuilder.createFromArray(contentBlocks);\n          editor.update(insertFragment(editor._latestEditorState, htmlMap, entityMap));\n          return;\n        }\n      }\n    }\n\n    // Otherwise, create a new fragment from our pasted text. Also\n    // empty the internal clipboard, since it's no longer valid.\n    editor.setClipboard(null);\n  }\n\n  if (textBlocks.length) {\n    var character = CharacterMetadata.create({\n      style: editorState.getCurrentInlineStyle(),\n      entity: getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection())\n    });\n\n    var currentBlockType = RichTextEditorUtil.getCurrentBlockType(editorState);\n\n    var textFragment = DraftPasteProcessor.processText(textBlocks, character, currentBlockType);\n\n    var textMap = BlockMapBuilder.createFromArray(textFragment);\n    editor.update(insertFragment(editor._latestEditorState, textMap));\n  }\n}\n\nfunction insertFragment(editorState, fragment, entityMap) {\n  var newContent = DraftModifier.replaceWithFragment(editorState.getCurrentContent(), editorState.getSelection(), fragment);\n  // TODO: merge the entity map once we stop using DraftEntity\n  // like this:\n  // const mergedEntityMap = newContent.getEntityMap().merge(entityMap);\n\n  return EditorState.push(editorState, newContent.set('entityMap', entityMap), 'insert-fragment');\n}\n\nfunction areTextBlocksAndClipboardEqual(textBlocks, blockMap) {\n  return textBlocks.length === blockMap.size && blockMap.valueSeq().every(function (block, ii) {\n    return block.getText() === textBlocks[ii];\n  });\n}\n\nmodule.exports = editOnPaste;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule decodeEntityRanges\n * @format\n * \n */\n\n'use strict';\n\nvar UnicodeUtils = require('fbjs/lib/UnicodeUtils');\n\nvar substr = UnicodeUtils.substr;\n\n/**\n * Convert to native JavaScript string lengths to determine ranges.\n */\n\nfunction decodeEntityRanges(text, ranges) {\n  var entities = Array(text.length).fill(null);\n  if (ranges) {\n    ranges.forEach(function (range) {\n      // Using Unicode-enabled substrings converted to JavaScript lengths,\n      // fill the output array with entity keys.\n      var start = substr(text, 0, range.offset).length;\n      var end = start + substr(text, range.offset, range.length).length;\n      for (var ii = start; ii < end; ii++) {\n        entities[ii] = range.key;\n      }\n    });\n  }\n  return entities;\n}\n\nmodule.exports = decodeEntityRanges;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DraftEditorContents-core.react\n * @format\n * \n */\n\n'use strict';\n\nvar _assign = require('object-assign');\n\nvar _extends = _assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar DraftEditorBlock = require('./DraftEditorBlock.react');\nvar DraftOffsetKey = require('./DraftOffsetKey');\nvar EditorState = require('./EditorState');\nvar React = require('react');\n\nvar cx = require('fbjs/lib/cx');\nvar joinClasses = require('fbjs/lib/joinClasses');\nvar nullthrows = require('fbjs/lib/nullthrows');\n\n/**\n * Provide default styling for list items. This way, lists will be styled with\n * proper counters and indentation even if the caller does not specify\n * their own styling at all. If more than five levels of nesting are needed,\n * the necessary CSS classes can be provided via `blockStyleFn` configuration.\n */\nvar getListItemClasses = function getListItemClasses(type, depth, shouldResetCount, direction) {\n  return cx({\n    'public/DraftStyleDefault/unorderedListItem': type === 'unordered-list-item',\n    'public/DraftStyleDefault/orderedListItem': type === 'ordered-list-item',\n    'public/DraftStyleDefault/reset': shouldResetCount,\n    'public/DraftStyleDefault/depth0': depth === 0,\n    'public/DraftStyleDefault/depth1': depth === 1,\n    'public/DraftStyleDefault/depth2': depth === 2,\n    'public/DraftStyleDefault/depth3': depth === 3,\n    'public/DraftStyleDefault/depth4': depth === 4,\n    'public/DraftStyleDefault/listLTR': direction === 'LTR',\n    'public/DraftStyleDefault/listRTL': direction === 'RTL'\n  });\n};\n\n/**\n * `DraftEditorContents` is the container component for all block components\n * rendered for a `DraftEditor`. It is optimized to aggressively avoid\n * re-rendering blocks whenever possible.\n *\n * This component is separate from `DraftEditor` because certain props\n * (for instance, ARIA props) must be allowed to update without affecting\n * the contents of the editor.\n */\n\nvar DraftEditorContents = function (_React$Component) {\n  _inherits(DraftEditorContents, _React$Component);\n\n  function DraftEditorContents() {\n    _classCallCheck(this, DraftEditorContents);\n\n    return _possibleConstructorReturn(this, _React$Component.apply(this, arguments));\n  }\n\n  DraftEditorContents.prototype.shouldComponentUpdate = function shouldComponentUpdate(nextProps) {\n    var prevEditorState = this.props.editorState;\n    var nextEditorState = nextProps.editorState;\n\n    var prevDirectionMap = prevEditorState.getDirectionMap();\n    var nextDirectionMap = nextEditorState.getDirectionMap();\n\n    // Text direction has changed for one or more blocks. We must re-render.\n    if (prevDirectionMap !== nextDirectionMap) {\n      return true;\n    }\n\n    var didHaveFocus = prevEditorState.getSelection().getHasFocus();\n    var nowHasFocus = nextEditorState.getSelection().getHasFocus();\n\n    if (didHaveFocus !== nowHasFocus) {\n      return true;\n    }\n\n    var nextNativeContent = nextEditorState.getNativelyRenderedContent();\n\n    var wasComposing = prevEditorState.isInCompositionMode();\n    var nowComposing = nextEditorState.isInCompositionMode();\n\n    // If the state is unchanged or we're currently rendering a natively\n    // rendered state, there's nothing new to be done.\n    if (prevEditorState === nextEditorState || nextNativeContent !== null && nextEditorState.getCurrentContent() === nextNativeContent || wasComposing && nowComposing) {\n      return false;\n    }\n\n    var prevContent = prevEditorState.getCurrentContent();\n    var nextContent = nextEditorState.getCurrentContent();\n    var prevDecorator = prevEditorState.getDecorator();\n    var nextDecorator = nextEditorState.getDecorator();\n    return wasComposing !== nowComposing || prevContent !== nextContent || prevDecorator !== nextDecorator || nextEditorState.mustForceSelection();\n  };\n\n  DraftEditorContents.prototype.render = function render() {\n    var _props = this.props,\n        blockRenderMap = _props.blockRenderMap,\n        blockRendererFn = _props.blockRendererFn,\n        blockStyleFn = _props.blockStyleFn,\n        customStyleMap = _props.customStyleMap,\n        customStyleFn = _props.customStyleFn,\n        editorState = _props.editorState,\n        editorKey = _props.editorKey,\n        textDirectionality = _props.textDirectionality;\n\n\n    var content = editorState.getCurrentContent();\n    var selection = editorState.getSelection();\n    var forceSelection = editorState.mustForceSelection();\n    var decorator = editorState.getDecorator();\n    var directionMap = nullthrows(editorState.getDirectionMap());\n\n    var blocksAsArray = content.getBlocksAsArray();\n    var processedBlocks = [];\n\n    var currentDepth = null;\n    var lastWrapperTemplate = null;\n\n    for (var ii = 0; ii < blocksAsArray.length; ii++) {\n      var _block = blocksAsArray[ii];\n      var key = _block.getKey();\n      var blockType = _block.getType();\n\n      var customRenderer = blockRendererFn(_block);\n      var CustomComponent = void 0,\n          customProps = void 0,\n          customEditable = void 0;\n      if (customRenderer) {\n        CustomComponent = customRenderer.component;\n        customProps = customRenderer.props;\n        customEditable = customRenderer.editable;\n      }\n\n      var direction = textDirectionality ? textDirectionality : directionMap.get(key);\n      var offsetKey = DraftOffsetKey.encode(key, 0, 0);\n      var componentProps = {\n        contentState: content,\n        block: _block,\n        blockProps: customProps,\n        blockStyleFn: blockStyleFn,\n        customStyleMap: customStyleMap,\n        customStyleFn: customStyleFn,\n        decorator: decorator,\n        direction: direction,\n        forceSelection: forceSelection,\n        key: key,\n        offsetKey: offsetKey,\n        selection: selection,\n        tree: editorState.getBlockTree(key)\n      };\n\n      var configForType = blockRenderMap.get(blockType) || blockRenderMap.get('unstyled');\n      var wrapperTemplate = configForType.wrapper;\n\n      var Element = configForType.element || blockRenderMap.get('unstyled').element;\n\n      var depth = _block.getDepth();\n      var className = '';\n      if (blockStyleFn) {\n        className = blockStyleFn(_block);\n      }\n\n      // List items are special snowflakes, since we handle nesting and\n      // counters manually.\n      if (Element === 'li') {\n        var shouldResetCount = lastWrapperTemplate !== wrapperTemplate || currentDepth === null || depth > currentDepth;\n        className = joinClasses(className, getListItemClasses(blockType, depth, shouldResetCount, direction));\n      }\n\n      var Component = CustomComponent || DraftEditorBlock;\n      var childProps = {\n        className: className,\n        'data-block': true,\n        'data-editor': editorKey,\n        'data-offset-key': offsetKey,\n        key: key\n      };\n      if (customEditable !== undefined) {\n        childProps = _extends({}, childProps, {\n          contentEditable: customEditable,\n          suppressContentEditableWarning: true\n        });\n      }\n\n      var child = React.createElement(Element, childProps, React.createElement(Component, componentProps));\n\n      processedBlocks.push({\n        block: child,\n        wrapperTemplate: wrapperTemplate,\n        key: key,\n        offsetKey: offsetKey\n      });\n\n      if (wrapperTemplate) {\n        currentDepth = _block.getDepth();\n      } else {\n        currentDepth = null;\n      }\n      lastWrapperTemplate = wrapperTemplate;\n    }\n\n    // Group contiguous runs of blocks that have the same wrapperTemplate\n    var outputBlocks = [];\n    for (var _ii = 0; _ii < processedBlocks.length;) {\n      var info = processedBlocks[_ii];\n      if (info.wrapperTemplate) {\n        var blocks = [];\n        do {\n          blocks.push(processedBlocks[_ii].block);\n          _ii++;\n        } while (_ii < processedBlocks.length && processedBlocks[_ii].wrapperTemplate === info.wrapperTemplate);\n        var wrapperElement = React.cloneElement(info.wrapperTemplate, {\n          key: info.key + '-wrap',\n          'data-offset-key': info.offsetKey\n        }, blocks);\n        outputBlocks.push(wrapperElement);\n      } else {\n        outputBlocks.push(info.block);\n        _ii++;\n      }\n    }\n\n    return React.createElement(\n      'div',\n      { 'data-contents': 'true' },\n      outputBlocks\n    );\n  };\n\n  return DraftEditorContents;\n}(React.Component);\n\nmodule.exports = DraftEditorContents;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule convertFromHTMLToContentBlocks\n * @format\n * \n */\n\n'use strict';\n\nvar _extends = _assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\nvar _knownListItemDepthCl,\n    _assign = require('object-assign');\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nvar CharacterMetadata = require('./CharacterMetadata');\nvar ContentBlock = require('./ContentBlock');\nvar ContentBlockNode = require('./ContentBlockNode');\nvar DefaultDraftBlockRenderMap = require('./DefaultDraftBlockRenderMap');\nvar DraftEntity = require('./DraftEntity');\nvar DraftFeatureFlags = require('./DraftFeatureFlags');\nvar Immutable = require('immutable');\n\nvar _require = require('immutable'),\n    Set = _require.Set;\n\nvar URI = require('fbjs/lib/URI');\n\nvar cx = require('fbjs/lib/cx');\nvar generateRandomKey = require('./generateRandomKey');\nvar getSafeBodyFromHTML = require('./getSafeBodyFromHTML');\nvar invariant = require('fbjs/lib/invariant');\nvar sanitizeDraftText = require('./sanitizeDraftText');\n\nvar experimentalTreeDataSupport = DraftFeatureFlags.draft_tree_data_support;\n\nvar List = Immutable.List,\n    OrderedSet = Immutable.OrderedSet;\n\n\nvar NBSP = '&nbsp;';\nvar SPACE = ' ';\n\n// Arbitrary max indent\nvar MAX_DEPTH = 4;\n\n// used for replacing characters in HTML\nvar REGEX_CR = new RegExp('\\r', 'g');\nvar REGEX_LF = new RegExp('\\n', 'g');\nvar REGEX_NBSP = new RegExp(NBSP, 'g');\nvar REGEX_CARRIAGE = new RegExp('&#13;?', 'g');\nvar REGEX_ZWS = new RegExp('&#8203;?', 'g');\n\n// https://developer.mozilla.org/en-US/docs/Web/CSS/font-weight\nvar boldValues = ['bold', 'bolder', '500', '600', '700', '800', '900'];\nvar notBoldValues = ['light', 'lighter', '100', '200', '300', '400'];\n\n// Block tag flow is different because LIs do not have\n// a deterministic style ;_;\nvar inlineTags = {\n  b: 'BOLD',\n  code: 'CODE',\n  del: 'STRIKETHROUGH',\n  em: 'ITALIC',\n  i: 'ITALIC',\n  s: 'STRIKETHROUGH',\n  strike: 'STRIKETHROUGH',\n  strong: 'BOLD',\n  u: 'UNDERLINE'\n};\n\nvar knownListItemDepthClasses = (_knownListItemDepthCl = {}, _defineProperty(_knownListItemDepthCl, cx('public/DraftStyleDefault/depth0'), 0), _defineProperty(_knownListItemDepthCl, cx('public/DraftStyleDefault/depth1'), 1), _defineProperty(_knownListItemDepthCl, cx('public/DraftStyleDefault/depth2'), 2), _defineProperty(_knownListItemDepthCl, cx('public/DraftStyleDefault/depth3'), 3), _defineProperty(_knownListItemDepthCl, cx('public/DraftStyleDefault/depth4'), 4), _knownListItemDepthCl);\n\nvar anchorAttr = ['className', 'href', 'rel', 'target', 'title'];\n\nvar imgAttr = ['alt', 'className', 'height', 'src', 'width'];\n\nvar lastBlock = void 0;\n\nvar EMPTY_CHUNK = {\n  text: '',\n  inlines: [],\n  entities: [],\n  blocks: []\n};\n\nvar EMPTY_BLOCK = {\n  children: List(),\n  depth: 0,\n  key: '',\n  type: ''\n};\n\nvar getListBlockType = function getListBlockType(tag, lastList) {\n  if (tag === 'li') {\n    return lastList === 'ol' ? 'ordered-list-item' : 'unordered-list-item';\n  }\n  return null;\n};\n\nvar getBlockMapSupportedTags = function getBlockMapSupportedTags(blockRenderMap) {\n  var unstyledElement = blockRenderMap.get('unstyled').element;\n  var tags = Set([]);\n\n  blockRenderMap.forEach(function (draftBlock) {\n    if (draftBlock.aliasedElements) {\n      draftBlock.aliasedElements.forEach(function (tag) {\n        tags = tags.add(tag);\n      });\n    }\n\n    tags = tags.add(draftBlock.element);\n  });\n\n  return tags.filter(function (tag) {\n    return tag && tag !== unstyledElement;\n  }).toArray().sort();\n};\n\n// custom element conversions\nvar getMultiMatchedType = function getMultiMatchedType(tag, lastList, multiMatchExtractor) {\n  for (var ii = 0; ii < multiMatchExtractor.length; ii++) {\n    var matchType = multiMatchExtractor[ii](tag, lastList);\n    if (matchType) {\n      return matchType;\n    }\n  }\n  return null;\n};\n\nvar getBlockTypeForTag = function getBlockTypeForTag(tag, lastList, blockRenderMap) {\n  var matchedTypes = blockRenderMap.filter(function (draftBlock) {\n    return draftBlock.element === tag || draftBlock.wrapper === tag || draftBlock.aliasedElements && draftBlock.aliasedElements.some(function (alias) {\n      return alias === tag;\n    });\n  }).keySeq().toSet().toArray().sort();\n\n  // if we dont have any matched type, return unstyled\n  // if we have one matched type return it\n  // if we have multi matched types use the multi-match function to gather type\n  switch (matchedTypes.length) {\n    case 0:\n      return 'unstyled';\n    case 1:\n      return matchedTypes[0];\n    default:\n      return getMultiMatchedType(tag, lastList, [getListBlockType]) || 'unstyled';\n  }\n};\n\nvar processInlineTag = function processInlineTag(tag, node, currentStyle) {\n  var styleToCheck = inlineTags[tag];\n  if (styleToCheck) {\n    currentStyle = currentStyle.add(styleToCheck).toOrderedSet();\n  } else if (node instanceof HTMLElement) {\n    var htmlElement = node;\n    currentStyle = currentStyle.withMutations(function (style) {\n      var fontWeight = htmlElement.style.fontWeight;\n      var fontStyle = htmlElement.style.fontStyle;\n      var textDecoration = htmlElement.style.textDecoration;\n\n      if (boldValues.indexOf(fontWeight) >= 0) {\n        style.add('BOLD');\n      } else if (notBoldValues.indexOf(fontWeight) >= 0) {\n        style.remove('BOLD');\n      }\n\n      if (fontStyle === 'italic') {\n        style.add('ITALIC');\n      } else if (fontStyle === 'normal') {\n        style.remove('ITALIC');\n      }\n\n      if (textDecoration === 'underline') {\n        style.add('UNDERLINE');\n      }\n      if (textDecoration === 'line-through') {\n        style.add('STRIKETHROUGH');\n      }\n      if (textDecoration === 'none') {\n        style.remove('UNDERLINE');\n        style.remove('STRIKETHROUGH');\n      }\n    }).toOrderedSet();\n  }\n  return currentStyle;\n};\n\nvar joinChunks = function joinChunks(A, B, experimentalHasNestedBlocks) {\n  // Sometimes two blocks will touch in the DOM and we need to strip the\n  // extra delimiter to preserve niceness.\n  var lastInA = A.text.slice(-1);\n  var firstInB = B.text.slice(0, 1);\n\n  if (lastInA === '\\r' && firstInB === '\\r' && !experimentalHasNestedBlocks) {\n    A.text = A.text.slice(0, -1);\n    A.inlines.pop();\n    A.entities.pop();\n    A.blocks.pop();\n  }\n\n  // Kill whitespace after blocks\n  if (lastInA === '\\r') {\n    if (B.text === SPACE || B.text === '\\n') {\n      return A;\n    } else if (firstInB === SPACE || firstInB === '\\n') {\n      B.text = B.text.slice(1);\n      B.inlines.shift();\n      B.entities.shift();\n    }\n  }\n\n  return {\n    text: A.text + B.text,\n    inlines: A.inlines.concat(B.inlines),\n    entities: A.entities.concat(B.entities),\n    blocks: A.blocks.concat(B.blocks)\n  };\n};\n\n/**\n * Check to see if we have anything like <p> <blockquote> <h1>... to create\n * block tags from. If we do, we can use those and ignore <div> tags. If we\n * don't, we can treat <div> tags as meaningful (unstyled) blocks.\n */\nvar containsSemanticBlockMarkup = function containsSemanticBlockMarkup(html, blockTags) {\n  return blockTags.some(function (tag) {\n    return html.indexOf('<' + tag) !== -1;\n  });\n};\n\nvar hasValidLinkText = function hasValidLinkText(link) {\n  !(link instanceof HTMLAnchorElement) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Link must be an HTMLAnchorElement.') : invariant(false) : void 0;\n  var protocol = link.protocol;\n  return protocol === 'http:' || protocol === 'https:' || protocol === 'mailto:';\n};\n\nvar getWhitespaceChunk = function getWhitespaceChunk(inEntity) {\n  var entities = new Array(1);\n  if (inEntity) {\n    entities[0] = inEntity;\n  }\n  return _extends({}, EMPTY_CHUNK, {\n    text: SPACE,\n    inlines: [OrderedSet()],\n    entities: entities\n  });\n};\n\nvar getSoftNewlineChunk = function getSoftNewlineChunk() {\n  return _extends({}, EMPTY_CHUNK, {\n    text: '\\n',\n    inlines: [OrderedSet()],\n    entities: new Array(1)\n  });\n};\n\nvar getChunkedBlock = function getChunkedBlock() {\n  var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n  return _extends({}, EMPTY_BLOCK, props);\n};\n\nvar getBlockDividerChunk = function getBlockDividerChunk(block, depth) {\n  var parentKey = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;\n\n  return {\n    text: '\\r',\n    inlines: [OrderedSet()],\n    entities: new Array(1),\n    blocks: [getChunkedBlock({\n      parent: parentKey,\n      key: generateRandomKey(),\n      type: block,\n      depth: Math.max(0, Math.min(MAX_DEPTH, depth))\n    })]\n  };\n};\n\n/**\n *  If we're pasting from one DraftEditor to another we can check to see if\n *  existing list item depth classes are being used and preserve this style\n */\nvar getListItemDepth = function getListItemDepth(node) {\n  var depth = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;\n\n  Object.keys(knownListItemDepthClasses).some(function (depthClass) {\n    if (node.classList.contains(depthClass)) {\n      depth = knownListItemDepthClasses[depthClass];\n    }\n  });\n  return depth;\n};\n\nvar genFragment = function genFragment(entityMap, node, inlineStyle, lastList, inBlock, blockTags, depth, blockRenderMap, inEntity, parentKey) {\n  var lastLastBlock = lastBlock;\n  var nodeName = node.nodeName.toLowerCase();\n  var newEntityMap = entityMap;\n  var nextBlockType = 'unstyled';\n  var newBlock = false;\n  var inBlockType = inBlock && getBlockTypeForTag(inBlock, lastList, blockRenderMap);\n  var chunk = _extends({}, EMPTY_CHUNK);\n  var newChunk = null;\n  var blockKey = void 0;\n\n  // Base Case\n  if (nodeName === '#text') {\n    var _text = node.textContent;\n    var nodeTextContent = _text.trim();\n\n    // We should not create blocks for leading spaces that are\n    // existing around ol/ul and their children list items\n    if (lastList && nodeTextContent === '' && node.parentElement) {\n      var parentNodeName = node.parentElement.nodeName.toLowerCase();\n      if (parentNodeName === 'ol' || parentNodeName === 'ul') {\n        return { chunk: _extends({}, EMPTY_CHUNK), entityMap: entityMap };\n      }\n    }\n\n    if (nodeTextContent === '' && inBlock !== 'pre') {\n      return { chunk: getWhitespaceChunk(inEntity), entityMap: entityMap };\n    }\n    if (inBlock !== 'pre') {\n      // Can't use empty string because MSWord\n      _text = _text.replace(REGEX_LF, SPACE);\n    }\n\n    // save the last block so we can use it later\n    lastBlock = nodeName;\n\n    return {\n      chunk: {\n        text: _text,\n        inlines: Array(_text.length).fill(inlineStyle),\n        entities: Array(_text.length).fill(inEntity),\n        blocks: []\n      },\n      entityMap: entityMap\n    };\n  }\n\n  // save the last block so we can use it later\n  lastBlock = nodeName;\n\n  // BR tags\n  if (nodeName === 'br') {\n    if (lastLastBlock === 'br' && (!inBlock || inBlockType === 'unstyled')) {\n      return {\n        chunk: getBlockDividerChunk('unstyled', depth, parentKey),\n        entityMap: entityMap\n      };\n    }\n    return { chunk: getSoftNewlineChunk(), entityMap: entityMap };\n  }\n\n  // IMG tags\n  if (nodeName === 'img' && node instanceof HTMLImageElement && node.attributes.getNamedItem('src') && node.attributes.getNamedItem('src').value) {\n    var image = node;\n    var entityConfig = {};\n\n    imgAttr.forEach(function (attr) {\n      var imageAttribute = image.getAttribute(attr);\n      if (imageAttribute) {\n        entityConfig[attr] = imageAttribute;\n      }\n    });\n    // Forcing this node to have children because otherwise no entity will be\n    // created for this node.\n    // The child text node cannot just have a space or return as content -\n    // we strip those out.\n    // See https://github.com/facebook/draft-js/issues/231 for some context.\n    node.textContent = '\\uD83D\\uDCF7';\n\n    // TODO: update this when we remove DraftEntity entirely\n    inEntity = DraftEntity.__create('IMAGE', 'MUTABLE', entityConfig || {});\n  }\n\n  // Inline tags\n  inlineStyle = processInlineTag(nodeName, node, inlineStyle);\n\n  // Handle lists\n  if (nodeName === 'ul' || nodeName === 'ol') {\n    if (lastList) {\n      depth += 1;\n    }\n    lastList = nodeName;\n  }\n\n  if (!experimentalTreeDataSupport && nodeName === 'li' && node instanceof HTMLElement) {\n    depth = getListItemDepth(node, depth);\n  }\n\n  var blockType = getBlockTypeForTag(nodeName, lastList, blockRenderMap);\n  var inListBlock = lastList && inBlock === 'li' && nodeName === 'li';\n  var inBlockOrHasNestedBlocks = (!inBlock || experimentalTreeDataSupport) && blockTags.indexOf(nodeName) !== -1;\n\n  // Block Tags\n  if (inListBlock || inBlockOrHasNestedBlocks) {\n    chunk = getBlockDividerChunk(blockType, depth, parentKey);\n    blockKey = chunk.blocks[0].key;\n    inBlock = nodeName;\n    newBlock = !experimentalTreeDataSupport;\n  }\n\n  // this is required so that we can handle 'ul' and 'ol'\n  if (inListBlock) {\n    nextBlockType = lastList === 'ul' ? 'unordered-list-item' : 'ordered-list-item';\n  }\n\n  // Recurse through children\n  var child = node.firstChild;\n  if (child != null) {\n    nodeName = child.nodeName.toLowerCase();\n  }\n\n  var entityId = null;\n\n  while (child) {\n    if (child instanceof HTMLAnchorElement && child.href && hasValidLinkText(child)) {\n      (function () {\n        var anchor = child;\n        var entityConfig = {};\n\n        anchorAttr.forEach(function (attr) {\n          var anchorAttribute = anchor.getAttribute(attr);\n          if (anchorAttribute) {\n            entityConfig[attr] = anchorAttribute;\n          }\n        });\n\n        entityConfig.url = new URI(anchor.href).toString();\n        // TODO: update this when we remove DraftEntity completely\n        entityId = DraftEntity.__create('LINK', 'MUTABLE', entityConfig || {});\n      })();\n    } else {\n      entityId = undefined;\n    }\n\n    var _genFragment = genFragment(newEntityMap, child, inlineStyle, lastList, inBlock, blockTags, depth, blockRenderMap, entityId || inEntity, experimentalTreeDataSupport ? blockKey : null),\n        generatedChunk = _genFragment.chunk,\n        maybeUpdatedEntityMap = _genFragment.entityMap;\n\n    newChunk = generatedChunk;\n    newEntityMap = maybeUpdatedEntityMap;\n\n    chunk = joinChunks(chunk, newChunk, experimentalTreeDataSupport);\n    var sibling = child.nextSibling;\n\n    // Put in a newline to break up blocks inside blocks\n    if (!parentKey && sibling && blockTags.indexOf(nodeName) >= 0 && inBlock) {\n      chunk = joinChunks(chunk, getSoftNewlineChunk());\n    }\n    if (sibling) {\n      nodeName = sibling.nodeName.toLowerCase();\n    }\n    child = sibling;\n  }\n\n  if (newBlock) {\n    chunk = joinChunks(chunk, getBlockDividerChunk(nextBlockType, depth, parentKey));\n  }\n\n  return { chunk: chunk, entityMap: newEntityMap };\n};\n\nvar getChunkForHTML = function getChunkForHTML(html, DOMBuilder, blockRenderMap, entityMap) {\n  html = html.trim().replace(REGEX_CR, '').replace(REGEX_NBSP, SPACE).replace(REGEX_CARRIAGE, '').replace(REGEX_ZWS, '');\n\n  var supportedBlockTags = getBlockMapSupportedTags(blockRenderMap);\n\n  var safeBody = DOMBuilder(html);\n  if (!safeBody) {\n    return null;\n  }\n  lastBlock = null;\n\n  // Sometimes we aren't dealing with content that contains nice semantic\n  // tags. In this case, use divs to separate everything out into paragraphs\n  // and hope for the best.\n  var workingBlocks = containsSemanticBlockMarkup(html, supportedBlockTags) ? supportedBlockTags : ['div'];\n\n  // Start with -1 block depth to offset the fact that we are passing in a fake\n  // UL block to start with.\n  var fragment = genFragment(entityMap, safeBody, OrderedSet(), 'ul', null, workingBlocks, -1, blockRenderMap);\n\n  var chunk = fragment.chunk;\n  var newEntityMap = fragment.entityMap;\n\n  // join with previous block to prevent weirdness on paste\n  if (chunk.text.indexOf('\\r') === 0) {\n    chunk = {\n      text: chunk.text.slice(1),\n      inlines: chunk.inlines.slice(1),\n      entities: chunk.entities.slice(1),\n      blocks: chunk.blocks\n    };\n  }\n\n  // Kill block delimiter at the end\n  if (chunk.text.slice(-1) === '\\r') {\n    chunk.text = chunk.text.slice(0, -1);\n    chunk.inlines = chunk.inlines.slice(0, -1);\n    chunk.entities = chunk.entities.slice(0, -1);\n    chunk.blocks.pop();\n  }\n\n  // If we saw no block tags, put an unstyled one in\n  if (chunk.blocks.length === 0) {\n    chunk.blocks.push(_extends({}, EMPTY_CHUNK, {\n      type: 'unstyled',\n      depth: 0\n    }));\n  }\n\n  // Sometimes we start with text that isn't in a block, which is then\n  // followed by blocks. Need to fix up the blocks to add in\n  // an unstyled block for this content\n  if (chunk.text.split('\\r').length === chunk.blocks.length + 1) {\n    chunk.blocks.unshift({ type: 'unstyled', depth: 0 });\n  }\n\n  return { chunk: chunk, entityMap: newEntityMap };\n};\n\nvar convertChunkToContentBlocks = function convertChunkToContentBlocks(chunk) {\n  if (!chunk || !chunk.text || !Array.isArray(chunk.blocks)) {\n    return null;\n  }\n\n  var initialState = {\n    cacheRef: {},\n    contentBlocks: []\n  };\n\n  var start = 0;\n\n  var rawBlocks = chunk.blocks,\n      rawInlines = chunk.inlines,\n      rawEntities = chunk.entities;\n\n\n  var BlockNodeRecord = experimentalTreeDataSupport ? ContentBlockNode : ContentBlock;\n\n  return chunk.text.split('\\r').reduce(function (acc, textBlock, index) {\n    // Make absolutely certain that our text is acceptable.\n    textBlock = sanitizeDraftText(textBlock);\n\n    var block = rawBlocks[index];\n    var end = start + textBlock.length;\n    var inlines = rawInlines.slice(start, end);\n    var entities = rawEntities.slice(start, end);\n    var characterList = List(inlines.map(function (style, index) {\n      var data = { style: style, entity: null };\n      if (entities[index]) {\n        data.entity = entities[index];\n      }\n      return CharacterMetadata.create(data);\n    }));\n    start = end + 1;\n\n    var depth = block.depth,\n        type = block.type,\n        parent = block.parent;\n\n\n    var key = block.key || generateRandomKey();\n    var parentTextNodeKey = null; // will be used to store container text nodes\n\n    // childrens add themselves to their parents since we are iterating in order\n    if (parent) {\n      var parentIndex = acc.cacheRef[parent];\n      var parentRecord = acc.contentBlocks[parentIndex];\n\n      // if parent has text we need to split it into a separate unstyled element\n      if (parentRecord.getChildKeys().isEmpty() && parentRecord.getText()) {\n        var parentCharacterList = parentRecord.getCharacterList();\n        var parentText = parentRecord.getText();\n        parentTextNodeKey = generateRandomKey();\n\n        var textNode = new ContentBlockNode({\n          key: parentTextNodeKey,\n          text: parentText,\n          characterList: parentCharacterList,\n          parent: parent,\n          nextSibling: key\n        });\n\n        acc.contentBlocks.push(textNode);\n\n        parentRecord = parentRecord.withMutations(function (block) {\n          block.set('characterList', List()).set('text', '').set('children', parentRecord.children.push(textNode.getKey()));\n        });\n      }\n\n      acc.contentBlocks[parentIndex] = parentRecord.set('children', parentRecord.children.push(key));\n    }\n\n    var blockNode = new BlockNodeRecord({\n      key: key,\n      parent: parent,\n      type: type,\n      depth: depth,\n      text: textBlock,\n      characterList: characterList,\n      prevSibling: parentTextNodeKey || (index === 0 || rawBlocks[index - 1].parent !== parent ? null : rawBlocks[index - 1].key),\n      nextSibling: index === rawBlocks.length - 1 || rawBlocks[index + 1].parent !== parent ? null : rawBlocks[index + 1].key\n    });\n\n    // insert node\n    acc.contentBlocks.push(blockNode);\n\n    // cache ref for building links\n    acc.cacheRef[blockNode.key] = index;\n\n    return acc;\n  }, initialState).contentBlocks;\n};\n\nvar convertFromHTMLtoContentBlocks = function convertFromHTMLtoContentBlocks(html) {\n  var DOMBuilder = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : getSafeBodyFromHTML;\n  var blockRenderMap = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : DefaultDraftBlockRenderMap;\n\n  // Be ABSOLUTELY SURE that the dom builder you pass here won't execute\n  // arbitrary code in whatever environment you're running this in. For an\n  // example of how we try to do this in-browser, see getSafeBodyFromHTML.\n\n  // TODO: replace DraftEntity with an OrderedMap here\n  var chunkData = getChunkForHTML(html, DOMBuilder, blockRenderMap, DraftEntity);\n\n  if (chunkData == null) {\n    return null;\n  }\n\n  var chunk = chunkData.chunk,\n      entityMap = chunkData.entityMap;\n\n  var contentBlocks = convertChunkToContentBlocks(chunk);\n\n  return {\n    contentBlocks: contentBlocks,\n    entityMap: entityMap\n  };\n};\n\nmodule.exports = convertFromHTMLtoContentBlocks;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule keyCommandDeleteWord\n * @format\n * \n */\n\n'use strict';\n\nvar DraftRemovableWord = require('./DraftRemovableWord');\nvar EditorState = require('./EditorState');\n\nvar moveSelectionForward = require('./moveSelectionForward');\nvar removeTextWithStrategy = require('./removeTextWithStrategy');\n\n/**\n * Delete the word that is right of the cursor, as well as any spaces or\n * punctuation before the word.\n */\nfunction keyCommandDeleteWord(editorState) {\n  var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n    var selection = strategyState.getSelection();\n    var offset = selection.getStartOffset();\n    var key = selection.getStartKey();\n    var content = strategyState.getCurrentContent();\n    var text = content.getBlockForKey(key).getText().slice(offset);\n    var toRemove = DraftRemovableWord.getForward(text);\n\n    // If there are no words in front of the cursor, remove the newline.\n    return moveSelectionForward(strategyState, toRemove.length || 1);\n  }, 'forward');\n\n  if (afterRemoval === editorState.getCurrentContent()) {\n    return editorState;\n  }\n\n  return EditorState.push(editorState, afterRemoval, 'remove-range');\n}\n\nmodule.exports = keyCommandDeleteWord;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getRangesForDraftEntity\n * @format\n * \n */\n\n'use strict';\n\nvar invariant = require('fbjs/lib/invariant');\n\n/**\n * Obtain the start and end positions of the range that has the\n * specified entity applied to it.\n *\n * Entity keys are applied only to contiguous stretches of text, so this\n * method searches for the first instance of the entity key and returns\n * the subsequent range.\n */\nfunction getRangesForDraftEntity(block, key) {\n  var ranges = [];\n  block.findEntityRanges(function (c) {\n    return c.getEntity() === key;\n  }, function (start, end) {\n    ranges.push({ start: start, end: end });\n  });\n\n  !!!ranges.length ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Entity key not found in this range.') : invariant(false) : void 0;\n\n  return ranges;\n}\n\nmodule.exports = getRangesForDraftEntity;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule isEventHandled\n * @format\n * \n */\n\n'use strict';\n\n/**\n * Utility method for determining whether or not the value returned\n * from a handler indicates that it was handled.\n */\nfunction isEventHandled(value) {\n  return value === 'handled' || value === true;\n}\n\nmodule.exports = isEventHandled;","/**\n * Copyright 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DraftFeatureFlags-core\n * @format\n * \n */\n\n'use strict';\n\nvar DraftFeatureFlags = {\n  draft_killswitch_allow_nontextnodes: false,\n  draft_segmented_entities_behavior: false,\n  draft_handlebeforeinput_composed_text: false,\n  draft_tree_data_support: false\n};\n\nmodule.exports = DraftFeatureFlags;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule removeTextWithStrategy\n * @format\n * \n */\n\n'use strict';\n\nvar DraftModifier = require('./DraftModifier');\n\n/**\n * For a collapsed selection state, remove text based on the specified strategy.\n * If the selection state is not collapsed, remove the entire selected range.\n */\nfunction removeTextWithStrategy(editorState, strategy, direction) {\n  var selection = editorState.getSelection();\n  var content = editorState.getCurrentContent();\n  var target = selection;\n  if (selection.isCollapsed()) {\n    if (direction === 'forward') {\n      if (editorState.isSelectionAtEndOfContent()) {\n        return content;\n      }\n    } else if (editorState.isSelectionAtStartOfContent()) {\n      return content;\n    }\n\n    target = strategy(editorState);\n    if (target === selection) {\n      return content;\n    }\n  }\n  return DraftModifier.removeRange(content, target, direction);\n}\n\nmodule.exports = removeTextWithStrategy;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DefaultDraftInlineStyle\n * @format\n * \n */\n\n'use strict';\n\nmodule.exports = {\n  BOLD: {\n    fontWeight: 'bold'\n  },\n\n  CODE: {\n    fontFamily: 'monospace',\n    wordWrap: 'break-word'\n  },\n\n  ITALIC: {\n    fontStyle: 'italic'\n  },\n\n  STRIKETHROUGH: {\n    textDecoration: 'line-through'\n  },\n\n  UNDERLINE: {\n    textDecoration: 'underline'\n  }\n};","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule editOnBeforeInput\n * @format\n * \n */\n\n'use strict';\n\nvar BlockTree = require('./BlockTree');\nvar DraftModifier = require('./DraftModifier');\nvar EditorState = require('./EditorState');\nvar UserAgent = require('fbjs/lib/UserAgent');\n\nvar getEntityKeyForSelection = require('./getEntityKeyForSelection');\nvar isEventHandled = require('./isEventHandled');\nvar isSelectionAtLeafStart = require('./isSelectionAtLeafStart');\nvar nullthrows = require('fbjs/lib/nullthrows');\nvar setImmediate = require('fbjs/lib/setImmediate');\n\n// When nothing is focused, Firefox regards two characters, `'` and `/`, as\n// commands that should open and focus the \"quickfind\" search bar. This should\n// *never* happen while a contenteditable is focused, but as of v28, it\n// sometimes does, even when the keypress event target is the contenteditable.\n// This breaks the input. Special case these characters to ensure that when\n// they are typed, we prevent default on the event to make sure not to\n// trigger quickfind.\nvar FF_QUICKFIND_CHAR = \"'\";\nvar FF_QUICKFIND_LINK_CHAR = '/';\nvar isFirefox = UserAgent.isBrowser('Firefox');\n\nfunction mustPreventDefaultForCharacter(character) {\n  return isFirefox && (character == FF_QUICKFIND_CHAR || character == FF_QUICKFIND_LINK_CHAR);\n}\n\n/**\n * Replace the current selection with the specified text string, with the\n * inline style and entity key applied to the newly inserted text.\n */\nfunction replaceText(editorState, text, inlineStyle, entityKey) {\n  var contentState = DraftModifier.replaceText(editorState.getCurrentContent(), editorState.getSelection(), text, inlineStyle, entityKey);\n  return EditorState.push(editorState, contentState, 'insert-characters');\n}\n\n/**\n * When `onBeforeInput` executes, the browser is attempting to insert a\n * character into the editor. Apply this character data to the document,\n * allowing native insertion if possible.\n *\n * Native insertion is encouraged in order to limit re-rendering and to\n * preserve spellcheck highlighting, which disappears or flashes if re-render\n * occurs on the relevant text nodes.\n */\nfunction editOnBeforeInput(editor, e) {\n  if (editor._pendingStateFromBeforeInput !== undefined) {\n    editor.update(editor._pendingStateFromBeforeInput);\n    editor._pendingStateFromBeforeInput = undefined;\n  }\n\n  var editorState = editor._latestEditorState;\n\n  var chars = e.data;\n\n  // In some cases (ex: IE ideographic space insertion) no character data\n  // is provided. There's nothing to do when this happens.\n  if (!chars) {\n    return;\n  }\n\n  // Allow the top-level component to handle the insertion manually. This is\n  // useful when triggering interesting behaviors for a character insertion,\n  // Simple examples: replacing a raw text ':)' with a smile emoji or image\n  // decorator, or setting a block to be a list item after typing '- ' at the\n  // start of the block.\n  if (editor.props.handleBeforeInput && isEventHandled(editor.props.handleBeforeInput(chars, editorState))) {\n    e.preventDefault();\n    return;\n  }\n\n  // If selection is collapsed, conditionally allow native behavior. This\n  // reduces re-renders and preserves spellcheck highlighting. If the selection\n  // is not collapsed, we will re-render.\n  var selection = editorState.getSelection();\n  var selectionStart = selection.getStartOffset();\n  var selectionEnd = selection.getEndOffset();\n  var anchorKey = selection.getAnchorKey();\n\n  if (!selection.isCollapsed()) {\n    e.preventDefault();\n\n    // If the currently selected text matches what the user is trying to\n    // replace it with, let's just update the `SelectionState`. If not, update\n    // the `ContentState` with the new text.\n    var currentlySelectedChars = editorState.getCurrentContent().getPlainText().slice(selectionStart, selectionEnd);\n    if (chars === currentlySelectedChars) {\n      editor.update(EditorState.forceSelection(editorState, selection.merge({\n        focusOffset: selectionEnd\n      })));\n    } else {\n      editor.update(replaceText(editorState, chars, editorState.getCurrentInlineStyle(), getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection())));\n    }\n    return;\n  }\n\n  var newEditorState = replaceText(editorState, chars, editorState.getCurrentInlineStyle(), getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection()));\n\n  // Bunch of different cases follow where we need to prevent native insertion.\n  var mustPreventNative = false;\n  if (!mustPreventNative) {\n    // Browsers tend to insert text in weird places in the DOM when typing at\n    // the start of a leaf, so we'll handle it ourselves.\n    mustPreventNative = isSelectionAtLeafStart(editor._latestCommittedEditorState);\n  }\n  if (!mustPreventNative) {\n    // Chrome will also split up a node into two pieces if it contains a Tab\n    // char, for no explicable reason. Seemingly caused by this commit:\n    // https://chromium.googlesource.com/chromium/src/+/013ac5eaf3%5E%21/\n    var nativeSelection = global.getSelection();\n    // Selection is necessarily collapsed at this point due to earlier check.\n    if (nativeSelection.anchorNode && nativeSelection.anchorNode.nodeType === Node.TEXT_NODE) {\n      // See isTabHTMLSpanElement in chromium EditingUtilities.cpp.\n      var parentNode = nativeSelection.anchorNode.parentNode;\n      mustPreventNative = parentNode.nodeName === 'SPAN' && parentNode.firstChild.nodeType === Node.TEXT_NODE && parentNode.firstChild.nodeValue.indexOf('\\t') !== -1;\n    }\n  }\n  if (!mustPreventNative) {\n    // Check the old and new \"fingerprints\" of the current block to determine\n    // whether this insertion requires any addition or removal of text nodes,\n    // in which case we would prevent the native character insertion.\n    var originalFingerprint = BlockTree.getFingerprint(editorState.getBlockTree(anchorKey));\n    var newFingerprint = BlockTree.getFingerprint(newEditorState.getBlockTree(anchorKey));\n    mustPreventNative = originalFingerprint !== newFingerprint;\n  }\n  if (!mustPreventNative) {\n    mustPreventNative = mustPreventDefaultForCharacter(chars);\n  }\n  if (!mustPreventNative) {\n    mustPreventNative = nullthrows(newEditorState.getDirectionMap()).get(anchorKey) !== nullthrows(editorState.getDirectionMap()).get(anchorKey);\n  }\n\n  if (mustPreventNative) {\n    e.preventDefault();\n    editor.update(newEditorState);\n    return;\n  }\n\n  // We made it all the way! Let the browser do its thing and insert the char.\n  newEditorState = EditorState.set(newEditorState, {\n    nativelyRenderedContent: newEditorState.getCurrentContent()\n  });\n  // The native event is allowed to occur. To allow user onChange handlers to\n  // change the inserted text, we wait until the text is actually inserted\n  // before we actually update our state. That way when we rerender, the text\n  // we see in the DOM will already have been inserted properly.\n  editor._pendingStateFromBeforeInput = newEditorState;\n  setImmediate(function () {\n    if (editor._pendingStateFromBeforeInput !== undefined) {\n      editor.update(editor._pendingStateFromBeforeInput);\n      editor._pendingStateFromBeforeInput = undefined;\n    }\n  });\n}\n\nmodule.exports = editOnBeforeInput;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ContentStateInlineStyle\n * @format\n * \n */\n\n'use strict';\n\nvar CharacterMetadata = require('./CharacterMetadata');\n\nvar _require = require('immutable'),\n    Map = _require.Map;\n\nvar ContentStateInlineStyle = {\n  add: function add(contentState, selectionState, inlineStyle) {\n    return modifyInlineStyle(contentState, selectionState, inlineStyle, true);\n  },\n\n  remove: function remove(contentState, selectionState, inlineStyle) {\n    return modifyInlineStyle(contentState, selectionState, inlineStyle, false);\n  }\n};\n\nfunction modifyInlineStyle(contentState, selectionState, inlineStyle, addOrRemove) {\n  var blockMap = contentState.getBlockMap();\n  var startKey = selectionState.getStartKey();\n  var startOffset = selectionState.getStartOffset();\n  var endKey = selectionState.getEndKey();\n  var endOffset = selectionState.getEndOffset();\n\n  var newBlocks = blockMap.skipUntil(function (_, k) {\n    return k === startKey;\n  }).takeUntil(function (_, k) {\n    return k === endKey;\n  }).concat(Map([[endKey, blockMap.get(endKey)]])).map(function (block, blockKey) {\n    var sliceStart;\n    var sliceEnd;\n\n    if (startKey === endKey) {\n      sliceStart = startOffset;\n      sliceEnd = endOffset;\n    } else {\n      sliceStart = blockKey === startKey ? startOffset : 0;\n      sliceEnd = blockKey === endKey ? endOffset : block.getLength();\n    }\n\n    var chars = block.getCharacterList();\n    var current;\n    while (sliceStart < sliceEnd) {\n      current = chars.get(sliceStart);\n      chars = chars.set(sliceStart, addOrRemove ? CharacterMetadata.applyStyle(current, inlineStyle) : CharacterMetadata.removeStyle(current, inlineStyle));\n      sliceStart++;\n    }\n\n    return block.set('characterList', chars);\n  });\n\n  return contentState.merge({\n    blockMap: blockMap.merge(newBlocks),\n    selectionBefore: selectionState,\n    selectionAfter: selectionState\n  });\n}\n\nmodule.exports = ContentStateInlineStyle;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule editOnInput\n * @format\n * \n */\n\n'use strict';\n\nvar DraftFeatureFlags = require('./DraftFeatureFlags');\nvar DraftModifier = require('./DraftModifier');\nvar DraftOffsetKey = require('./DraftOffsetKey');\nvar EditorState = require('./EditorState');\nvar UserAgent = require('fbjs/lib/UserAgent');\n\nvar findAncestorOffsetKey = require('./findAncestorOffsetKey');\nvar nullthrows = require('fbjs/lib/nullthrows');\n\nvar isGecko = UserAgent.isEngine('Gecko');\n\nvar DOUBLE_NEWLINE = '\\n\\n';\n\n/**\n * This function is intended to handle spellcheck and autocorrect changes,\n * which occur in the DOM natively without any opportunity to observe or\n * interpret the changes before they occur.\n *\n * The `input` event fires in contentEditable elements reliably for non-IE\n * browsers, immediately after changes occur to the editor DOM. Since our other\n * handlers override or otherwise handle cover other varieties of text input,\n * the DOM state should match the model in all controlled input cases. Thus,\n * when an `input` change leads to a DOM/model mismatch, the change should be\n * due to a spellcheck change, and we can incorporate it into our model.\n */\nfunction editOnInput(editor) {\n  if (editor._pendingStateFromBeforeInput !== undefined) {\n    editor.update(editor._pendingStateFromBeforeInput);\n    editor._pendingStateFromBeforeInput = undefined;\n  }\n\n  var domSelection = global.getSelection();\n\n  var anchorNode = domSelection.anchorNode,\n      isCollapsed = domSelection.isCollapsed;\n\n  var isNotTextNode = anchorNode.nodeType !== Node.TEXT_NODE;\n  var isNotTextOrElementNode = anchorNode.nodeType !== Node.TEXT_NODE && anchorNode.nodeType !== Node.ELEMENT_NODE;\n\n  if (DraftFeatureFlags.draft_killswitch_allow_nontextnodes) {\n    if (isNotTextNode) {\n      return;\n    }\n  } else {\n    if (isNotTextOrElementNode) {\n      // TODO: (t16149272) figure out context for this change\n      return;\n    }\n  }\n\n  if (anchorNode.nodeType === Node.TEXT_NODE && (anchorNode.previousSibling !== null || anchorNode.nextSibling !== null)) {\n    // When typing at the beginning of a visual line, Chrome splits the text\n    // nodes into two. Why? No one knows. This commit is suspicious:\n    // https://chromium.googlesource.com/chromium/src/+/a3b600981286b135632371477f902214c55a1724\n    // To work around, we'll merge the sibling text nodes back into this one.\n    var span = anchorNode.parentNode;\n    anchorNode.nodeValue = span.textContent;\n    for (var child = span.firstChild; child !== null; child = child.nextSibling) {\n      if (child !== anchorNode) {\n        span.removeChild(child);\n      }\n    }\n  }\n\n  var domText = anchorNode.textContent;\n  var editorState = editor._latestEditorState;\n  var offsetKey = nullthrows(findAncestorOffsetKey(anchorNode));\n\n  var _DraftOffsetKey$decod = DraftOffsetKey.decode(offsetKey),\n      blockKey = _DraftOffsetKey$decod.blockKey,\n      decoratorKey = _DraftOffsetKey$decod.decoratorKey,\n      leafKey = _DraftOffsetKey$decod.leafKey;\n\n  var _editorState$getBlock = editorState.getBlockTree(blockKey).getIn([decoratorKey, 'leaves', leafKey]),\n      start = _editorState$getBlock.start,\n      end = _editorState$getBlock.end;\n\n  var content = editorState.getCurrentContent();\n  var block = content.getBlockForKey(blockKey);\n  var modelText = block.getText().slice(start, end);\n\n  // Special-case soft newlines here. If the DOM text ends in a soft newline,\n  // we will have manually inserted an extra soft newline in DraftEditorLeaf.\n  // We want to remove this extra newline for the purpose of our comparison\n  // of DOM and model text.\n  if (domText.endsWith(DOUBLE_NEWLINE)) {\n    domText = domText.slice(0, -1);\n  }\n\n  // No change -- the DOM is up to date. Nothing to do here.\n  if (domText === modelText) {\n    // This can be buggy for some Android keyboards because they don't fire\n    // standard onkeydown/pressed events and only fired editOnInput\n    // so domText is already changed by the browser and ends up being equal\n    // to modelText unexpectedly\n    return;\n  }\n\n  var selection = editorState.getSelection();\n\n  // We'll replace the entire leaf with the text content of the target.\n  var targetRange = selection.merge({\n    anchorOffset: start,\n    focusOffset: end,\n    isBackward: false\n  });\n\n  var entityKey = block.getEntityAt(start);\n  var entity = entityKey && content.getEntity(entityKey);\n  var entityType = entity && entity.getMutability();\n  var preserveEntity = entityType === 'MUTABLE';\n\n  // Immutable or segmented entities cannot properly be handled by the\n  // default browser undo, so we have to use a different change type to\n  // force using our internal undo method instead of falling through to the\n  // native browser undo.\n  var changeType = preserveEntity ? 'spellcheck-change' : 'apply-entity';\n\n  var newContent = DraftModifier.replaceText(content, targetRange, domText, block.getInlineStyleAt(start), preserveEntity ? block.getEntityAt(start) : null);\n\n  var anchorOffset, focusOffset, startOffset, endOffset;\n\n  if (isGecko) {\n    // Firefox selection does not change while the context menu is open, so\n    // we preserve the anchor and focus values of the DOM selection.\n    anchorOffset = domSelection.anchorOffset;\n    focusOffset = domSelection.focusOffset;\n    startOffset = start + Math.min(anchorOffset, focusOffset);\n    endOffset = startOffset + Math.abs(anchorOffset - focusOffset);\n    anchorOffset = startOffset;\n    focusOffset = endOffset;\n  } else {\n    // Browsers other than Firefox may adjust DOM selection while the context\n    // menu is open, and Safari autocorrect is prone to providing an inaccurate\n    // DOM selection. Don't trust it. Instead, use our existing SelectionState\n    // and adjust it based on the number of characters changed during the\n    // mutation.\n    var charDelta = domText.length - modelText.length;\n    startOffset = selection.getStartOffset();\n    endOffset = selection.getEndOffset();\n\n    anchorOffset = isCollapsed ? endOffset + charDelta : startOffset;\n    focusOffset = endOffset + charDelta;\n  }\n\n  // Segmented entities are completely or partially removed when their\n  // text content changes. For this case we do not want any text to be selected\n  // after the change, so we are not merging the selection.\n  var contentWithAdjustedDOMSelection = newContent.merge({\n    selectionBefore: content.getSelectionAfter(),\n    selectionAfter: selection.merge({ anchorOffset: anchorOffset, focusOffset: focusOffset })\n  });\n\n  editor.update(EditorState.push(editorState, contentWithAdjustedDOMSelection, changeType));\n}\n\nmodule.exports = editOnInput;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule keyCommandBackspaceWord\n * @format\n * \n */\n\n'use strict';\n\nvar DraftRemovableWord = require('./DraftRemovableWord');\nvar EditorState = require('./EditorState');\n\nvar moveSelectionBackward = require('./moveSelectionBackward');\nvar removeTextWithStrategy = require('./removeTextWithStrategy');\n\n/**\n * Delete the word that is left of the cursor, as well as any spaces or\n * punctuation after the word.\n */\nfunction keyCommandBackspaceWord(editorState) {\n  var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n    var selection = strategyState.getSelection();\n    var offset = selection.getStartOffset();\n    // If there are no words before the cursor, remove the preceding newline.\n    if (offset === 0) {\n      return moveSelectionBackward(strategyState, 1);\n    }\n    var key = selection.getStartKey();\n    var content = strategyState.getCurrentContent();\n    var text = content.getBlockForKey(key).getText().slice(0, offset);\n    var toRemove = DraftRemovableWord.getBackward(text);\n    return moveSelectionBackward(strategyState, toRemove.length || 1);\n  }, 'backward');\n\n  if (afterRemoval === editorState.getCurrentContent()) {\n    return editorState;\n  }\n\n  return EditorState.push(editorState, afterRemoval, 'remove-range');\n}\n\nmodule.exports = keyCommandBackspaceWord;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule modifyBlockForContentState\n * @format\n * \n */\n\n'use strict';\n\nvar Immutable = require('immutable');\n\nvar Map = Immutable.Map;\n\n\nfunction modifyBlockForContentState(contentState, selectionState, operation) {\n  var startKey = selectionState.getStartKey();\n  var endKey = selectionState.getEndKey();\n  var blockMap = contentState.getBlockMap();\n  var newBlocks = blockMap.toSeq().skipUntil(function (_, k) {\n    return k === startKey;\n  }).takeUntil(function (_, k) {\n    return k === endKey;\n  }).concat(Map([[endKey, blockMap.get(endKey)]])).map(operation);\n\n  return contentState.merge({\n    blockMap: blockMap.merge(newBlocks),\n    selectionBefore: selectionState,\n    selectionAfter: selectionState\n  });\n}\n\nmodule.exports = modifyBlockForContentState;","'use strict';\n\nvar _assign = require('object-assign');\n\nvar _extends = _assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DraftTreeAdapter\n * @format\n * \n *\n * This is unstable and not part of the public API and should not be used by\n * production systems. This file may be update/removed without notice.\n */\n\nvar invariant = require('fbjs/lib/invariant');\n\nvar traverseInDepthOrder = function traverseInDepthOrder(blocks, fn) {\n  var stack = [].concat(blocks).reverse();\n  while (stack.length) {\n    var _block = stack.pop();\n\n    fn(_block);\n\n    var children = _block.children;\n\n    !Array.isArray(children) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Invalid tree raw block') : invariant(false) : void 0;\n\n    stack = stack.concat([].concat(children.reverse()));\n  }\n};\n\nvar isListBlock = function isListBlock(block) {\n  if (!(block && block.type)) {\n    return false;\n  }\n  var type = block.type;\n\n  return type === 'unordered-list-item' || type === 'ordered-list-item';\n};\n\nvar addDepthToChildren = function addDepthToChildren(block) {\n  if (Array.isArray(block.children)) {\n    block.children = block.children.map(function (child) {\n      return child.type === block.type ? _extends({}, child, { depth: (block.depth || 0) + 1 }) : child;\n    });\n  }\n};\n\n/**\n * This adapter is intended to be be used as an adapter to draft tree data\n *\n * draft state <=====> draft tree state\n */\nvar DraftTreeAdapter = {\n  /**\n   * Converts from a tree raw state back to  draft raw state\n   */\n  fromRawTreeStateToRawState: function fromRawTreeStateToRawState(draftTreeState) {\n    var blocks = draftTreeState.blocks;\n\n    var transformedBlocks = [];\n\n    !Array.isArray(blocks) ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Invalid raw state') : invariant(false) : void 0;\n\n    if (!Array.isArray(blocks) || !blocks.length) {\n      return draftTreeState;\n    }\n\n    traverseInDepthOrder(blocks, function (block) {\n      var newBlock = _extends({}, block);\n\n      if (isListBlock(block)) {\n        newBlock.depth = newBlock.depth || 0;\n        addDepthToChildren(block);\n      }\n\n      delete newBlock.children;\n\n      transformedBlocks.push(newBlock);\n    });\n\n    draftTreeState.blocks = transformedBlocks;\n\n    return _extends({}, draftTreeState, {\n      blocks: transformedBlocks\n    });\n  },\n\n\n  /**\n   * Converts from draft raw state to tree draft state\n   */\n  fromRawStateToRawTreeState: function fromRawStateToRawTreeState(draftState) {\n    var lastListDepthCacheRef = {};\n    var transformedBlocks = [];\n\n    draftState.blocks.forEach(function (block) {\n      var isList = isListBlock(block);\n      var depth = block.depth || 0;\n      var treeBlock = _extends({}, block, {\n        children: []\n      });\n\n      if (!isList) {\n        // reset the cache path\n        lastListDepthCacheRef = {};\n        transformedBlocks.push(treeBlock);\n        return;\n      }\n\n      // update our depth cache reference path\n      lastListDepthCacheRef[depth] = treeBlock;\n\n      // if we are greater than zero we must have seen a parent already\n      if (depth > 0) {\n        var parent = lastListDepthCacheRef[depth - 1];\n\n        !parent ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Invalid depth for RawDraftContentBlock') : invariant(false) : void 0;\n\n        // push nested list blocks\n        parent.children.push(treeBlock);\n        return;\n      }\n\n      // push root list blocks\n      transformedBlocks.push(treeBlock);\n    });\n\n    return _extends({}, draftState, {\n      blocks: transformedBlocks\n    });\n  }\n};\n\nmodule.exports = DraftTreeAdapter;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule keyCommandPlainBackspace\n * @format\n * \n */\n\n'use strict';\n\nvar EditorState = require('./EditorState');\nvar UnicodeUtils = require('fbjs/lib/UnicodeUtils');\n\nvar moveSelectionBackward = require('./moveSelectionBackward');\nvar removeTextWithStrategy = require('./removeTextWithStrategy');\n\n/**\n * Remove the selected range. If the cursor is collapsed, remove the preceding\n * character. This operation is Unicode-aware, so removing a single character\n * will remove a surrogate pair properly as well.\n */\nfunction keyCommandPlainBackspace(editorState) {\n  var afterRemoval = removeTextWithStrategy(editorState, function (strategyState) {\n    var selection = strategyState.getSelection();\n    var content = strategyState.getCurrentContent();\n    var key = selection.getAnchorKey();\n    var offset = selection.getAnchorOffset();\n    var charBehind = content.getBlockForKey(key).getText()[offset - 1];\n    return moveSelectionBackward(strategyState, charBehind ? UnicodeUtils.getUTF16Length(charBehind, 0) : 1);\n  }, 'backward');\n\n  if (afterRemoval === editorState.getCurrentContent()) {\n    return editorState;\n  }\n\n  var selection = editorState.getSelection();\n  return EditorState.push(editorState, afterRemoval.set('selectionBefore', selection), selection.isCollapsed() ? 'backspace-character' : 'remove-range');\n}\n\nmodule.exports = keyCommandPlainBackspace;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getUpdatedSelectionState\n * @format\n * \n */\n\n'use strict';\n\nvar DraftOffsetKey = require('./DraftOffsetKey');\n\nvar nullthrows = require('fbjs/lib/nullthrows');\n\nfunction getUpdatedSelectionState(editorState, anchorKey, anchorOffset, focusKey, focusOffset) {\n  var selection = nullthrows(editorState.getSelection());\n  if (process.env.NODE_ENV !== 'production') {\n    if (!anchorKey || !focusKey) {\n      /*eslint-disable no-console */\n      console.warn('Invalid selection state.', arguments, editorState.toJS());\n      /*eslint-enable no-console */\n      return selection;\n    }\n  }\n\n  var anchorPath = DraftOffsetKey.decode(anchorKey);\n  var anchorBlockKey = anchorPath.blockKey;\n  var anchorLeaf = editorState.getBlockTree(anchorBlockKey).getIn([anchorPath.decoratorKey, 'leaves', anchorPath.leafKey]);\n\n  var focusPath = DraftOffsetKey.decode(focusKey);\n  var focusBlockKey = focusPath.blockKey;\n  var focusLeaf = editorState.getBlockTree(focusBlockKey).getIn([focusPath.decoratorKey, 'leaves', focusPath.leafKey]);\n\n  var anchorLeafStart = anchorLeaf.get('start');\n  var focusLeafStart = focusLeaf.get('start');\n\n  var anchorBlockOffset = anchorLeaf ? anchorLeafStart + anchorOffset : null;\n  var focusBlockOffset = focusLeaf ? focusLeafStart + focusOffset : null;\n\n  var areEqual = selection.getAnchorKey() === anchorBlockKey && selection.getAnchorOffset() === anchorBlockOffset && selection.getFocusKey() === focusBlockKey && selection.getFocusOffset() === focusBlockOffset;\n\n  if (areEqual) {\n    return selection;\n  }\n\n  var isBackward = false;\n  if (anchorBlockKey === focusBlockKey) {\n    var anchorLeafEnd = anchorLeaf.get('end');\n    var focusLeafEnd = focusLeaf.get('end');\n    if (focusLeafStart === anchorLeafStart && focusLeafEnd === anchorLeafEnd) {\n      isBackward = focusOffset < anchorOffset;\n    } else {\n      isBackward = focusLeafStart < anchorLeafStart;\n    }\n  } else {\n    var startKey = editorState.getCurrentContent().getBlockMap().keySeq().skipUntil(function (v) {\n      return v === anchorBlockKey || v === focusBlockKey;\n    }).first();\n    isBackward = startKey === focusBlockKey;\n  }\n\n  return selection.merge({\n    anchorKey: anchorBlockKey,\n    anchorOffset: anchorBlockOffset,\n    focusKey: focusBlockKey,\n    focusOffset: focusBlockOffset,\n    isBackward: isBackward\n  });\n}\n\nmodule.exports = getUpdatedSelectionState;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule RichTextEditorUtil\n * @format\n * \n */\n\n'use strict';\n\nvar DraftModifier = require('./DraftModifier');\nvar EditorState = require('./EditorState');\nvar SelectionState = require('./SelectionState');\n\nvar adjustBlockDepthForContentState = require('./adjustBlockDepthForContentState');\nvar nullthrows = require('fbjs/lib/nullthrows');\n\nvar RichTextEditorUtil = {\n  currentBlockContainsLink: function currentBlockContainsLink(editorState) {\n    var selection = editorState.getSelection();\n    var contentState = editorState.getCurrentContent();\n    var entityMap = contentState.getEntityMap();\n    return contentState.getBlockForKey(selection.getAnchorKey()).getCharacterList().slice(selection.getStartOffset(), selection.getEndOffset()).some(function (v) {\n      var entity = v.getEntity();\n      return !!entity && entityMap.__get(entity).getType() === 'LINK';\n    });\n  },\n\n  getCurrentBlockType: function getCurrentBlockType(editorState) {\n    var selection = editorState.getSelection();\n    return editorState.getCurrentContent().getBlockForKey(selection.getStartKey()).getType();\n  },\n\n  getDataObjectForLinkURL: function getDataObjectForLinkURL(uri) {\n    return { url: uri.toString() };\n  },\n\n  handleKeyCommand: function handleKeyCommand(editorState, command) {\n    switch (command) {\n      case 'bold':\n        return RichTextEditorUtil.toggleInlineStyle(editorState, 'BOLD');\n      case 'italic':\n        return RichTextEditorUtil.toggleInlineStyle(editorState, 'ITALIC');\n      case 'underline':\n        return RichTextEditorUtil.toggleInlineStyle(editorState, 'UNDERLINE');\n      case 'code':\n        return RichTextEditorUtil.toggleCode(editorState);\n      case 'backspace':\n      case 'backspace-word':\n      case 'backspace-to-start-of-line':\n        return RichTextEditorUtil.onBackspace(editorState);\n      case 'delete':\n      case 'delete-word':\n      case 'delete-to-end-of-block':\n        return RichTextEditorUtil.onDelete(editorState);\n      default:\n        // they may have custom editor commands; ignore those\n        return null;\n    }\n  },\n\n  insertSoftNewline: function insertSoftNewline(editorState) {\n    var contentState = DraftModifier.insertText(editorState.getCurrentContent(), editorState.getSelection(), '\\n', editorState.getCurrentInlineStyle(), null);\n\n    var newEditorState = EditorState.push(editorState, contentState, 'insert-characters');\n\n    return EditorState.forceSelection(newEditorState, contentState.getSelectionAfter());\n  },\n\n  /**\n   * For collapsed selections at the start of styled blocks, backspace should\n   * just remove the existing style.\n   */\n  onBackspace: function onBackspace(editorState) {\n    var selection = editorState.getSelection();\n    if (!selection.isCollapsed() || selection.getAnchorOffset() || selection.getFocusOffset()) {\n      return null;\n    }\n\n    // First, try to remove a preceding atomic block.\n    var content = editorState.getCurrentContent();\n    var startKey = selection.getStartKey();\n    var blockBefore = content.getBlockBefore(startKey);\n\n    if (blockBefore && blockBefore.getType() === 'atomic') {\n      var blockMap = content.getBlockMap()['delete'](blockBefore.getKey());\n      var withoutAtomicBlock = content.merge({\n        blockMap: blockMap,\n        selectionAfter: selection\n      });\n      if (withoutAtomicBlock !== content) {\n        return EditorState.push(editorState, withoutAtomicBlock, 'remove-range');\n      }\n    }\n\n    // If that doesn't succeed, try to remove the current block style.\n    var withoutBlockStyle = RichTextEditorUtil.tryToRemoveBlockStyle(editorState);\n\n    if (withoutBlockStyle) {\n      return EditorState.push(editorState, withoutBlockStyle, 'change-block-type');\n    }\n\n    return null;\n  },\n\n  onDelete: function onDelete(editorState) {\n    var selection = editorState.getSelection();\n    if (!selection.isCollapsed()) {\n      return null;\n    }\n\n    var content = editorState.getCurrentContent();\n    var startKey = selection.getStartKey();\n    var block = content.getBlockForKey(startKey);\n    var length = block.getLength();\n\n    // The cursor is somewhere within the text. Behave normally.\n    if (selection.getStartOffset() < length) {\n      return null;\n    }\n\n    var blockAfter = content.getBlockAfter(startKey);\n\n    if (!blockAfter || blockAfter.getType() !== 'atomic') {\n      return null;\n    }\n\n    var atomicBlockTarget = selection.merge({\n      focusKey: blockAfter.getKey(),\n      focusOffset: blockAfter.getLength()\n    });\n\n    var withoutAtomicBlock = DraftModifier.removeRange(content, atomicBlockTarget, 'forward');\n\n    if (withoutAtomicBlock !== content) {\n      return EditorState.push(editorState, withoutAtomicBlock, 'remove-range');\n    }\n\n    return null;\n  },\n\n  onTab: function onTab(event, editorState, maxDepth) {\n    var selection = editorState.getSelection();\n    var key = selection.getAnchorKey();\n    if (key !== selection.getFocusKey()) {\n      return editorState;\n    }\n\n    var content = editorState.getCurrentContent();\n    var block = content.getBlockForKey(key);\n    var type = block.getType();\n    if (type !== 'unordered-list-item' && type !== 'ordered-list-item') {\n      return editorState;\n    }\n\n    event.preventDefault();\n\n    // Only allow indenting one level beyond the block above, and only if\n    // the block above is a list item as well.\n    var blockAbove = content.getBlockBefore(key);\n    if (!blockAbove) {\n      return editorState;\n    }\n\n    var typeAbove = blockAbove.getType();\n    if (typeAbove !== 'unordered-list-item' && typeAbove !== 'ordered-list-item') {\n      return editorState;\n    }\n\n    var depth = block.getDepth();\n    if (!event.shiftKey && depth === maxDepth) {\n      return editorState;\n    }\n\n    maxDepth = Math.min(blockAbove.getDepth() + 1, maxDepth);\n\n    var withAdjustment = adjustBlockDepthForContentState(content, selection, event.shiftKey ? -1 : 1, maxDepth);\n\n    return EditorState.push(editorState, withAdjustment, 'adjust-depth');\n  },\n\n  toggleBlockType: function toggleBlockType(editorState, blockType) {\n    var selection = editorState.getSelection();\n    var startKey = selection.getStartKey();\n    var endKey = selection.getEndKey();\n    var content = editorState.getCurrentContent();\n    var target = selection;\n\n    // Triple-click can lead to a selection that includes offset 0 of the\n    // following block. The `SelectionState` for this case is accurate, but\n    // we should avoid toggling block type for the trailing block because it\n    // is a confusing interaction.\n    if (startKey !== endKey && selection.getEndOffset() === 0) {\n      var blockBefore = nullthrows(content.getBlockBefore(endKey));\n      endKey = blockBefore.getKey();\n      target = target.merge({\n        anchorKey: startKey,\n        anchorOffset: selection.getStartOffset(),\n        focusKey: endKey,\n        focusOffset: blockBefore.getLength(),\n        isBackward: false\n      });\n    }\n\n    var hasAtomicBlock = content.getBlockMap().skipWhile(function (_, k) {\n      return k !== startKey;\n    }).reverse().skipWhile(function (_, k) {\n      return k !== endKey;\n    }).some(function (v) {\n      return v.getType() === 'atomic';\n    });\n\n    if (hasAtomicBlock) {\n      return editorState;\n    }\n\n    var typeToSet = content.getBlockForKey(startKey).getType() === blockType ? 'unstyled' : blockType;\n\n    return EditorState.push(editorState, DraftModifier.setBlockType(content, target, typeToSet), 'change-block-type');\n  },\n\n  toggleCode: function toggleCode(editorState) {\n    var selection = editorState.getSelection();\n    var anchorKey = selection.getAnchorKey();\n    var focusKey = selection.getFocusKey();\n\n    if (selection.isCollapsed() || anchorKey !== focusKey) {\n      return RichTextEditorUtil.toggleBlockType(editorState, 'code-block');\n    }\n\n    return RichTextEditorUtil.toggleInlineStyle(editorState, 'CODE');\n  },\n\n  /**\n   * Toggle the specified inline style for the selection. If the\n   * user's selection is collapsed, apply or remove the style for the\n   * internal state. If it is not collapsed, apply the change directly\n   * to the document state.\n   */\n  toggleInlineStyle: function toggleInlineStyle(editorState, inlineStyle) {\n    var selection = editorState.getSelection();\n    var currentStyle = editorState.getCurrentInlineStyle();\n\n    // If the selection is collapsed, toggle the specified style on or off and\n    // set the result as the new inline style override. This will then be\n    // used as the inline style for the next character to be inserted.\n    if (selection.isCollapsed()) {\n      return EditorState.setInlineStyleOverride(editorState, currentStyle.has(inlineStyle) ? currentStyle.remove(inlineStyle) : currentStyle.add(inlineStyle));\n    }\n\n    // If characters are selected, immediately apply or remove the\n    // inline style on the document state itself.\n    var content = editorState.getCurrentContent();\n    var newContent;\n\n    // If the style is already present for the selection range, remove it.\n    // Otherwise, apply it.\n    if (currentStyle.has(inlineStyle)) {\n      newContent = DraftModifier.removeInlineStyle(content, selection, inlineStyle);\n    } else {\n      newContent = DraftModifier.applyInlineStyle(content, selection, inlineStyle);\n    }\n\n    return EditorState.push(editorState, newContent, 'change-inline-style');\n  },\n\n  toggleLink: function toggleLink(editorState, targetSelection, entityKey) {\n    var withoutLink = DraftModifier.applyEntity(editorState.getCurrentContent(), targetSelection, entityKey);\n\n    return EditorState.push(editorState, withoutLink, 'apply-entity');\n  },\n\n  /**\n   * When a collapsed cursor is at the start of the first styled block, or\n   * an empty styled block, changes block to 'unstyled'. Returns null if\n   * block or selection does not meet that criteria.\n   */\n  tryToRemoveBlockStyle: function tryToRemoveBlockStyle(editorState) {\n    var selection = editorState.getSelection();\n    var offset = selection.getAnchorOffset();\n    if (selection.isCollapsed() && offset === 0) {\n      var key = selection.getAnchorKey();\n      var content = editorState.getCurrentContent();\n      var block = content.getBlockForKey(key);\n\n      var firstBlock = content.getFirstBlock();\n      if (block.getLength() > 0 && block !== firstBlock) {\n        return null;\n      }\n\n      var type = block.getType();\n      var blockBefore = content.getBlockBefore(key);\n      if (type === 'code-block' && blockBefore && blockBefore.getType() === 'code-block' && blockBefore.getLength() !== 0) {\n        return null;\n      }\n\n      if (type !== 'unstyled') {\n        return DraftModifier.setBlockType(content, selection, 'unstyled');\n      }\n    }\n    return null;\n  }\n};\n\nmodule.exports = RichTextEditorUtil;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getSelectionOffsetKeyForNode\n * @format\n * \n */\n\n'use strict';\n\n/**\n * Get offset key from a node or it's child nodes. Return the first offset key\n * found on the DOM tree of given node.\n */\n\nfunction getSelectionOffsetKeyForNode(node) {\n  if (node instanceof Element) {\n    var offsetKey = node.getAttribute('data-offset-key');\n    if (offsetKey) {\n      return offsetKey;\n    }\n    for (var ii = 0; ii < node.childNodes.length; ii++) {\n      var childOffsetKey = getSelectionOffsetKeyForNode(node.childNodes[ii]);\n      if (childOffsetKey) {\n        return childOffsetKey;\n      }\n    }\n  }\n  return null;\n}\n\nmodule.exports = getSelectionOffsetKeyForNode;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule SecondaryClipboard\n * @format\n * \n */\n\n'use strict';\n\nvar DraftModifier = require('./DraftModifier');\nvar EditorState = require('./EditorState');\n\nvar getContentStateFragment = require('./getContentStateFragment');\nvar nullthrows = require('fbjs/lib/nullthrows');\n\nvar clipboard = null;\n\n/**\n * Some systems offer a \"secondary\" clipboard to allow quick internal cut\n * and paste behavior. For instance, Ctrl+K (cut) and Ctrl+Y (paste).\n */\nvar SecondaryClipboard = {\n  cut: function cut(editorState) {\n    var content = editorState.getCurrentContent();\n    var selection = editorState.getSelection();\n    var targetRange = null;\n\n    if (selection.isCollapsed()) {\n      var anchorKey = selection.getAnchorKey();\n      var blockEnd = content.getBlockForKey(anchorKey).getLength();\n\n      if (blockEnd === selection.getAnchorOffset()) {\n        return editorState;\n      }\n\n      targetRange = selection.set('focusOffset', blockEnd);\n    } else {\n      targetRange = selection;\n    }\n\n    targetRange = nullthrows(targetRange);\n    clipboard = getContentStateFragment(content, targetRange);\n\n    var afterRemoval = DraftModifier.removeRange(content, targetRange, 'forward');\n\n    if (afterRemoval === content) {\n      return editorState;\n    }\n\n    return EditorState.push(editorState, afterRemoval, 'remove-range');\n  },\n\n  paste: function paste(editorState) {\n    if (!clipboard) {\n      return editorState;\n    }\n\n    var newContent = DraftModifier.replaceWithFragment(editorState.getCurrentContent(), editorState.getSelection(), clipboard);\n\n    return EditorState.push(editorState, newContent, 'insert-fragment');\n  }\n};\n\nmodule.exports = SecondaryClipboard;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule keyCommandInsertNewline\n * @format\n * \n */\n\n'use strict';\n\nvar DraftModifier = require('./DraftModifier');\nvar EditorState = require('./EditorState');\n\nfunction keyCommandInsertNewline(editorState) {\n  var contentState = DraftModifier.splitBlock(editorState.getCurrentContent(), editorState.getSelection());\n  return EditorState.push(editorState, contentState, 'split-block');\n}\n\nmodule.exports = keyCommandInsertNewline;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule editOnCut\n * @format\n * \n */\n\n'use strict';\n\nvar DraftModifier = require('./DraftModifier');\nvar EditorState = require('./EditorState');\nvar Style = require('fbjs/lib/Style');\n\nvar getFragmentFromSelection = require('./getFragmentFromSelection');\nvar getScrollPosition = require('fbjs/lib/getScrollPosition');\n\n/**\n * On `cut` events, native behavior is allowed to occur so that the system\n * clipboard is set properly. This means that we need to take steps to recover\n * the editor DOM state after the `cut` has occurred in order to maintain\n * control of the component.\n *\n * In addition, we can keep a copy of the removed fragment, including all\n * styles and entities, for use as an internal paste.\n */\nfunction editOnCut(editor, e) {\n  var editorState = editor._latestEditorState;\n  var selection = editorState.getSelection();\n  var element = e.target;\n  var scrollPosition = void 0;\n\n  // No selection, so there's nothing to cut.\n  if (selection.isCollapsed()) {\n    e.preventDefault();\n    return;\n  }\n\n  // Track the current scroll position so that it can be forced back in place\n  // after the editor regains control of the DOM.\n  if (element instanceof Node) {\n    scrollPosition = getScrollPosition(Style.getScrollParent(element));\n  }\n\n  var fragment = getFragmentFromSelection(editorState);\n  editor.setClipboard(fragment);\n\n  // Set `cut` mode to disable all event handling temporarily.\n  editor.setMode('cut');\n\n  // Let native `cut` behavior occur, then recover control.\n  setTimeout(function () {\n    editor.restoreEditorDOM(scrollPosition);\n    editor.exitCurrentMode();\n    editor.update(removeFragment(editorState));\n  }, 0);\n}\n\nfunction removeFragment(editorState) {\n  var newContent = DraftModifier.removeRange(editorState.getCurrentContent(), editorState.getSelection(), 'forward');\n  return EditorState.push(editorState, newContent, 'remove-range');\n}\n\nmodule.exports = editOnCut;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DraftOffsetKey\n * @format\n * \n */\n\n'use strict';\n\nvar KEY_DELIMITER = '-';\n\nvar DraftOffsetKey = {\n  encode: function encode(blockKey, decoratorKey, leafKey) {\n    return blockKey + KEY_DELIMITER + decoratorKey + KEY_DELIMITER + leafKey;\n  },\n\n  decode: function decode(offsetKey) {\n    var _offsetKey$split = offsetKey.split(KEY_DELIMITER),\n        blockKey = _offsetKey$split[0],\n        decoratorKey = _offsetKey$split[1],\n        leafKey = _offsetKey$split[2];\n\n    return {\n      blockKey: blockKey,\n      decoratorKey: parseInt(decoratorKey, 10),\n      leafKey: parseInt(leafKey, 10)\n    };\n  }\n};\n\nmodule.exports = DraftOffsetKey;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule editOnBlur\n * @format\n * \n */\n\n'use strict';\n\nvar EditorState = require('./EditorState');\n\nvar containsNode = require('fbjs/lib/containsNode');\nvar getActiveElement = require('fbjs/lib/getActiveElement');\n\nfunction editOnBlur(editor, e) {\n  // In a contentEditable element, when you select a range and then click\n  // another active element, this does trigger a `blur` event but will not\n  // remove the DOM selection from the contenteditable.\n  // This is consistent across all browsers, but we prefer that the editor\n  // behave like a textarea, where a `blur` event clears the DOM selection.\n  // We therefore force the issue to be certain, checking whether the active\n  // element is `body` to force it when blurring occurs within the window (as\n  // opposed to clicking to another tab or window).\n  if (getActiveElement() === document.body) {\n    var _selection = global.getSelection();\n    var editorNode = editor.editor;\n    if (_selection.rangeCount === 1 && containsNode(editorNode, _selection.anchorNode) && containsNode(editorNode, _selection.focusNode)) {\n      _selection.removeAllRanges();\n    }\n  }\n\n  var editorState = editor._latestEditorState;\n  var currentSelection = editorState.getSelection();\n  if (!currentSelection.getHasFocus()) {\n    return;\n  }\n\n  var selection = currentSelection.set('hasFocus', false);\n  editor.props.onBlur && editor.props.onBlur(e);\n  editor.update(EditorState.acceptSelection(editorState, selection));\n}\n\nmodule.exports = editOnBlur;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getEntityKeyForSelection\n * @format\n * \n */\n\n'use strict';\n\n/**\n * Return the entity key that should be used when inserting text for the\n * specified target selection, only if the entity is `MUTABLE`. `IMMUTABLE`\n * and `SEGMENTED` entities should not be used for insertion behavior.\n */\nfunction getEntityKeyForSelection(contentState, targetSelection) {\n  var entityKey;\n\n  if (targetSelection.isCollapsed()) {\n    var key = targetSelection.getAnchorKey();\n    var offset = targetSelection.getAnchorOffset();\n    if (offset > 0) {\n      entityKey = contentState.getBlockForKey(key).getEntityAt(offset - 1);\n      if (entityKey !== contentState.getBlockForKey(key).getEntityAt(offset)) {\n        return null;\n      }\n      return filterKey(contentState.getEntityMap(), entityKey);\n    }\n    return null;\n  }\n\n  var startKey = targetSelection.getStartKey();\n  var startOffset = targetSelection.getStartOffset();\n  var startBlock = contentState.getBlockForKey(startKey);\n\n  entityKey = startOffset === startBlock.getLength() ? null : startBlock.getEntityAt(startOffset);\n\n  return filterKey(contentState.getEntityMap(), entityKey);\n}\n\n/**\n * Determine whether an entity key corresponds to a `MUTABLE` entity. If so,\n * return it. If not, return null.\n */\nfunction filterKey(entityMap, entityKey) {\n  if (entityKey) {\n    var entity = entityMap.__get(entityKey);\n    return entity.getMutability() === 'MUTABLE' ? entityKey : null;\n  }\n  return null;\n}\n\nmodule.exports = getEntityKeyForSelection;","'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getNextDelimiterBlockKey\n * @format\n * \n *\n * This is unstable and not part of the public API and should not be used by\n * production systems. This file may be update/removed without notice.\n */\n\nvar ContentBlockNode = require('./ContentBlockNode');\n\nvar getNextDelimiterBlockKey = function getNextDelimiterBlockKey(block, blockMap) {\n  var isExperimentalTreeBlock = block instanceof ContentBlockNode;\n\n  if (!isExperimentalTreeBlock) {\n    return null;\n  }\n\n  var nextSiblingKey = block.getNextSiblingKey();\n\n  if (nextSiblingKey) {\n    return nextSiblingKey;\n  }\n\n  var parent = block.getParentKey();\n\n  if (!parent) {\n    return null;\n  }\n\n  var nextNonDescendantBlock = blockMap.get(parent);\n  while (nextNonDescendantBlock && !nextNonDescendantBlock.getNextSiblingKey()) {\n    var parentKey = nextNonDescendantBlock.getParentKey();\n    nextNonDescendantBlock = parentKey ? blockMap.get(parentKey) : null;\n  }\n\n  if (!nextNonDescendantBlock) {\n    return null;\n  }\n\n  return nextNonDescendantBlock.getNextSiblingKey();\n};\n\nmodule.exports = getNextDelimiterBlockKey;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DraftEntitySegments\n * @format\n * \n */\n\n'use strict';\n\n/**\n * Identify the range to delete from a segmented entity.\n *\n * Rules:\n *\n *  Example: 'John F. Kennedy'\n *\n *   - Deletion from within any non-whitespace (i.e. ['John', 'F.', 'Kennedy'])\n *     will return the range of that text.\n *\n *       'John F. Kennedy' -> 'John F.'\n *                  ^\n *\n *   - Forward deletion of whitespace will remove the following section:\n *\n *       'John F. Kennedy' -> 'John Kennedy'\n *            ^\n *\n *   - Backward deletion of whitespace will remove the previous section:\n *\n *       'John F. Kennedy' -> 'F. Kennedy'\n *            ^\n */\nvar DraftEntitySegments = {\n  getRemovalRange: function getRemovalRange(selectionStart, selectionEnd, text, entityStart, direction) {\n    var segments = text.split(' ');\n    segments = segments.map(function ( /*string*/segment, /*number*/ii) {\n      if (direction === 'forward') {\n        if (ii > 0) {\n          return ' ' + segment;\n        }\n      } else if (ii < segments.length - 1) {\n        return segment + ' ';\n      }\n      return segment;\n    });\n\n    var segmentStart = entityStart;\n    var segmentEnd;\n    var segment;\n    var removalStart = null;\n    var removalEnd = null;\n\n    for (var jj = 0; jj < segments.length; jj++) {\n      segment = segments[jj];\n      segmentEnd = segmentStart + segment.length;\n\n      // Our selection overlaps this segment.\n      if (selectionStart < segmentEnd && segmentStart < selectionEnd) {\n        if (removalStart !== null) {\n          removalEnd = segmentEnd;\n        } else {\n          removalStart = segmentStart;\n          removalEnd = segmentEnd;\n        }\n      } else if (removalStart !== null) {\n        break;\n      }\n\n      segmentStart = segmentEnd;\n    }\n\n    var entityEnd = entityStart + text.length;\n    var atStart = removalStart === entityStart;\n    var atEnd = removalEnd === entityEnd;\n\n    if (!atStart && atEnd || atStart && !atEnd) {\n      if (direction === 'forward') {\n        if (removalEnd !== entityEnd) {\n          removalEnd++;\n        }\n      } else if (removalStart !== entityStart) {\n        removalStart--;\n      }\n    }\n\n    return {\n      start: removalStart,\n      end: removalEnd\n    };\n  }\n};\n\nmodule.exports = DraftEntitySegments;","'use strict';\n\n/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule expandRangeToStartOfLine\n * @format\n * \n */\n\nvar UnicodeUtils = require('fbjs/lib/UnicodeUtils');\n\nvar getRangeClientRects = require('./getRangeClientRects');\nvar invariant = require('fbjs/lib/invariant');\n\n/**\n * Return the computed line height, in pixels, for the provided element.\n */\nfunction getLineHeightPx(element) {\n  var computed = getComputedStyle(element);\n  var div = document.createElement('div');\n  div.style.fontFamily = computed.fontFamily;\n  div.style.fontSize = computed.fontSize;\n  div.style.fontStyle = computed.fontStyle;\n  div.style.fontWeight = computed.fontWeight;\n  div.style.lineHeight = computed.lineHeight;\n  div.style.position = 'absolute';\n  div.textContent = 'M';\n\n  var documentBody = document.body;\n  !documentBody ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Missing document.body') : invariant(false) : void 0;\n\n  // forced layout here\n  documentBody.appendChild(div);\n  var rect = div.getBoundingClientRect();\n  documentBody.removeChild(div);\n\n  return rect.height;\n}\n\n/**\n * Return whether every ClientRect in the provided list lies on the same line.\n *\n * We assume that the rects on the same line all contain the baseline, so the\n * lowest top line needs to be above the highest bottom line (i.e., if you were\n * to project the rects onto the y-axis, their intersection would be nonempty).\n *\n * In addition, we require that no two boxes are lineHeight (or more) apart at\n * either top or bottom, which helps protect against false positives for fonts\n * with extremely large glyph heights (e.g., with a font size of 17px, Zapfino\n * produces rects of height 58px!).\n */\nfunction areRectsOnOneLine(rects, lineHeight) {\n  var minTop = Infinity;\n  var minBottom = Infinity;\n  var maxTop = -Infinity;\n  var maxBottom = -Infinity;\n\n  for (var ii = 0; ii < rects.length; ii++) {\n    var rect = rects[ii];\n    if (rect.width === 0 || rect.width === 1) {\n      // When a range starts or ends a soft wrap, many browsers (Chrome, IE,\n      // Safari) include an empty rect on the previous or next line. When the\n      // text lies in a container whose position is not integral (e.g., from\n      // margin: auto), Safari makes these empty rects have width 1 (instead of\n      // 0). Having one-pixel-wide characters seems unlikely (and most browsers\n      // report widths in subpixel precision anyway) so it's relatively safe to\n      // skip over them.\n      continue;\n    }\n    minTop = Math.min(minTop, rect.top);\n    minBottom = Math.min(minBottom, rect.bottom);\n    maxTop = Math.max(maxTop, rect.top);\n    maxBottom = Math.max(maxBottom, rect.bottom);\n  }\n\n  return maxTop <= minBottom && maxTop - minTop < lineHeight && maxBottom - minBottom < lineHeight;\n}\n\n/**\n * Return the length of a node, as used by Range offsets.\n */\nfunction getNodeLength(node) {\n  // http://www.w3.org/TR/dom/#concept-node-length\n  switch (node.nodeType) {\n    case Node.DOCUMENT_TYPE_NODE:\n      return 0;\n    case Node.TEXT_NODE:\n    case Node.PROCESSING_INSTRUCTION_NODE:\n    case Node.COMMENT_NODE:\n      return node.length;\n    default:\n      return node.childNodes.length;\n  }\n}\n\n/**\n * Given a collapsed range, move the start position backwards as far as\n * possible while the range still spans only a single line.\n */\nfunction expandRangeToStartOfLine(range) {\n  !range.collapsed ? process.env.NODE_ENV !== 'production' ? invariant(false, 'expandRangeToStartOfLine: Provided range is not collapsed.') : invariant(false) : void 0;\n  range = range.cloneRange();\n\n  var containingElement = range.startContainer;\n  if (containingElement.nodeType !== 1) {\n    containingElement = containingElement.parentNode;\n  }\n  var lineHeight = getLineHeightPx(containingElement);\n\n  // Imagine our text looks like:\n  //   <div><span>once upon a time, there was a <em>boy\n  //   who lived</em> </span><q><strong>under^ the\n  //   stairs</strong> in a small closet.</q></div>\n  // where the caret represents the cursor. First, we crawl up the tree until\n  // the range spans multiple lines (setting the start point to before\n  // \"<strong>\", then before \"<div>\"), then at each level we do a search to\n  // find the latest point which is still on a previous line. We'll find that\n  // the break point is inside the span, then inside the <em>, then in its text\n  // node child, the actual break point before \"who\".\n\n  var bestContainer = range.endContainer;\n  var bestOffset = range.endOffset;\n  range.setStart(range.startContainer, 0);\n\n  while (areRectsOnOneLine(getRangeClientRects(range), lineHeight)) {\n    bestContainer = range.startContainer;\n    bestOffset = range.startOffset;\n    !bestContainer.parentNode ? process.env.NODE_ENV !== 'production' ? invariant(false, 'Found unexpected detached subtree when traversing.') : invariant(false) : void 0;\n    range.setStartBefore(bestContainer);\n    if (bestContainer.nodeType === 1 && getComputedStyle(bestContainer).display !== 'inline') {\n      // The start of the line is never in a different block-level container.\n      break;\n    }\n  }\n\n  // In the above example, range now spans from \"<div>\" to \"under\",\n  // bestContainer is <div>, and bestOffset is 1 (index of <q> inside <div>)].\n  // Picking out which child to recurse into here is a special case since we\n  // don't want to check past <q> -- once we find that the final range starts\n  // in <span>, we can look at all of its children (and all of their children)\n  // to find the break point.\n\n  // At all times, (bestContainer, bestOffset) is the latest single-line start\n  // point that we know of.\n  var currentContainer = bestContainer;\n  var maxIndexToConsider = bestOffset - 1;\n\n  do {\n    var nodeValue = currentContainer.nodeValue;\n\n    for (var ii = maxIndexToConsider; ii >= 0; ii--) {\n      if (nodeValue != null && ii > 0 && UnicodeUtils.isSurrogatePair(nodeValue, ii - 1)) {\n        // We're in the middle of a surrogate pair -- skip over so we never\n        // return a range with an endpoint in the middle of a code point.\n        continue;\n      }\n\n      range.setStart(currentContainer, ii);\n      if (areRectsOnOneLine(getRangeClientRects(range), lineHeight)) {\n        bestContainer = currentContainer;\n        bestOffset = ii;\n      } else {\n        break;\n      }\n    }\n\n    if (ii === -1 || currentContainer.childNodes.length === 0) {\n      // If ii === -1, then (bestContainer, bestOffset), which is equal to\n      // (currentContainer, 0), was a single-line start point but a start\n      // point before currentContainer wasn't, so the line break seems to\n      // have occurred immediately after currentContainer's start tag\n      //\n      // If currentContainer.childNodes.length === 0, we're already at a\n      // terminal node (e.g., text node) and should return our current best.\n      break;\n    }\n\n    currentContainer = currentContainer.childNodes[ii];\n    maxIndexToConsider = getNodeLength(currentContainer);\n  } while (true);\n\n  range.setStart(bestContainer, bestOffset);\n  return range;\n}\n\nmodule.exports = expandRangeToStartOfLine;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getDraftEditorSelection\n * @format\n * \n */\n\n'use strict';\n\nvar getDraftEditorSelectionWithNodes = require('./getDraftEditorSelectionWithNodes');\n\n/**\n * Convert the current selection range to an anchor/focus pair of offset keys\n * and values that can be interpreted by components.\n */\nfunction getDraftEditorSelection(editorState, root) {\n  var selection = global.getSelection();\n\n  // No active selection.\n  if (selection.rangeCount === 0) {\n    return {\n      selectionState: editorState.getSelection().set('hasFocus', false),\n      needsRecovery: false\n    };\n  }\n\n  return getDraftEditorSelectionWithNodes(editorState, root, selection.anchorNode, selection.anchorOffset, selection.focusNode, selection.focusOffset);\n}\n\nmodule.exports = getDraftEditorSelection;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule encodeEntityRanges\n * @format\n * \n */\n\n'use strict';\n\nvar DraftStringKey = require('./DraftStringKey');\nvar UnicodeUtils = require('fbjs/lib/UnicodeUtils');\n\nvar strlen = UnicodeUtils.strlen;\n\n/**\n * Convert to UTF-8 character counts for storage.\n */\n\nfunction encodeEntityRanges(block, storageMap) {\n  var encoded = [];\n  block.findEntityRanges(function (character) {\n    return !!character.getEntity();\n  }, function ( /*number*/start, /*number*/end) {\n    var text = block.getText();\n    var key = block.getEntityAt(start);\n    encoded.push({\n      offset: strlen(text.slice(0, start)),\n      length: strlen(text.slice(start, end)),\n      // Encode the key as a number for range storage.\n      key: Number(storageMap[DraftStringKey.stringify(key)])\n    });\n  });\n  return encoded;\n}\n\nmodule.exports = encodeEntityRanges;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule editOnDragStart\n * @format\n * \n */\n\n'use strict';\n\n/**\n * A `dragstart` event has begun within the text editor component.\n */\nfunction editOnDragStart(editor) {\n  editor._internalDrag = true;\n  editor.setMode('drag');\n}\n\nmodule.exports = editOnDragStart;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DraftEditorCompositionHandler\n * @format\n * \n */\n\n'use strict';\n\nvar DraftFeatureFlags = require('./DraftFeatureFlags');\nvar DraftModifier = require('./DraftModifier');\nvar EditorState = require('./EditorState');\nvar Keys = require('fbjs/lib/Keys');\n\nvar getEntityKeyForSelection = require('./getEntityKeyForSelection');\nvar isEventHandled = require('./isEventHandled');\nvar isSelectionAtLeafStart = require('./isSelectionAtLeafStart');\n\n/**\n * Millisecond delay to allow `compositionstart` to fire again upon\n * `compositionend`.\n *\n * This is used for Korean input to ensure that typing can continue without\n * the editor trying to render too quickly. More specifically, Safari 7.1+\n * triggers `compositionstart` a little slower than Chrome/FF, which\n * leads to composed characters being resolved and re-render occurring\n * sooner than we want.\n */\nvar RESOLVE_DELAY = 20;\n\n/**\n * A handful of variables used to track the current composition and its\n * resolution status. These exist at the module level because it is not\n * possible to have compositions occurring in multiple editors simultaneously,\n * and it simplifies state management with respect to the DraftEditor component.\n */\nvar resolved = false;\nvar stillComposing = false;\nvar textInputData = '';\n\nvar DraftEditorCompositionHandler = {\n  onBeforeInput: function onBeforeInput(editor, e) {\n    textInputData = (textInputData || '') + e.data;\n  },\n\n  /**\n   * A `compositionstart` event has fired while we're still in composition\n   * mode. Continue the current composition session to prevent a re-render.\n   */\n  onCompositionStart: function onCompositionStart(editor) {\n    stillComposing = true;\n  },\n\n  /**\n   * Attempt to end the current composition session.\n   *\n   * Defer handling because browser will still insert the chars into active\n   * element after `compositionend`. If a `compositionstart` event fires\n   * before `resolveComposition` executes, our composition session will\n   * continue.\n   *\n   * The `resolved` flag is useful because certain IME interfaces fire the\n   * `compositionend` event multiple times, thus queueing up multiple attempts\n   * at handling the composition. Since handling the same composition event\n   * twice could break the DOM, we only use the first event. Example: Arabic\n   * Google Input Tools on Windows 8.1 fires `compositionend` three times.\n   */\n  onCompositionEnd: function onCompositionEnd(editor) {\n    resolved = false;\n    stillComposing = false;\n    setTimeout(function () {\n      if (!resolved) {\n        DraftEditorCompositionHandler.resolveComposition(editor);\n      }\n    }, RESOLVE_DELAY);\n  },\n\n  /**\n   * In Safari, keydown events may fire when committing compositions. If\n   * the arrow keys are used to commit, prevent default so that the cursor\n   * doesn't move, otherwise it will jump back noticeably on re-render.\n   */\n  onKeyDown: function onKeyDown(editor, e) {\n    if (!stillComposing) {\n      // If a keydown event is received after compositionend but before the\n      // 20ms timer expires (ex: type option-E then backspace, or type A then\n      // backspace in 2-Set Korean), we should immediately resolve the\n      // composition and reinterpret the key press in edit mode.\n      DraftEditorCompositionHandler.resolveComposition(editor);\n      editor._onKeyDown(e);\n      return;\n    }\n    if (e.which === Keys.RIGHT || e.which === Keys.LEFT) {\n      e.preventDefault();\n    }\n  },\n\n  /**\n   * Keypress events may fire when committing compositions. In Firefox,\n   * pressing RETURN commits the composition and inserts extra newline\n   * characters that we do not want. `preventDefault` allows the composition\n   * to be committed while preventing the extra characters.\n   */\n  onKeyPress: function onKeyPress(editor, e) {\n    if (e.which === Keys.RETURN) {\n      e.preventDefault();\n    }\n  },\n\n  /**\n   * Attempt to insert composed characters into the document.\n   *\n   * If we are still in a composition session, do nothing. Otherwise, insert\n   * the characters into the document and terminate the composition session.\n   *\n   * If no characters were composed -- for instance, the user\n   * deleted all composed characters and committed nothing new --\n   * force a re-render. We also re-render when the composition occurs\n   * at the beginning of a leaf, to ensure that if the browser has\n   * created a new text node for the composition, we will discard it.\n   *\n   * Resetting innerHTML will move focus to the beginning of the editor,\n   * so we update to force it back to the correct place.\n   */\n  resolveComposition: function resolveComposition(editor) {\n    if (stillComposing) {\n      return;\n    }\n\n    resolved = true;\n    var composedChars = textInputData;\n    textInputData = '';\n\n    var editorState = EditorState.set(editor._latestEditorState, {\n      inCompositionMode: false\n    });\n\n    var currentStyle = editorState.getCurrentInlineStyle();\n    var entityKey = getEntityKeyForSelection(editorState.getCurrentContent(), editorState.getSelection());\n\n    var mustReset = !composedChars || isSelectionAtLeafStart(editorState) || currentStyle.size > 0 || entityKey !== null;\n\n    if (mustReset) {\n      editor.restoreEditorDOM();\n    }\n\n    editor.exitCurrentMode();\n\n    if (composedChars) {\n      if (DraftFeatureFlags.draft_handlebeforeinput_composed_text && editor.props.handleBeforeInput && isEventHandled(editor.props.handleBeforeInput(composedChars, editorState))) {\n        return;\n      }\n      // If characters have been composed, re-rendering with the update\n      // is sufficient to reset the editor.\n      var contentState = DraftModifier.replaceText(editorState.getCurrentContent(), editorState.getSelection(), composedChars, currentStyle, entityKey);\n      editor.update(EditorState.push(editorState, contentState, 'insert-characters'));\n      return;\n    }\n\n    if (mustReset) {\n      editor.update(EditorState.set(editorState, {\n        nativelyRenderedContent: null,\n        forceSelection: true\n      }));\n    }\n  }\n};\n\nmodule.exports = DraftEditorCompositionHandler;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule getContentStateFragment\n * @format\n * \n */\n\n'use strict';\n\nvar randomizeBlockMapKeys = require('./randomizeBlockMapKeys');\nvar removeEntitiesAtEdges = require('./removeEntitiesAtEdges');\n\nvar getContentStateFragment = function getContentStateFragment(contentState, selectionState) {\n  var startKey = selectionState.getStartKey();\n  var startOffset = selectionState.getStartOffset();\n  var endKey = selectionState.getEndKey();\n  var endOffset = selectionState.getEndOffset();\n\n  // Edge entities should be stripped to ensure that we don't preserve\n  // invalid partial entities when the fragment is reused. We do, however,\n  // preserve entities that are entirely within the selection range.\n  var contentWithoutEdgeEntities = removeEntitiesAtEdges(contentState, selectionState);\n\n  var blockMap = contentWithoutEdgeEntities.getBlockMap();\n  var blockKeys = blockMap.keySeq();\n  var startIndex = blockKeys.indexOf(startKey);\n  var endIndex = blockKeys.indexOf(endKey) + 1;\n\n  return randomizeBlockMapKeys(blockMap.slice(startIndex, endIndex).map(function (block, blockKey) {\n    var text = block.getText();\n    var chars = block.getCharacterList();\n\n    if (startKey === endKey) {\n      return block.merge({\n        text: text.slice(startOffset, endOffset),\n        characterList: chars.slice(startOffset, endOffset)\n      });\n    }\n\n    if (blockKey === startKey) {\n      return block.merge({\n        text: text.slice(startOffset),\n        characterList: chars.slice(startOffset)\n      });\n    }\n\n    if (blockKey === endKey) {\n      return block.merge({\n        text: text.slice(0, endOffset),\n        characterList: chars.slice(0, endOffset)\n      });\n    }\n\n    return block;\n  }));\n};\n\nmodule.exports = getContentStateFragment;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule DefaultDraftBlockRenderMap\n * @format\n * \n */\n\n'use strict';\n\nvar _require = require('immutable'),\n    Map = _require.Map;\n\nvar React = require('react');\n\nvar cx = require('fbjs/lib/cx');\n\nvar UL_WRAP = React.createElement('ul', { className: cx('public/DraftStyleDefault/ul') });\nvar OL_WRAP = React.createElement('ol', { className: cx('public/DraftStyleDefault/ol') });\nvar PRE_WRAP = React.createElement('pre', { className: cx('public/DraftStyleDefault/pre') });\n\nvar DefaultDraftBlockRenderMap = Map({\n  'header-one': {\n    element: 'h1'\n  },\n  'header-two': {\n    element: 'h2'\n  },\n  'header-three': {\n    element: 'h3'\n  },\n  'header-four': {\n    element: 'h4'\n  },\n  'header-five': {\n    element: 'h5'\n  },\n  'header-six': {\n    element: 'h6'\n  },\n  'unordered-list-item': {\n    element: 'li',\n    wrapper: UL_WRAP\n  },\n  'ordered-list-item': {\n    element: 'li',\n    wrapper: OL_WRAP\n  },\n  blockquote: {\n    element: 'blockquote'\n  },\n  atomic: {\n    element: 'figure'\n  },\n  'code-block': {\n    element: 'pre',\n    wrapper: PRE_WRAP\n  },\n  unstyled: {\n    element: 'div',\n    aliasedElements: ['p']\n  }\n});\n\nmodule.exports = DefaultDraftBlockRenderMap;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule ContentBlockNode\n * @format\n * \n *\n * This file is a fork of ContentBlock adding support for nesting references by\n * providing links to children, parent, prevSibling, and nextSibling.\n *\n * This is unstable and not part of the public API and should not be used by\n * production systems. This file may be update/removed without notice.\n */\n\n'use strict';\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _possibleConstructorReturn(self, call) { if (!self) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return call && (typeof call === \"object\" || typeof call === \"function\") ? call : self; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function, not \" + typeof superClass); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, enumerable: false, writable: true, configurable: true } }); if (superClass) Object.setPrototypeOf ? Object.setPrototypeOf(subClass, superClass) : subClass.__proto__ = superClass; }\n\nvar CharacterMetadata = require('./CharacterMetadata');\nvar Immutable = require('immutable');\n\nvar findRangesImmutable = require('./findRangesImmutable');\n\nvar List = Immutable.List,\n    Map = Immutable.Map,\n    OrderedSet = Immutable.OrderedSet,\n    Record = Immutable.Record,\n    Repeat = Immutable.Repeat;\n\n\nvar EMPTY_SET = OrderedSet();\n\nvar defaultRecord = {\n  parent: null,\n  characterList: List(),\n  data: Map(),\n  depth: 0,\n  key: '',\n  text: '',\n  type: 'unstyled',\n  children: List(),\n  prevSibling: null,\n  nextSibling: null\n};\n\nvar haveEqualStyle = function haveEqualStyle(charA, charB) {\n  return charA.getStyle() === charB.getStyle();\n};\n\nvar haveEqualEntity = function haveEqualEntity(charA, charB) {\n  return charA.getEntity() === charB.getEntity();\n};\n\nvar decorateCharacterList = function decorateCharacterList(config) {\n  if (!config) {\n    return config;\n  }\n\n  var characterList = config.characterList,\n      text = config.text;\n\n\n  if (text && !characterList) {\n    config.characterList = List(Repeat(CharacterMetadata.EMPTY, text.length));\n  }\n\n  return config;\n};\n\nvar ContentBlockNode = function (_Record) {\n  _inherits(ContentBlockNode, _Record);\n\n  function ContentBlockNode() {\n    var props = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : defaultRecord;\n\n    _classCallCheck(this, ContentBlockNode);\n\n    return _possibleConstructorReturn(this, _Record.call(this, decorateCharacterList(props)));\n  }\n\n  ContentBlockNode.prototype.getKey = function getKey() {\n    return this.get('key');\n  };\n\n  ContentBlockNode.prototype.getType = function getType() {\n    return this.get('type');\n  };\n\n  ContentBlockNode.prototype.getText = function getText() {\n    return this.get('text');\n  };\n\n  ContentBlockNode.prototype.getCharacterList = function getCharacterList() {\n    return this.get('characterList');\n  };\n\n  ContentBlockNode.prototype.getLength = function getLength() {\n    return this.getText().length;\n  };\n\n  ContentBlockNode.prototype.getDepth = function getDepth() {\n    return this.get('depth');\n  };\n\n  ContentBlockNode.prototype.getData = function getData() {\n    return this.get('data');\n  };\n\n  ContentBlockNode.prototype.getInlineStyleAt = function getInlineStyleAt(offset) {\n    var character = this.getCharacterList().get(offset);\n    return character ? character.getStyle() : EMPTY_SET;\n  };\n\n  ContentBlockNode.prototype.getEntityAt = function getEntityAt(offset) {\n    var character = this.getCharacterList().get(offset);\n    return character ? character.getEntity() : null;\n  };\n\n  ContentBlockNode.prototype.getChildKeys = function getChildKeys() {\n    return this.get('children');\n  };\n\n  ContentBlockNode.prototype.getParentKey = function getParentKey() {\n    return this.get('parent');\n  };\n\n  ContentBlockNode.prototype.getPrevSiblingKey = function getPrevSiblingKey() {\n    return this.get('prevSibling');\n  };\n\n  ContentBlockNode.prototype.getNextSiblingKey = function getNextSiblingKey() {\n    return this.get('nextSibling');\n  };\n\n  ContentBlockNode.prototype.findStyleRanges = function findStyleRanges(filterFn, callback) {\n    findRangesImmutable(this.getCharacterList(), haveEqualStyle, filterFn, callback);\n  };\n\n  ContentBlockNode.prototype.findEntityRanges = function findEntityRanges(filterFn, callback) {\n    findRangesImmutable(this.getCharacterList(), haveEqualEntity, filterFn, callback);\n  };\n\n  return ContentBlockNode;\n}(Record(defaultRecord));\n\nmodule.exports = ContentBlockNode;","/**\n * Copyright (c) 2013-present, Facebook, Inc.\n * All rights reserved.\n *\n * This source code is licensed under the BSD-style license found in the\n * LICENSE file in the root directory of this source tree. An additional grant\n * of patent rights can be found in the PATENTS file in the same directory.\n *\n * @providesModule insertFragmentIntoContentState\n * @format\n * \n */\n\n'use strict';\n\nvar BlockMapBuilder = require('./BlockMapBuilder');\nvar ContentBlockNode = require('./ContentBlockNode');\nvar Immutable = require('immutable');\n\nvar insertIntoList = require('./insertIntoList');\nvar invariant = require('fbjs/lib/invariant');\nvar randomizeBlockMapKeys = require('./randomizeBlockMapKeys');\n\nvar List = Immutable.List;\n\n\nvar updateExistingBlock = function updateExistingBlock(contentState, selectionState, blockMap, fragmentBlock, targetKey, targetOffset) {\n  var targetBlock = blockMap.get(targetKey);\n  var text = targetBlock.getText();\n  var chars = targetBlock.getCharacterList();\n  var finalKey = targetKey;\n  var finalOffset = targetOffset + fragmentBlock.getText().length;\n\n  var newBlock = targetBlock.merge({\n    text: text.slice(0, targetOffset) + fragmentBlock.getText() + text.slice(targetOffset),\n    characterList: insertIntoList(chars, fragmentBlock.getCharacterList(), targetOffset),\n    data: fragmentBlock.getData()\n  });\n\n  return contentState.merge({\n    blockMap: blockMap.set(targetKey, newBlock),\n    selectionBefore: selectionState,\n    selectionAfter: selectionState.merge({\n      anchorKey: finalKey,\n      anchorOffset: finalOffset,\n      focusKey: finalKey,\n      focusOffset: finalOffset,\n      isBackward: false\n    })\n  });\n};\n\n/**\n * Appends text/characterList from the fragment first block to\n * target block.\n */\nvar updateHead = function updateHead(block, targetOffset, fragment) {\n  var text = block.getText();\n  var chars = block.getCharacterList();\n\n  // Modify head portion of block.\n  var headText = text.slice(0, targetOffset);\n  var headCharacters = chars.slice(0, targetOffset);\n  var appendToHead = fragment.first();\n\n  return block.merge({\n    text: headText + appendToHead.getText(),\n    characterList: headCharacters.concat(appendToHead.getCharacterList()),\n    type: headText ? block.getType() : appendToHead.getType(),\n    data: appendToHead.getData()\n  });\n};\n\n/**\n * Appends offset text/characterList from the target block to the last\n * fragment block.\n */\nvar updateTail = function updateTail(block, targetOffset, fragment) {\n  // Modify tail portion of block.\n  var text = block.getText();\n  var chars = block.getCharacterList();\n\n  // Modify head portion of block.\n  var blockSize = text.length;\n  var tailText = text.slice(targetOffset, blockSize);\n  var tailCharacters = chars.slice(targetOffset, blockSize);\n  var prependToTail = fragment.last();\n\n  return prependToTail.merge({\n    text: prependToTail.getText() + tailText,\n    characterList: prependToTail.getCharacterList().concat(tailCharacters),\n    data: prependToTail.getData()\n  });\n};\n\nvar getRootBlocks = function getRootBlocks(block, blockMap) {\n  var headKey = block.getKey();\n  var rootBlock = block;\n  var rootBlocks = [];\n\n  // sometimes the fragment head block will not be part of the blockMap itself this can happen when\n  // the fragment head is used to update the target block, however when this does not happen we need\n  // to make sure that we include it on the rootBlocks since the first block of a fragment is always a\n  // fragment root block\n  if (blockMap.get(headKey)) {\n    rootBlocks.push(headKey);\n  }\n\n  while (rootBlock && rootBlock.getNextSiblingKey()) {\n    var lastSiblingKey = rootBlock.getNextSiblingKey();\n\n    if (!lastSiblingKey) {\n      break;\n    }\n\n    rootBlocks.push(lastSiblingKey);\n    rootBlock = blockMap.get(lastSiblingKey);\n  }\n\n  return rootBlocks;\n};\n\nvar updateBlockMapLinks = function updateBlockMapLinks(blockMap, originalBlockMap, targetBlock, fragmentHeadBlock) {\n  return blockMap.withMutations(function (blockMapState) {\n    var targetKey = targetBlock.getKey();\n    var headKey = fragmentHeadBlock.getKey();\n    var targetNextKey = targetBlock.getNextSiblingKey();\n    var targetParentKey = targetBlock.getParentKey();\n    var fragmentRootBlocks = getRootBlocks(fragmentHeadBlock, blockMap);\n    var lastRootFragmentBlockKey = fragmentRootBlocks[fragmentRootBlocks.length - 1];\n\n    if (blockMapState.get(headKey)) {\n      // update the fragment head when it is part of the blockMap otherwise\n      blockMapState.setIn([targetKey, 'nextSibling'], headKey);\n      blockMapState.setIn([headKey, 'prevSibling'], targetKey);\n    } else {\n      // update the target block that had the fragment head contents merged into it\n      blockMapState.setIn([targetKey, 'nextSibling'], fragmentHeadBlock.getNextSiblingKey());\n      blockMapState.setIn([fragmentHeadBlock.getNextSiblingKey(), 'prevSibling'], targetKey);\n    }\n\n    // update the last root block fragment\n    blockMapState.setIn([lastRootFragmentBlockKey, 'nextSibling'], targetNextKey);\n\n    // update the original target next block\n    if (targetNextKey) {\n      blockMapState.setIn([targetNextKey, 'prevSibling'], lastRootFragmentBlockKey);\n    }\n\n    // update fragment parent links\n    fragmentRootBlocks.forEach(function (blockKey) {\n      return blockMapState.setIn([blockKey, 'parent'], targetParentKey);\n    });\n\n    // update targetBlock parent child links\n    if (targetParentKey) {\n      var targetParent = blockMap.get(targetParentKey);\n      var originalTargetParentChildKeys = targetParent.getChildKeys();\n\n      var targetBlockIndex = originalTargetParentChildKeys.indexOf(targetKey);\n      var insertionIndex = targetBlockIndex + 1;\n\n      var newChildrenKeysArray = originalTargetParentChildKeys.toArray();\n\n      // insert fragment children\n      newChildrenKeysArray.splice.apply(newChildrenKeysArray, [insertionIndex, 0].concat(fragmentRootBlocks));\n\n      blockMapState.setIn([targetParentKey, 'children'], List(newChildrenKeysArray));\n    }\n  });\n};\n\nvar insertFragment = function insertFragment(contentState, selectionState, blockMap, fragment, targetKey, targetOffset) {\n  var isTreeBasedBlockMap = blockMap.first() instanceof ContentBlockNode;\n  var newBlockArr = [];\n  var fragmentSize = fragment.size;\n  var target = blockMap.get(targetKey);\n  var head = fragment.first();\n  var tail = fragment.last();\n  var finalOffset = tail.getLength();\n  var finalKey = tail.getKey();\n  var shouldNotUpdateFromFragmentBlock = isTreeBasedBlockMap && (!target.getChildKeys().isEmpty() || !head.getChildKeys().isEmpty());\n\n  blockMap.forEach(function (block, blockKey) {\n    if (blockKey !== targetKey) {\n      newBlockArr.push(block);\n      return;\n    }\n\n    if (shouldNotUpdateFromFragmentBlock) {\n      newBlockArr.push(block);\n    } else {\n      newBlockArr.push(updateHead(block, targetOffset, fragment));\n    }\n\n    // Insert fragment blocks after the head and before the tail.\n    fragment\n    // when we are updating the target block with the head fragment block we skip the first fragment\n    // head since its contents have already been merged with the target block otherwise we include\n    // the whole fragment\n    .slice(shouldNotUpdateFromFragmentBlock ? 0 : 1, fragmentSize - 1).forEach(function (fragmentBlock) {\n      return newBlockArr.push(fragmentBlock);\n    });\n\n    // update tail\n    newBlockArr.push(updateTail(block, targetOffset, fragment));\n  });\n\n  var updatedBlockMap = BlockMapBuilder.createFromArray(newBlockArr);\n\n  if (isTreeBasedBlockMap) {\n    updatedBlockMap = updateBlockMapLinks(updatedBlockMap, blockMap, target, head);\n  }\n\n  return contentState.merge({\n    blockMap: updatedBlockMap,\n    selectionBefore: selectionState,\n    selectionAfter: selectionState.merge({\n      anchorKey: finalKey,\n      anchorOffset: finalOffset,\n      focusKey: finalKey,\n      focusOffset: finalOffset,\n      isBackward: false\n    })\n  });\n};\n\nvar insertFragmentIntoContentState = function insertFragmentIntoContentState(contentState, selectionState, fragmentBlockMap) {\n  !selectionState.isCollapsed() ? process.env.NODE_ENV !== 'production' ? invariant(false, '`insertFragment` should only be called with a collapsed selection state.') : invariant(false) : void 0;\n\n  var blockMap = contentState.getBlockMap();\n  var fragment = randomizeBlockMapKeys(fragmentBlockMap);\n  var targetKey = selectionState.getStartKey();\n  var targetOffset = selectionState.getStartOffset();\n\n  var targetBlock = blockMap.get(targetKey);\n\n  if (targetBlock instanceof ContentBlockNode) {\n    !targetBlock.getChildKeys().isEmpty() ? process.env.NODE_ENV !== 'production' ? invariant(false, '`insertFragment` should not be called when a container node is selected.') : invariant(false) : void 0;\n  }\n\n  // When we insert a fragment with a single block we simply update the target block\n  // with the contents of the inserted fragment block\n  if (fragment.size === 1) {\n    return updateExistingBlock(contentState, selectionState, blockMap, fragment.first(), targetKey, targetOffset);\n  }\n\n  return insertFragment(contentState, selectionState, blockMap, fragment, targetKey, targetOffset);\n};\n\nmodule.exports = insertFragmentIntoContentState;"],"names":["EditorState","module","exports","e","editorState","updateFn","undoneState","undo","getLastChangeType","preventDefault","getNativelyRenderedContent","set","nativelyRenderedContent","setTimeout","getCurrentContent","DraftModifier","KeyBindingUtil","Keys","SecondaryClipboard","UserAgent","isEventHandled","keyCommandBackspaceToStartOfLine","keyCommandBackspaceWord","keyCommandDeleteWord","keyCommandInsertNewline","keyCommandMoveSelectionToEndOfBlock","keyCommandMoveSelectionToStartOfBlock","keyCommandPlainBackspace","keyCommandPlainDelete","keyCommandTransposeCharacters","keyCommandUndo","isOptionKeyCommand","isChrome","isBrowser","editor","keyCode","which","_latestEditorState","RETURN","props","handleReturn","ESC","onEscape","TAB","onTab","UP","onUpArrow","RIGHT","onRightArrow","DOWN","onDownArrow","LEFT","onLeftArrow","SPACE","contentState","replaceText","getSelection","update","push","command","keyBindingFn","handleKeyCommand","newState","redo","cut","paste","onKeyCommand","DraftEntityInstance","_DraftEntityInstanceR","instance","Constructor","TypeError","_classCallCheck","this","self","call","ReferenceError","_possibleConstructorReturn","apply","arguments","subClass","superClass","prototype","Object","create","constructor","value","enumerable","writable","configurable","setPrototypeOf","__proto__","_inherits","getType","get","getMutability","getData","Record","type","mutability","data","DraftEditorContents","ContentBlockNode","Immutable","generateRandomKey","invariant","List","Map","transformBlock","key","blockMap","func","block","selectionState","isCollapsed","getAnchorKey","offset","getAnchorOffset","getBlockMap","blockToSplit","text","getText","chars","getCharacterList","keyBelow","isExperimentalTreeBlock","blockAbove","merge","slice","characterList","blockBelow","blocksBefore","toSeq","takeUntil","v","blocksAfter","skipUntil","rest","newBlocks","concat","toOrderedMap","getChildKeys","isEmpty","originalBlock","belowBlock","withMutations","blocks","originalBlockKey","getKey","belowBlockKey","getParentKey","parentChildrenList","insertionIndex","indexOf","newChildrenArray","toArray","splice","children","getNextSiblingKey","prevSibling","nextSibling","updateBlockMapLinks","selectionBefore","selectionAfter","anchorKey","anchorOffset","focusKey","focusOffset","isBackward","_assign","DraftEditorTextNode","React","ReactDOM","setDraftEditorSelection","DraftEditorLeaf","_React$Component","_setSelection","selection","getHasFocus","_props","start","blockKey","end","length","hasEdgeWithin","node","findDOMNode","child","firstChild","targetNode","nodeType","Node","TEXT_NODE","tagName","shouldComponentUpdate","nextProps","leafNode","leaf","textContent","styleSet","forceSelection","componentDidUpdate","componentDidMount","render","_this2","endsWith","isLast","_props2","customStyleMap","customStyleFn","offsetKey","styleObj","reduce","map","styleName","mergedStyles","style","undefined","textDecoration","join","trim","newStyles","createElement","ref","_ref","Component","isOldIE","html","doc","root","document","implementation","createHTMLDocument","documentElement","innerHTML","getElementsByTagName","getContentStateFragment","removalRange","finalSelection","content","getBlockForKey","getLength","movedFragment","afterRemoval","removeRange","getSelectionAfter","targetOffset","targetRange","afterInsert","replaceWithFragment","newEditorState","acceptSelection","_extends","target","i","source","hasOwnProperty","DraftOffsetKey","Scroll","Style","UnicodeBidi","UnicodeBidiDirection","cx","getElementPosition","getScrollPosition","getViewportDimensions","nullthrows","isBlockOnSelectionEdge","getFocusKey","DraftEditorBlock","tree","direction","endKey","getEndKey","blockNode","scrollParent","getScrollParent","scrollPosition","scrollDelta","window","nodePosition","y","height","scrollTo","x","HTMLElement","offsetHeight","offsetTop","setTop","getTop","_renderChildren","lastLeafSet","size","hasSelection","leafSet","ii","leavesForLeafSet","lastLeaf","leaves","jj","encode","getInlineStyleAt","decoratorKey","decorator","DecoratorComponent","getComponentForKey","decoratorProps","getPropsForKey","decoratorOffsetKey","decoratedText","first","last","dir","getHTMLDirIfDifferent","getDirection","entityKey","getEntityAt","className","useNewlineChar","NEWLINE_A","NEWLINE_B","_this","_forceFlag","shouldBeNewline","Element","isNewline","getNextDelimiterBlockKey","OrderedMap","originalBlockToBeMoved","originalTargetBlock","insertionMode","isInsertedAfterTarget","originalTargetKey","originalParentKey","originalNextSiblingKey","originalPrevSiblingKey","getPrevSiblingKey","newParentKey","newNextSiblingKey","newPrevSiblingKey","newParentChildrenList","targetBlockIndex","parent","blockToBeMoved","targetBlock","targetKey","blocksToBeMoved","blockMapWithoutBlocksToBeMoved","nextSiblingKey","nextDelimiterBlockKey","takeWhile","isBlockToBeMoved","hasNextSiblingAndIsNotNextSibling","doesNotHaveNextSiblingAndIsNotDelimiter","forEach","skip","slicedBlocks","blockBefore","getBlockBefore","blockAfter","getBlockAfter","ContentBlock","DraftStringKey","encodeEntityRanges","encodeInlineStyleRanges","createRawBlock","entityStorageMap","depth","getDepth","inlineStyleRanges","entityRanges","toObject","encodeRawBlocks","rawState","entityMap","rawBlocks","blockCacheRef","entityCacheRef","entityStorageKey","findEntityRanges","character","getEntity","stringifiedEntityKey","stringify","parentKey","rawBlock","insertRawBlock","rawDraftContentState","rawEntityMap","keys","index","entity","unstringify","encodeRawEntityMap","CharacterMetadata","ContentStateInlineStyle","DraftFeatureFlags","applyEntityToContentState","getCharacterRemovalRange","insertFragmentIntoContentState","insertTextIntoContentState","modifyBlockForContentState","removeEntitiesAtEdges","removeRangeFromContentState","splitBlockInContentState","OrderedSet","rangeToReplace","inlineStyle","withoutEntities","withoutText","insertText","moveText","fragment","rangeToRemove","removalDirection","startKey","startBlock","endBlock","getIsBackward","getFocusOffset","startOffset","getStartOffset","endOffset","getEndOffset","startEntityKey","endEntityKey","_adjustedRemovalRange","getEntityMap","adjustedRemovalRange","draft_segmented_entities_behavior","splitBlock","applyInlineStyle","add","removeInlineStyle","remove","setBlockType","blockType","setBlockData","blockData","mergeBlockData","applyEntity","blockTree","getBlockTree","isAtStart","some","leafStart","targetList","toInsert","count","c","reverse","unshift","head","tail","toList","NEWLINE_REGEX","split","DraftJsDebugLogging","containsNode","getActiveElement","getAnonymizedDOM","getNodeLabels","anonymized","anonymizeTextWithin","outerHTML","labels","createTextNode","clone","cloneNode","setAttribute","childNodes","appendChild","getAnonymizedEditorDOM","currentNode","hasAttribute","parentNode","getNodeLength","nodeValue","addFocusToSelection","activeElement","extend","logSelectionStateFailure","anonymizedDom","extraParams","JSON","toJS","nodeWasFocus","focusNode","n","anchorNode","activeElementName","nodeName","nodeIsFocus","selectionRangeCount","rangeCount","selectionAnchorNodeName","selectionAnchorOffset","selectionFocusNodeName","selectionFocusOffset","message","range","getRangeAt","setEnd","addRange","cloneRange","addPointToSelection","createRange","setStart","nodeStart","nodeEnd","g","tempKey","tempOffset","hasAnchor","hasFocus","removeAllRanges","storedFocusNode","storedFocusOffset","maxDistance","getStartKey","getKeyAfter","getRangeClientRects","tempRange","clientRects","ancestor","endContainer","atCommonAncestor","commonAncestorContainer","startContainer","rects","Array","from","getClientRects","setEndBefore","BlockMapBuilder","DraftEntity","SelectionState","sanitizeDraftText","Repeat","ContentBlockNodeRecord","draft_tree_data_support","ContentState","_ContentStateRecord","getSelectionBefore","getKeyBefore","keySeq","_","k","getBlocksAsArray","getFirstBlock","getLastBlock","getPlainText","delimiter","getLastCreatedEntityKey","__getLastCreatedEntityKey","hasText","createEntity","__create","mergeEntityData","toMerge","__mergeData","replaceEntityData","newData","__replaceData","addEntity","__add","__get","createFromBlockArray","theBlocks","isArray","contentBlocks","createFromArray","createEmpty","createFromText","EMPTY","_SelectionStateRecord","serialize","String","selectionStart","offsetToCheck","setMode","inCompositionMode","_onCompositionStart","substr","EMPTY_SET","ranges","styles","fill","cursor","getSelectionOffsetKeyForNode","searchNode","convertFromHTMLtoContentBlocks","getSafeBodyFromHTML","experimentalTreeDataSupport","ContentBlockRecord","DraftPasteProcessor","processHTML","blockRenderMap","processText","textBlocks","acc","textLine","blockNodeConfig","prevSiblingIndex","previousBlock","_require","defaultRecord","_CharacterMetadataRec","getStyle","hasStyle","includes","applyStyle","record","withStyle","removeStyle","withoutStyle","withEntity","config","configMap","existing","pool","newCharacter","applyEntityToContentBlock","sliceStart","sliceEnd","getDraftEditorSelection","_blockSelectEvents","editorNode","editorContainer","documentSelection","updatedSelectionState","needsRecovery","DefaultDraftBlockRenderMap","DefaultDraftInlineStyle","DraftEditorCompositionHandler","DraftEditorDragHandler","DraftEditorEditHandler","DraftEditorPlaceholder","emptyFunction","getDefaultKeyBinding","isIE","allowSpellCheck","handlerMap","edit","composite","drag","DraftEditor","focus","alreadyHasFocus","blur","mode","_handler","exitCurrentMode","restoreEditorDOM","setState","contentsKey","state","setClipboard","clipboard","_clipboard","getClipboard","onChange","onDragEnter","_dragCount","onDragLeave","_editorKey","editorKey","_placeholderAccessibilityID","_latestCommittedEditorState","_onBeforeInput","_buildHandler","_onBlur","_onCharacterData","_onCompositionEnd","_onCopy","_onCut","_onDragEnd","_onDragOver","_onDragStart","_onDrop","_onInput","_onFocus","_onKeyDown","_onKeyPress","_onKeyUp","_onMouseDown","_onMouseUp","_onPaste","_onSelect","getEditorKey","eventName","readOnly","method","_showPlaceholder","placeholder","isInCompositionMode","_renderPlaceholder","placeHolderProps","textAlignment","accessibilityID","_this3","blockRendererFn","blockStyleFn","textDirectionality","rootClass","ariaRole","role","ariaExpanded","editorContentsProps","_ref3","ariaActiveDescendantID","ariaAutoComplete","ariaControls","ariaDescribedBy","ariaLabel","ariaLabelledBy","ariaMultiline","autoCapitalize","autoComplete","autoCorrect","notranslate","contentEditable","webDriverTestID","onBeforeInput","onBlur","onCompositionEnd","onCompositionStart","onCopy","onCut","onDragEnd","onDragOver","onDragStart","onDrop","onFocus","onInput","onKeyDown","onKeyPress","onKeyUp","onMouseUp","onPaste","onSelect","_ref2","spellCheck","outline","userSelect","WebkitUserSelect","whiteSpace","wordWrap","suppressContentEditableWarning","tabIndex","execCommand","componentWillUpdate","defaultProps","thatReturnsNull","thatReturns","stripPastedStyles","isOSX","isPlatform","isCtrlKeyCommand","ctrlKey","altKey","hasCommandModifier","metaKey","AtomicBlockUtils","CompositeDraftDecorator","RichTextEditorUtil","convertFromDraftStateToRaw","DraftPublic","Editor","EditorBlock","CompositeDecorator","Entity","EntityInstance","Modifier","RichUtils","convertFromHTML","convertFromRaw","convertToRaw","genKey","getVisibleSelectionRect","currentSelection","TEXT_CLIPPING_REGEX","TEXT_TYPES","files","callback","readCount","results","file","FileReader","contents","test","name","replace","reader","onload","result","onerror","readAsText","readFile","getAncestorsKeys","parents","getNextValidSibling","originalBlockMap","nextValidSiblingKey","getPrevValidSibling","prevValidSiblingKey","filter","nextDelimiters","nextDelimiter","_block","getNextDelimitersBlockKeys","delimiterKey","removeFromList","shift","pop","parentAncestors","endBlockchildrenKeys","endBlockAncestors","modifiedStart","updatedBlockMap","findRangesImmutable","_ContentBlockRecord","decorateCharacterList","findStyleRanges","filterFn","haveEqualStyle","haveEqualEntity","charA","charB","getFragmentFromSelection","instances","instanceKey","logWarning","oldMethodCall","newMethodCall","console","warn","mergeData","replaceData","newInstance","textLength","findAncestorOffsetKey","getUpdatedSelectionState","getPointForNonTextNode","editorRoot","startNode","childOffset","getAttribute","firstLeaf","getFirstLeaf","nodeBeforeCursor","leafKey","lastChild","getLastLeaf","getTextContentLength","anchorIsTextNode","focusIsTextNode","anchorPoint","focusPoint","expandRangeToStartOfLine","getDraftEditorSelectionWithNodes","moveSelectionBackward","removeTextWithStrategy","strategyState","DraftEntitySegments","getRangesForDraftEntity","getEntityRemovalRange","isEntireSelectionWithinEntity","isEntityAtStart","sideToConsider","entityRange","getRemovalRange","newSelectionState","startSelectionState","endSelectionState","_startSelectionState","_endSelectionState","DraftTreeAdapter","createCharacterList","decodeEntityRanges","decodeInlineStyleRanges","decodeBlockNodeConfig","decodeCharacterList","rawEntityRanges","rawInlineStyleRanges","addKeyIfMissing","updateNodeStack","stack","nodes","parentRef","nodesWithParentRef","decodeRawBlocks","isTreeRawBlock","fromRawStateToRawTreeState","contentBlockNode","siblings","_index","isValidBlock","_children","_contentBlockNode","decodeContentBlockNodes","contentBlock","decodeContentBlocks","fromRawTreeStateToRawState","rawEntityKey","_rawEntityMap$rawEnti","decodeRawEntityMap","keyBefore","UnicodeUtils","moveSelectionForward","charAhead","getUTF16Length","SLICE$0","createClass","ctor","Iterable","isIterable","Seq","KeyedIterable","isKeyed","KeyedSeq","IndexedIterable","isIndexed","IndexedSeq","SetIterable","isAssociative","SetSeq","maybeIterable","IS_ITERABLE_SENTINEL","maybeKeyed","IS_KEYED_SENTINEL","maybeIndexed","IS_INDEXED_SENTINEL","maybeAssociative","isOrdered","maybeOrdered","IS_ORDERED_SENTINEL","Keyed","Indexed","Set","DELETE","SHIFT","SIZE","MASK","NOT_SET","CHANGE_LENGTH","DID_ALTER","MakeRef","SetRef","OwnerID","arrCopy","arr","len","Math","max","newArr","ensureSize","iter","__iterate","returnTrue","wrapIndex","uint32Index","NaN","wholeSlice","begin","resolveBegin","resolveIndex","resolveEnd","defaultIndex","min","ITERATE_KEYS","ITERATE_VALUES","ITERATE_ENTRIES","REAL_ITERATOR_SYMBOL","Symbol","iterator","FAUX_ITERATOR_SYMBOL","ITERATOR_SYMBOL","Iterator","next","iteratorValue","iteratorResult","done","iteratorDone","hasIterator","getIteratorFn","isIterator","maybeIterator","getIterator","iterable","iteratorFn","isArrayLike","emptySequence","seqFromValue","toKeyedSeq","fromEntrySeq","keyedSeqFromValue","entrySeq","toIndexedSeq","indexedSeqFromValue","toSetSeq","toString","KEYS","VALUES","ENTRIES","inspect","toSource","of","__toString","cacheResult","_cache","__iterateUncached","fn","seqIterate","__iterator","seqIterator","isSeq","EMPTY_SEQ","EMPTY_REPEAT","EMPTY_RANGE","IS_SEQ_SENTINEL","ArraySeq","array","_array","ObjectSeq","object","_object","_keys","IterableSeq","_iterable","IteratorSeq","_iterator","_iteratorCache","maybeSeq","seq","maybeIndexedSeqFromValue","useKeys","cache","maxIndex","entry","__iteratorUncached","fromJS","json","converter","fromJSWith","fromJSDefault","parentJSON","isPlainObj","toMap","is","valueA","valueB","valueOf","equals","deepEqual","a","b","__hash","notAssociative","entries","every","flipped","allEqual","bSize","has","times","_value","Infinity","condition","error","Error","Range","step","abs","_start","_end","_step","ceil","Collection","KeyedCollection","IndexedCollection","SetCollection","notSetValue","iterations","val","searchValue","lastIndexOf","this$0","other","possibleIndex","floor","offsetValue","imul","d","smi","i32","hash","o","h","STRING_HASH_CACHE_MIN_STRLEN","cachedHashString","hashString","hashCode","hashJSObj","string","stringHashCache","STRING_HASH_CACHE_SIZE","STRING_HASH_CACHE_MAX_SIZE","charCodeAt","obj","usingWeakMap","weakMap","UID_HASH_KEY","canDefineProperty","propertyIsEnumerable","getIENodeHash","objHashUID","isExtensible","defineProperty","uniqueID","WeakMap","assertNotInfinite","emptyMap","isMap","maybeMap","IS_MAP_SENTINEL","_root","updateMap","setIn","keyPath","updateIn","deleteIn","updater","updatedValue","updateInDeepMap","forceIterator","clear","__ownerID","__altered","mergeIntoMapWith","mergeWith","merger","mergeIn","iters","m","mergeDeep","deepMerger","mergeDeepWith","deepMergerWith","mergeDeepIn","sort","comparator","sortFactory","sortBy","mapper","mutable","asMutable","wasAltered","__ensureOwner","asImmutable","MapIterator","iterate","ownerID","makeMap","EMPTY_MAP","MapPrototype","ArrayMapNode","BitmapIndexedNode","bitmap","HashArrayMapNode","HashCollisionNode","keyHash","ValueNode","_type","_reverse","_stack","mapIteratorFrame","mapIteratorValue","prev","__prev","newRoot","newSize","didChangeSize","didAlter","updateNode","isLeafNode","mergeIntoNode","newNode","idx1","idx2","createNodes","packNodes","excluding","packedII","packedNodes","bit","expandNodes","including","expandedNodes","iterables","mergeIntoCollectionWith","nextValue","collection","mergeIntoMap","keyPathIter","isNotSet","existingValue","newValue","nextExisting","nextUpdated","popCount","idx","canEdit","newArray","spliceIn","newLen","after","spliceOut","removeIn","removed","exists","MAX_ARRAY_MAP_SIZE","isEditable","newEntries","keyHashFrag","MAX_BITMAP_INDEXED_SIZE","newBitmap","newNodes","newCount","MIN_HASH_ARRAY_MAP_SIZE","keyMatch","subNode","empty","emptyList","isList","makeList","VNode","list","setSize","maybeList","IS_LIST_SENTINEL","listNodeFor","_origin","updateList","insert","_capacity","_level","_tail","values","oldSize","setListBounds","mergeIntoListWith","iterateList","DONE","ListPrototype","removeBefore","level","originIndex","newChild","removingFirst","oldChild","editable","editableVNode","removeAfter","sizeIndex","EMPTY_LIST","EMPTY_ORDERED_MAP","left","right","tailPos","getTailOffset","iterateNodeOrLeaf","iterateLeaf","iterateNode","to","origin","capacity","newTail","updateVNode","nodeHas","lowerNode","newLowerNode","rawIndex","owner","oldOrigin","oldCapacity","newOrigin","newCapacity","newLevel","offsetShift","oldTailOffset","newTailOffset","oldTail","beginIndex","maxSize","emptyOrderedMap","isOrderedMap","maybeOrderedMap","makeOrderedMap","omap","_map","_list","updateOrderedMap","newMap","newList","flip","ToKeyedSequence","indexed","_iter","_useKeys","ToIndexedSequence","ToSetSequence","FromEntriesSequence","flipFactory","flipSequence","makeSequence","reversedSequence","cacheResultThrough","mapFactory","context","mappedSequence","reverseFactory","filterFactory","predicate","filterSequence","countByFactory","grouper","groups","groupByFactory","isKeyedIter","coerce","iterableClass","reify","sliceFactory","originalSize","resolvedBegin","resolvedEnd","sliceSize","resolvedSize","sliceSeq","skipped","isSkipping","takeWhileFactory","takeSequence","iterating","skipWhileFactory","skipSequence","skipping","concatFactory","isKeyedIterable","singleton","concatSeq","flatten","sum","flattenFactory","flatSequence","stopped","flatDeep","currentDepth","flatMapFactory","interposeFactory","separator","interposedSequence","defaultComparator","maxFactory","maxCompare","comp","zipWithFactory","keyIter","zipper","zipSequence","iterators","isDone","steps","s","validateEntry","resolveSize","defaultValues","hasInitialized","RecordType","setProps","RecordTypePrototype","_name","_defaultValues","RecordPrototype","valueSeq","indexedIterable","recordName","defaultVal","_empty","makeRecord","likeRecord","getPrototypeOf","names","setProp","bind","emptySet","isSet","maybeSet","IS_SET_SENTINEL","fromKeys","updateSet","union","intersect","originalSet","subtract","__make","SetPrototype","__empty","makeSet","emptyOrderedSet","isOrderedSet","maybeOrderedSet","EMPTY_ORDERED_SET","OrderedSetPrototype","makeOrderedSet","Stack","emptyStack","isStack","unshiftAll","maybeStack","IS_STACK_SENTINEL","_head","peek","makeStack","pushAll","EMPTY_STACK","StackPrototype","mixin","methods","keyCopier","getOwnPropertySymbols","__toJS","toJSON","toOrderedSet","toSet","toStack","__toStringMapper","returnValue","find","findEntry","found","findLastEntry","sideEffect","joined","isFirst","reducer","initialReduction","reduction","useFirst","reduceRight","reversed","not","butLast","countBy","entriesSequence","entryMapper","filterNot","findLast","flatMap","searchKey","getIn","searchKeyPath","nested","groupBy","hasIn","isSubset","isSuperset","keyMapper","maxBy","neg","defaultNegComparator","minBy","amount","skipLast","skipWhile","take","takeLast","hashIterable","IterablePrototype","quoteString","chain","contains","noLengthWarning","findKey","findLastKey","keyOf","lastKeyOf","mapEntries","mapKeys","KeyedIterablePrototype","defaultZipper","ordered","keyed","murmurHashOfSize","hashMerge","findIndex","removeNum","numArgs","spliced","findLastIndex","interpose","interleave","zipped","interleaved","zip","zipWith","factory","bidiService","UnicodeBidiService","EditorBidiService","getDirectionMap","prevBidiMap","reset","nextBidi","bidiMap","insertIntoList","characterMetadata","blockText","newBlock","newOffset","seenKeys","MULTIPLIER","pow","isNaN","random","getRangeBoundingClientRect","global","boundingRect","top","bottom","BlockTree","EditorStateRecord","allowUndo","currentContent","directionMap","inlineStyleOverride","lastChangeType","redoStack","treeMap","undoStack","immutable","_immutable","createWithContent","firstKey","recordConfig","generateNewTreeMap","put","getImmutable","existingDecorator","newContent","newTreeMap","previousTreeMap","getDecorations","generate","regenerateTreeForNewDecorator","newBlockMap","newEntityMap","prevBlockMap","prevTreeMap","regenerateTreeForNewBlocks","getAllowUndo","getUndoStack","getRedoStack","getDecorator","mustForceSelection","getInlineStyleOverride","setInlineStyleOverride","getCurrentInlineStyle","override","lookUpwardForInlineStyle","getInlineStyleForCollapsedSelection","getInlineStyleForNonCollapsedSelection","isSelectionAtStartOfContent","isSelectionAtEndOfContent","updateSelection","moveSelectionToEnd","lastBlock","lastKey","moveFocusToEnd","afterSelectionMove","changeType","mustBecomeBoundary","editorStateChanges","newCurrentContent","fromKey","lastNonEmpty","REGEX_BLOCK_DELIMITER","RegExp","input","areEqual","isTruthy","EMPTY_ARRAY","styleList","styleToEncode","filteredInlines","strlen","getEncodedInlinesForType","newKeysRef","lastRootBlock","blockMapState","oldKey","nextKey","prevKey","childrenKeys","childKey","randomizeContentBlockNodeKeys","randomizeContentBlockKeys","decorators","_decorators","decorations","counter","strategy","canOccupySlice","targetArr","componentKey","occupySlice","parseInt","component","CHAMELEON_CHARS","WHITESPACE_AND_PUNCTUATION","getPunctuation","DELETE_REGEX","BACKSPACE_REGEX","getRemovableWord","matches","exec","DraftRemovableWord","getBackward","getForward","isWindows","shouldFixFirefoxMovement","shouldRemoveWord","shiftKey","getZCommand","getDeleteCommand","BACKSPACE","getBackspaceCommand","_internalDrag","moveBlockInContentState","insertAtomicBlock","targetSelection","afterSplit","insertionTarget","asAtomicBlock","charData","atomicBlockConfig","atomicDividerBlockConfig","fragmentArray","withAtomicBlock","moveAtomicBlock","atomicBlock","withMovedAtomicBlock","selectionAfterRemoval","_targetBlock","selectionAfterSplit","_targetBlock2","haystack","areEqualFn","foundFn","nextIndex","thatReturnsTrue","LeafRange","DecoratorRange","leafSets","generateLeaves","getFingerprint","characters","inlineStyles","width","_rects$","_rects$2","rect","removeForBlock","charBefore","charAfter","entityBeforeCursor","entityAfterCursor","current","_getRemovalRange","element","updatedBlocks","updatedStart","updatedEnd","DataTransfer","getTextContentFromFiles","nativeEvent","dataTransfer","dropSelection","event","caretRangeFromPoint","dropRange","rangeParent","rangeOffset","getSelectionForEvent","getFiles","handleDroppedFiles","fileText","insertTextAtSelection","dragType","handleDrop","newContentState","entities","characterArray","id","adjustment","maxDepth","getEntityKeyForSelection","splitTextIntoTextBlocks","insertFragment","clipboardData","isRichText","defaultFileText","handlePastedFiles","currentBlockType","getCurrentBlockType","withInsertedText","getHTML","handlePastedText","internalClipboard","types","areTextBlocksAndClipboardEqual","htmlFragment","htmlMap","textFragment","textMap","joinClasses","getListItemClasses","shouldResetCount","prevEditorState","nextEditorState","nextNativeContent","wasComposing","nowComposing","prevContent","nextContent","prevDecorator","nextDecorator","blocksAsArray","processedBlocks","lastWrapperTemplate","customRenderer","CustomComponent","customProps","customEditable","componentProps","blockProps","configForType","wrapperTemplate","wrapper","childProps","outputBlocks","_ii","info","wrapperElement","cloneElement","_knownListItemDepthCl","_defineProperty","URI","REGEX_CR","REGEX_LF","REGEX_NBSP","REGEX_CARRIAGE","REGEX_ZWS","boldValues","notBoldValues","inlineTags","code","del","em","strike","strong","u","knownListItemDepthClasses","anchorAttr","imgAttr","EMPTY_CHUNK","inlines","EMPTY_BLOCK","getListBlockType","tag","lastList","getBlockTypeForTag","matchedTypes","draftBlock","aliasedElements","alias","multiMatchExtractor","matchType","getMultiMatchedType","joinChunks","A","B","experimentalHasNestedBlocks","lastInA","firstInB","hasValidLinkText","link","HTMLAnchorElement","protocol","getWhitespaceChunk","inEntity","getSoftNewlineChunk","getChunkedBlock","getBlockDividerChunk","genFragment","inBlock","blockTags","lastLastBlock","toLowerCase","nextBlockType","inBlockType","chunk","_text","nodeTextContent","parentElement","parentNodeName","HTMLImageElement","attributes","getNamedItem","image","entityConfig","attr","imageAttribute","currentStyle","styleToCheck","htmlElement","fontWeight","fontStyle","processInlineTag","depthClass","classList","getListItemDepth","inListBlock","inBlockOrHasNestedBlocks","entityId","href","anchor","anchorAttribute","url","_genFragment","generatedChunk","sibling","getChunkForHTML","DOMBuilder","supportedBlockTags","unstyledElement","tags","getBlockMapSupportedTags","safeBody","workingBlocks","containsSemanticBlockMarkup","chunkData","rawInlines","rawEntities","BlockNodeRecord","textBlock","parentTextNodeKey","parentIndex","cacheRef","parentRecord","parentCharacterList","parentText","textNode","convertChunkToContentBlocks","toRemove","draft_killswitch_allow_nontextnodes","draft_handlebeforeinput_composed_text","BOLD","CODE","fontFamily","ITALIC","STRIKETHROUGH","UNDERLINE","isSelectionAtLeafStart","setImmediate","isFirefox","_pendingStateFromBeforeInput","handleBeforeInput","selectionEnd","mustPreventNative","nativeSelection","modifyInlineStyle","addOrRemove","isGecko","isEngine","domSelection","isNotTextNode","isNotTextOrElementNode","ELEMENT_NODE","previousSibling","span","removeChild","domText","_DraftOffsetKey$decod","decode","_editorState$getBlock","modelText","preserveEntity","charDelta","contentWithAdjustedDOMSelection","operation","isListBlock","draftTreeState","transformedBlocks","traverseInDepthOrder","addDepthToChildren","draftState","lastListDepthCacheRef","treeBlock","charBehind","anchorPath","anchorBlockKey","anchorLeaf","focusPath","focusBlockKey","focusLeaf","anchorLeafStart","focusLeafStart","anchorBlockOffset","focusBlockOffset","anchorLeafEnd","focusLeafEnd","adjustBlockDepthForContentState","currentBlockContainsLink","getDataObjectForLinkURL","uri","toggleInlineStyle","toggleCode","onBackspace","onDelete","insertSoftNewline","withoutAtomicBlock","withoutBlockStyle","tryToRemoveBlockStyle","atomicBlockTarget","typeAbove","withAdjustment","toggleBlockType","typeToSet","toggleLink","withoutLink","firstBlock","childOffsetKey","blockEnd","removeFragment","_offsetKey$split","body","_selection","filterKey","nextNonDescendantBlock","entityStart","segments","segment","segmentEnd","segmentStart","removalStart","removalEnd","entityEnd","atStart","atEnd","areRectsOnOneLine","lineHeight","minTop","minBottom","maxTop","maxBottom","DOCUMENT_TYPE_NODE","PROCESSING_INSTRUCTION_NODE","COMMENT_NODE","collapsed","containingElement","computed","getComputedStyle","div","fontSize","position","documentBody","getBoundingClientRect","getLineHeightPx","bestContainer","bestOffset","setStartBefore","display","currentContainer","maxIndexToConsider","isSurrogatePair","storageMap","encoded","Number","resolved","stillComposing","textInputData","resolveComposition","composedChars","mustReset","randomizeBlockMapKeys","blockKeys","startIndex","endIndex","blockquote","atomic","unstyled","_Record","isTreeBasedBlockMap","newBlockArr","fragmentSize","finalOffset","finalKey","shouldNotUpdateFromFragmentBlock","headText","headCharacters","appendToHead","updateHead","fragmentBlock","blockSize","tailText","tailCharacters","prependToTail","updateTail","fragmentHeadBlock","headKey","targetNextKey","targetParentKey","fragmentRootBlocks","rootBlock","rootBlocks","lastSiblingKey","getRootBlocks","lastRootFragmentBlockKey","originalTargetParentChildKeys","newChildrenKeysArray","fragmentBlockMap","updateExistingBlock"],"ignoreList":[],"sourceRoot":""}