{"version":3,"sources":["webpack:///diff_notes.52d57a3ff370892e059b.bundle.js","webpack:///../images/no_avatar.png","webpack:///./diff_notes/components/comment_resolve_btn.js","webpack:///./diff_notes/components/diff_note_avatars.js","webpack:///./diff_notes/components/jump_to_discussion.js","webpack:///./diff_notes/components/new_issue_for_discussion.js","webpack:///./diff_notes/components/resolve_btn.js","webpack:///./diff_notes/components/resolve_count.js","webpack:///./diff_notes/components/resolve_discussion_btn.js","webpack:///./diff_notes/diff_notes_bundle.js","webpack:///./diff_notes/icons/collapse_icon.svg","webpack:///./diff_notes/mixins/discussion.js","webpack:///./diff_notes/models/discussion.js","webpack:///./diff_notes/models/note.js","webpack:///./diff_notes/services/resolve.js","webpack:///./diff_notes/stores/comments.js"],"names":["webpackJsonp","../images/no_avatar.png","module","exports","./diff_notes/components/comment_resolve_btn.js","__webpack_exports__","__webpack_require__","$","__WEBPACK_IMPORTED_MODULE_0_vue__","CommentAndResolveBtn","extend","props","discussionId","String","data","textareaIsEmpty","discussion","computed","showButton","this","isResolvable","isDiscussionResolved","isResolved","buttonText","created","CommentsStore","state","mounted","_this","$textarea","val","on","destroyed","off","component","call","./diff_notes/components/diff_note_avatars.js","__WEBPACK_IMPORTED_MODULE_1__icons_collapse_icon_svg__","__WEBPACK_IMPORTED_MODULE_1__icons_collapse_icon_svg___default","n","__WEBPACK_IMPORTED_MODULE_2__vue_shared_components_user_avatar_user_avatar_image_vue__","DiffNoteAvatars","isVisible","lineType","storeState","shownAvatars","collapseIcon","a","components","userAvatarImage","template","$nextTick","addNoCommentClass","setDiscussionVisible","$el","closest","hasClass","document","beforeDestroy","watch","handler","_this2","tooltip","deep","discussionClassName","notesSubset","_this3","notes","Object","keys","slice","map","noteId","extraNotesTitle","extra","notesCount","moreText","methods","clickedAvatar","e","_this4","onAddDiffNote","toggleDiscussionsToggleState","toggleClass","nextUntil","$notesHolders","find","$visibleNotesHolders","filter","length","id","is","getTooltipText","note","authorName","noteTruncated","./diff_notes/components/jump_to_discussion.js","__WEBPACK_IMPORTED_MODULE_1__mixins_discussion__","JumpToDiscussion","mixins","DiscussionMixins","discussions","allResolved","unresolvedDiscussionCount","lastResolvedId","lastId","jumpToNextUnresolvedDiscussion","discussionsSelector","discussionIdsInScope","firstUnresolvedDiscussionId","nextUnresolvedDiscussionId","activeTab","window","mrTabs","currentAction","hasDiscussionsToJumpTo","jumpToFirstDiscussion","discussionIdsForElements","elements","attr","toArray","i","activateTab","currentDiscussionFound","$target","trigger","show","$notesHolder","prevEl","prev","scrollTo","offset","./diff_notes/components/new_issue_for_discussion.js","NewIssueForDiscussion","type","required","./diff_notes/components/resolve_btn.js","__WEBPACK_IMPORTED_MODULE_1__flash__","ResolveBtn","Number","resolved","Boolean","canResolve","resolvedBy","authorAvatar","loading","getNote","resolvedByName","resolved_by","updateTooltip","$refs","button","resolve","promise","ResolveService","unresolve","then","resp","json","update","updateHeadline","gl","mrWidget","checkStatus","catch","container","delete","create","./diff_notes/components/resolve_count.js","ResolveCount","loggedOut","resolvedDiscussionCount","discussionCount","resolvedCountText","./diff_notes/components/resolve_discussion_btn.js","ResolveDiscussionBtn","mergeRequestId","toggleResolveForDiscussion","createDiscussion","./diff_notes/diff_notes_bundle.js","defineProperty","value","__WEBPACK_IMPORTED_MODULE_2__models_note__","__WEBPACK_IMPORTED_MODULE_5__mixins_discussion__","projectPathHolder","querySelector","projectPath","dataset","diffNoteApps","DiffNotesResolveServiceClass","diffNotesCompileComponents","each","tmp","get","outerHTML","tmpApp","$mount","replaceWith","one","$destroy","remove","$components","$this","el","resolve-count","./diff_notes/icons/collapse_icon.svg","./diff_notes/mixins/discussion.js","resolvedCount","unresolvedCount","./diff_notes/models/discussion.js","_classCallCheck","instance","Constructor","TypeError","_createClass","defineProperties","target","descriptor","enumerable","configurable","writable","key","protoProps","staticProps","prototype","DiscussionModel","noteObj","set","NoteModel","discussionSelector","$discussionHeadline","discussion_headline_html","append","utils","localTimeAgo","./diff_notes/models/note.js","./diff_notes/services/resolve.js","ResolveServiceClass","root","noteResource","resource","discussionResource","save","unResolveAll","resolveAll","unResolveAllNotes","resolveAllNotes","./diff_notes/stores/comments.js","undefined","createNote","deleteNote","unresolvedDiscussionIds","ids","push"],"mappings":"AAAAA,cAAc,eAERC,0BACA,SAAUC,EAAQC,GCHxBD,EAAAC,QAAA,s1BDSMC,iDACA,SAAUF,EAAQG,EAAqBC,GAE7C,cAC4B,SAASC,GEbrC,GAAAC,GAAAF,EAAA,6CAKMG,EAAuBD,EAAA,EAAIE,QAC/BC,OACEC,aAAcC,QAEhBC,KAJsC,WAKpC,OACEC,iBAAiB,EACjBC,gBAGJC,UACEC,WAAY,WACV,QAAIC,KAAKH,YACAG,KAAKH,WAAWI,gBAK3BC,qBAAsB,WACpB,MAAOF,MAAKH,WAAWM,cAEzBC,WAAY,WACV,MAAIJ,MAAKE,qBACHF,KAAKJ,gBACA,QAEA,aAGLI,KAAKJ,gBACA,OAEA,cAKfS,QArCsC,WAsChCL,KAAKP,eACPO,KAAKH,WAAaS,cAAcC,MAAMP,KAAKP,gBAG/Ce,QAAS,WAAY,GAAAC,GAAAT,IACnB,IAAKA,KAAKP,aAAV,CAEA,GAAMiB,GAAYtB,iDAAiDY,KAAKP,aAAtD,mBAClBO,MAAKJ,gBAAsC,KAApBc,EAAUC,MAEjCD,EAAUE,GAAG,gCAAiC,WAC5CH,EAAKb,gBAAsC,KAApBc,EAAUC,UAGrCE,UAAW,WACJb,KAAKP,cAEVL,iDAAiDY,KAAKP,aAAtD,oBAAsFqB,IAAI,mCAI9FzB,GAAA,EAAI0B,UAAU,0BAA2BzB,KFmBZ0B,KAAK9B,EAAqBC,EAAoB,iDAIrE8B,+CACA,SAAUlC,EAAQG,EAAqBC,GAE7C,cAC4B,SAASC,GAAyB,GAAIC,GAAoCF,EAAoB,6CACjG+B,EAAyD/B,EAAoB,wCAC7EgC,EAAiEhC,EAAoBiC,EAAEF,GG7FhHG,EAAAlC,EAAA,6DAOMmC,EAAkBjC,EAAA,EAAIE,QAC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U1J,EAAc4D,GAC9B,GAAMxD,GAAaG,KAAKO,MAAMd,EAC9BI,GAAW0O,WAAWlL,GAEU,IAA5BxD,EAAW2D,cACbnE,EAAA,EAAI8J,OAAOnJ,KAAKO,MAAOd,IAG3B+O,wBAAyB,WACvB,GAAMC,KAEN,KAAK,GAAMhP,KAAgBO,MAAKO,MAAO,CACrC,GAAMV,GAAaG,KAAKO,MAAMd,EAEzBI,GAAWM,cACdsO,EAAIC,KAAK7O,EAAW0E,IAIxB,MAAOkK,QfonCR","file":"diff_notes.52d57a3ff370892e059b.bundle.js","sourcesContent":["webpackJsonp([\"diff_notes\"],{\n\n/***/ \"../images/no_avatar.png\":\n/***/ (function(module, exports) {\n\nmodule.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAAAAAAdJSU2AAACNElEQVR4AdXYBa7jMBCA4b3/JZahzIkjp2qt+BWUWnG5ln2XxaJJb2b5F2ukL4wvzK/rP7bUcbf92u6oftLSe1ldk8efsfaVeEjusZZeC6e1RllaCk/yG6ag1lZ4WwPX69uyD6tAe/g2ipAlNMRS37awDLaFrpcMWxXQOi0jnWCWjFkSZomYJWDWKmatYNZyEWkJsvQimoZYah5NgdaLxagCtF6GRy0DshZPkeYwS/KIJWGWYjwYUzDLxCwDtJ54OKglimBLqHWahii2g1pmHLLGBmwVoRjcKlmgOdw65H5qKuGWCVi5Qlhs6m1sENZi4q3AWNvca5UYy2RjT/SAsiZey6CsIvc0wVlV5lJ0ibPMyLUGCmlxQq0IM0hLdWyro7CWEc3sXsqaK4O2zLxOsmtpfW5Q1u68ZrVmepaaNXEewawtI9X5Xl3U3n1qND6+rfPzvqoIWz/fklNCSLY153YV53J/XUxGCJnKZ1lajsn3/Ffegf6Y5pV2LUsSNL2UHzxUfh3TlYpZqqTpXZm0KZk9zJcqaEmaWPHDw0pxe05K7bWOLHFLWXVetqpYmrjle4+1y0aBaF4UOQ1NU+lYezJClkjLUnSEjqhH6zjAW4OjtY39Ibq+sawUb6W2RQfoqG0VeKuwrRJvlba17faRdbe2pTtYq6Nty/S7yAbGsQjWIq41wVoT1+IdZNy1djUcVdu5lklQWC0xHkt1X31qNEE1Pr3qKv/9XiSNj6Aaifj3/69+AYujsR/MvkpZAAAAAElFTkSuQmCC\"\n\n/***/ }),\n\n/***/ \"./diff_notes/components/comment_resolve_btn.js\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(\"../../../node_modules/vue/dist/vue.esm.js\");\n/* eslint-disable comma-dangle, object-shorthand, func-names, no-else-return, quotes, no-lonely-if, max-len */\n/* global CommentsStore */\n\n\n\nvar CommentAndResolveBtn = __WEBPACK_IMPORTED_MODULE_0_vue__[\"a\" /* default */].extend({\n props: {\n discussionId: String\n },\n data: function data() {\n return {\n textareaIsEmpty: true,\n discussion: {}\n };\n },\n\n computed: {\n showButton: function showButton() {\n if (this.discussion) {\n return this.discussion.isResolvable();\n } else {\n return false;\n }\n },\n isDiscussionResolved: function isDiscussionResolved() {\n return this.discussion.isResolved();\n },\n buttonText: function buttonText() {\n if (this.isDiscussionResolved) {\n if (this.textareaIsEmpty) {\n return \"未解决讨论\";\n } else {\n return \"评论 & 未解决讨论\";\n }\n } else {\n if (this.textareaIsEmpty) {\n return \"解决讨论\";\n } else {\n return \"评论 & 解决讨论\";\n }\n }\n }\n },\n created: function created() {\n if (this.discussionId) {\n this.discussion = CommentsStore.state[this.discussionId];\n }\n },\n\n mounted: function mounted() {\n var _this = this;\n\n if (!this.discussionId) return;\n\n var $textarea = $(\".js-discussion-note-form[data-discussion-id=\" + this.discussionId + \"] .note-textarea\");\n this.textareaIsEmpty = $textarea.val() === '';\n\n $textarea.on('input.comment-and-resolve-btn', function () {\n _this.textareaIsEmpty = $textarea.val() === '';\n });\n },\n destroyed: function destroyed() {\n if (!this.discussionId) return;\n\n $(\".js-discussion-note-form[data-discussion-id=\" + this.discussionId + \"] .note-textarea\").off('input.comment-and-resolve-btn');\n }\n});\n\n__WEBPACK_IMPORTED_MODULE_0_vue__[\"a\" /* default */].component('comment-and-resolve-btn', CommentAndResolveBtn);\n/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(\"../../../node_modules/jquery/dist/jquery.js\")))\n\n/***/ }),\n\n/***/ \"./diff_notes/components/diff_note_avatars.js\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(\"../../../node_modules/vue/dist/vue.esm.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__icons_collapse_icon_svg__ = __webpack_require__(\"./diff_notes/icons/collapse_icon.svg\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__icons_collapse_icon_svg___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__icons_collapse_icon_svg__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__vue_shared_components_user_avatar_user_avatar_image_vue__ = __webpack_require__(\"./vue_shared/components/user_avatar/user_avatar_image.vue\");\n/* global CommentsStore */\n/* global notes */\n\n\n\n\n\nvar DiffNoteAvatars = __WEBPACK_IMPORTED_MODULE_0_vue__[\"a\" /* default */].extend({\n props: ['discussionId'],\n data: function data() {\n return {\n isVisible: false,\n lineType: '',\n storeState: CommentsStore.state,\n shownAvatars: 3,\n collapseIcon: __WEBPACK_IMPORTED_MODULE_1__icons_collapse_icon_svg___default.a\n };\n },\n\n components: {\n userAvatarImage: __WEBPACK_IMPORTED_MODULE_2__vue_shared_components_user_avatar_user_avatar_image_vue__[\"a\" /* default */]\n },\n template: '\\n
\\n
\\n \\n \\n shownAvatars\"\\n class=\"diff-comments-more-count has-tooltip js-diff-comment-avatar\"\\n data-container=\"body\"\\n data-placement=\"top\"\\n ref=\"extraComments\"\\n role=\"button\"\\n :data-line-type=\"lineType\"\\n :title=\"extraNotesTitle\"\\n @click=\"clickedAvatar($event)\">{{ moreText }}\\n
\\n \\n
\\n ',\n mounted: function mounted() {\n var _this = this;\n\n this.$nextTick(function () {\n _this.addNoCommentClass();\n _this.setDiscussionVisible();\n\n _this.lineType = $(_this.$el).closest('.diff-line-num').hasClass('old_line') ? 'old' : 'new';\n });\n\n $(document).on('toggle.comments', function () {\n _this.$nextTick(function () {\n _this.setDiscussionVisible();\n });\n });\n },\n beforeDestroy: function beforeDestroy() {\n this.addNoCommentClass();\n $(document).off('toggle.comments');\n },\n\n watch: {\n storeState: {\n handler: function handler() {\n var _this2 = this;\n\n this.$nextTick(function () {\n $('.has-tooltip', _this2.$el).tooltip('fixTitle');\n\n // We need to add/remove a class to an element that is outside the Vue instance\n _this2.addNoCommentClass();\n });\n },\n\n deep: true\n }\n },\n computed: {\n discussionClassName: function discussionClassName() {\n return 'js-diff-avatars-' + this.discussionId;\n },\n notesSubset: function notesSubset() {\n var _this3 = this;\n\n var notes = [];\n\n if (this.discussion) {\n notes = Object.keys(this.discussion.notes).slice(0, this.shownAvatars).map(function (noteId) {\n return _this3.discussion.notes[noteId];\n });\n }\n\n return notes;\n },\n extraNotesTitle: function extraNotesTitle() {\n if (this.discussion) {\n var extra = this.discussion.notesCount() - this.shownAvatars;\n\n return extra + ' more comment' + (extra > 1 ? 's' : '');\n }\n\n return '';\n },\n discussion: function discussion() {\n return this.storeState[this.discussionId];\n },\n notesCount: function notesCount() {\n if (this.discussion) {\n return this.discussion.notesCount();\n }\n\n return 0;\n },\n moreText: function moreText() {\n var plusSign = this.notesCount < 100 ? '+' : '';\n\n return '' + plusSign + (this.notesCount - this.shownAvatars);\n }\n },\n methods: {\n clickedAvatar: function clickedAvatar(e) {\n var _this4 = this;\n\n notes.onAddDiffNote(e);\n\n // Toggle the active state of the toggle all button\n this.toggleDiscussionsToggleState();\n\n this.$nextTick(function () {\n _this4.setDiscussionVisible();\n\n $('.has-tooltip', _this4.$el).tooltip('fixTitle');\n $('.has-tooltip', _this4.$el).tooltip('hide');\n });\n },\n addNoCommentClass: function addNoCommentClass() {\n var notesCount = this.notesCount;\n\n $(this.$el).closest('.js-avatar-container').toggleClass('no-comment-btn', notesCount > 0).nextUntil('.js-avatar-container').toggleClass('no-comment-btn', notesCount > 0);\n },\n toggleDiscussionsToggleState: function toggleDiscussionsToggleState() {\n var $notesHolders = $(this.$el).closest('.code').find('.notes_holder');\n var $visibleNotesHolders = $notesHolders.filter(':visible');\n var $toggleDiffCommentsBtn = $(this.$el).closest('.diff-file').find('.js-toggle-diff-comments');\n\n $toggleDiffCommentsBtn.toggleClass('active', $notesHolders.length === $visibleNotesHolders.length);\n },\n setDiscussionVisible: function setDiscussionVisible() {\n this.isVisible = $('.diffs .notes[data-discussion-id=\"' + this.discussion.id + '\"]').is(':visible');\n },\n getTooltipText: function getTooltipText(note) {\n return note.authorName + ': ' + note.noteTruncated;\n }\n }\n});\n\n__WEBPACK_IMPORTED_MODULE_0_vue__[\"a\" /* default */].component('diff-note-avatars', DiffNoteAvatars);\n/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(\"../../../node_modules/jquery/dist/jquery.js\")))\n\n/***/ }),\n\n/***/ \"./diff_notes/components/jump_to_discussion.js\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(\"../../../node_modules/vue/dist/vue.esm.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_discussion__ = __webpack_require__(\"./diff_notes/mixins/discussion.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_discussion___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__mixins_discussion__);\n/* eslint-disable comma-dangle, object-shorthand, func-names, no-else-return, guard-for-in, no-restricted-syntax, one-var, space-before-function-paren, no-lonely-if, no-continue, brace-style, max-len, quotes */\n/* global DiscussionMixins */\n/* global CommentsStore */\n\n\n\n\n\nvar JumpToDiscussion = __WEBPACK_IMPORTED_MODULE_0_vue__[\"a\" /* default */].extend({\n mixins: [DiscussionMixins],\n props: {\n discussionId: String\n },\n data: function data() {\n return {\n discussions: CommentsStore.state,\n discussion: {}\n };\n },\n computed: {\n buttonText: function buttonText() {\n if (this.discussionId) {\n return 'Jump to next unresolved discussion';\n } else {\n return 'Jump to first unresolved discussion';\n }\n },\n allResolved: function allResolved() {\n return this.unresolvedDiscussionCount === 0;\n },\n showButton: function showButton() {\n if (this.discussionId) {\n if (this.unresolvedDiscussionCount > 1) {\n return true;\n } else {\n return this.discussionId !== this.lastResolvedId;\n }\n } else {\n return this.unresolvedDiscussionCount >= 1;\n }\n },\n lastResolvedId: function lastResolvedId() {\n var lastId = void 0;\n for (var discussionId in this.discussions) {\n var discussion = this.discussions[discussionId];\n\n if (!discussion.isResolved()) {\n lastId = discussion.id;\n }\n }\n return lastId;\n }\n },\n methods: {\n jumpToNextUnresolvedDiscussion: function jumpToNextUnresolvedDiscussion() {\n var discussionsSelector = void 0;\n var discussionIdsInScope = void 0;\n var firstUnresolvedDiscussionId = void 0;\n var nextUnresolvedDiscussionId = void 0;\n var activeTab = window.mrTabs.currentAction;\n var hasDiscussionsToJumpTo = true;\n var jumpToFirstDiscussion = !this.discussionId;\n\n var discussionIdsForElements = function discussionIdsForElements(elements) {\n return elements.map(function () {\n return $(this).attr('data-discussion-id');\n }).toArray();\n };\n\n var discussions = this.discussions;\n\n if (activeTab === 'diffs') {\n discussionsSelector = '.diffs .notes[data-discussion-id]';\n discussionIdsInScope = discussionIdsForElements($(discussionsSelector));\n\n var unresolvedDiscussionCount = 0;\n\n for (var i = 0; i < discussionIdsInScope.length; i += 1) {\n var discussionId = discussionIdsInScope[i];\n var discussion = discussions[discussionId];\n if (discussion && !discussion.isResolved()) {\n unresolvedDiscussionCount += 1;\n }\n }\n\n if (this.discussionId && !this.discussion.isResolved()) {\n // If this is the last unresolved discussion on the diffs tab,\n // there are no discussions to jump to.\n if (unresolvedDiscussionCount === 1) {\n hasDiscussionsToJumpTo = false;\n }\n } else {\n // If there are no unresolved discussions on the diffs tab at all,\n // there are no discussions to jump to.\n if (unresolvedDiscussionCount === 0) {\n hasDiscussionsToJumpTo = false;\n }\n }\n } else if (activeTab !== 'show') {\n // If we are on the commits or builds tabs,\n // there are no discussions to jump to.\n hasDiscussionsToJumpTo = false;\n }\n\n if (!hasDiscussionsToJumpTo) {\n // If there are no discussions to jump to on the current page,\n // switch to the notes tab and jump to the first disucssion there.\n window.mrTabs.activateTab('show');\n activeTab = 'show';\n jumpToFirstDiscussion = true;\n }\n\n if (activeTab === 'show') {\n discussionsSelector = '.discussion[data-discussion-id]';\n discussionIdsInScope = discussionIdsForElements($(discussionsSelector));\n }\n\n var currentDiscussionFound = false;\n for (var _i = 0; _i < discussionIdsInScope.length; _i += 1) {\n var _discussionId = discussionIdsInScope[_i];\n var _discussion = discussions[_discussionId];\n\n if (!_discussion) {\n // Discussions for comments on commits in this MR don't have a resolved status.\n continue;\n }\n\n if (!firstUnresolvedDiscussionId && !_discussion.isResolved()) {\n firstUnresolvedDiscussionId = _discussionId;\n\n if (jumpToFirstDiscussion) {\n break;\n }\n }\n\n if (!jumpToFirstDiscussion) {\n if (currentDiscussionFound) {\n if (!_discussion.isResolved()) {\n nextUnresolvedDiscussionId = _discussionId;\n break;\n } else {\n continue;\n }\n }\n\n if (_discussionId === this.discussionId) {\n currentDiscussionFound = true;\n }\n }\n }\n\n nextUnresolvedDiscussionId = nextUnresolvedDiscussionId || firstUnresolvedDiscussionId;\n\n if (!nextUnresolvedDiscussionId) {\n return;\n }\n\n var $target = $(discussionsSelector + '[data-discussion-id=\"' + nextUnresolvedDiscussionId + '\"]');\n\n if (activeTab === 'show') {\n $target = $target.closest('.note-discussion');\n\n // If the next discussion is closed, toggle it open.\n if ($target.find('.js-toggle-content').is(':hidden')) {\n $target.find('.js-toggle-button i').trigger('click');\n }\n } else if (activeTab === 'diffs') {\n // Resolved discussions are hidden in the diffs tab by default.\n // If they are marked unresolved on the notes tab, they will still be hidden on the diffs tab.\n // When jumping between unresolved discussions on the diffs tab, we show them.\n $target.closest(\".content\").show();\n\n var $notesHolder = $target.closest(\"tr.notes_holder\");\n\n // Image diff discussions does not use notes_holder\n // so we should keep original $target value in those cases\n if ($notesHolder.length > 0) {\n $target = $notesHolder;\n }\n\n $target.show();\n\n // If we are on the diffs tab, we don't scroll to the discussion itself, but to\n // 4 diff lines above it: the line the discussion was in response to + 3 context\n var prevEl = void 0;\n for (var _i2 = 0; _i2 < 4; _i2 += 1) {\n prevEl = $target.prev();\n\n // If the discussion doesn't have 4 lines above it, we'll have to do with fewer.\n if (!prevEl.hasClass(\"line_holder\")) {\n break;\n }\n\n $target = prevEl;\n }\n }\n\n $.scrollTo($target, {\n offset: 0\n });\n }\n },\n created: function created() {\n this.discussion = this.discussions[this.discussionId];\n }\n});\n\n__WEBPACK_IMPORTED_MODULE_0_vue__[\"a\" /* default */].component('jump-to-discussion', JumpToDiscussion);\n/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(\"../../../node_modules/jquery/dist/jquery.js\")))\n\n/***/ }),\n\n/***/ \"./diff_notes/components/new_issue_for_discussion.js\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(\"../../../node_modules/vue/dist/vue.esm.js\");\n/* global CommentsStore */\n\n\n\nvar NewIssueForDiscussion = __WEBPACK_IMPORTED_MODULE_0_vue__[\"a\" /* default */].extend({\n props: {\n discussionId: {\n type: String,\n required: true\n }\n },\n data: function data() {\n return {\n discussions: CommentsStore.state\n };\n },\n\n computed: {\n discussion: function discussion() {\n return this.discussions[this.discussionId];\n },\n showButton: function showButton() {\n if (this.discussion) return !this.discussion.isResolved();\n return false;\n }\n }\n});\n\n__WEBPACK_IMPORTED_MODULE_0_vue__[\"a\" /* default */].component('new-issue-for-discussion-btn', NewIssueForDiscussion);\n\n/***/ }),\n\n/***/ \"./diff_notes/components/resolve_btn.js\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(\"../../../node_modules/vue/dist/vue.esm.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__flash__ = __webpack_require__(\"./flash.js\");\n/* eslint-disable comma-dangle, object-shorthand, func-names, quote-props, no-else-return, camelcase, max-len */\n/* global CommentsStore */\n/* global ResolveService */\n\n\n\n\nvar ResolveBtn = __WEBPACK_IMPORTED_MODULE_0_vue__[\"a\" /* default */].extend({\n props: {\n noteId: Number,\n discussionId: String,\n resolved: Boolean,\n canResolve: Boolean,\n resolvedBy: String,\n authorName: String,\n authorAvatar: String,\n noteTruncated: String\n },\n data: function data() {\n return {\n discussions: CommentsStore.state,\n loading: false\n };\n },\n watch: {\n 'discussions': {\n handler: 'updateTooltip',\n deep: true\n }\n },\n computed: {\n discussion: function discussion() {\n return this.discussions[this.discussionId];\n },\n note: function note() {\n return this.discussion ? this.discussion.getNote(this.noteId) : {};\n },\n buttonText: function buttonText() {\n if (this.isResolved) {\n return 'Resolved by ' + this.resolvedByName;\n } else if (this.canResolve) {\n return '标记为已解决';\n } else {\n return '无法解决';\n }\n },\n isResolved: function isResolved() {\n if (this.note) {\n return this.note.resolved;\n } else {\n return false;\n }\n },\n resolvedByName: function resolvedByName() {\n return this.note.resolved_by;\n }\n },\n methods: {\n updateTooltip: function updateTooltip() {\n var _this = this;\n\n this.$nextTick(function () {\n $(_this.$refs.button).tooltip('hide').tooltip('fixTitle');\n });\n },\n resolve: function resolve() {\n var _this2 = this;\n\n if (!this.canResolve) return;\n\n var promise = void 0;\n this.loading = true;\n\n if (this.isResolved) {\n promise = ResolveService.unresolve(this.noteId);\n } else {\n promise = ResolveService.resolve(this.noteId);\n }\n\n promise.then(function (resp) {\n return resp.json();\n }).then(function (data) {\n _this2.loading = false;\n\n var resolved_by = data ? data.resolved_by : null;\n\n CommentsStore.update(_this2.discussionId, _this2.noteId, !_this2.isResolved, resolved_by);\n _this2.discussion.updateHeadline(data);\n gl.mrWidget.checkStatus();\n\n _this2.updateTooltip();\n }).catch(function () {\n return new __WEBPACK_IMPORTED_MODULE_1__flash__[\"a\" /* default */]('An error occurred when trying to resolve a comment. Please try again.');\n });\n }\n },\n mounted: function mounted() {\n $(this.$refs.button).tooltip({\n container: 'body'\n });\n },\n beforeDestroy: function beforeDestroy() {\n CommentsStore.delete(this.discussionId, this.noteId);\n },\n created: function created() {\n CommentsStore.create({\n discussionId: this.discussionId,\n noteId: this.noteId,\n canResolve: this.canResolve,\n resolved: this.resolved,\n resolvedBy: this.resolvedBy,\n authorName: this.authorName,\n authorAvatar: this.authorAvatar,\n noteTruncated: this.noteTruncated\n });\n }\n});\n\n__WEBPACK_IMPORTED_MODULE_0_vue__[\"a\" /* default */].component('resolve-btn', ResolveBtn);\n/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(\"../../../node_modules/jquery/dist/jquery.js\")))\n\n/***/ }),\n\n/***/ \"./diff_notes/components/resolve_count.js\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(\"../../../node_modules/vue/dist/vue.esm.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_discussion__ = __webpack_require__(\"./diff_notes/mixins/discussion.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__mixins_discussion___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__mixins_discussion__);\n/* eslint-disable comma-dangle, object-shorthand, func-names, no-param-reassign */\n/* global DiscussionMixins */\n/* global CommentsStore */\n\n\n\n\n\nwindow.ResolveCount = __WEBPACK_IMPORTED_MODULE_0_vue__[\"a\" /* default */].extend({\n mixins: [DiscussionMixins],\n props: {\n loggedOut: Boolean\n },\n data: function data() {\n return {\n discussions: CommentsStore.state\n };\n },\n computed: {\n allResolved: function allResolved() {\n return this.resolvedDiscussionCount === this.discussionCount;\n },\n resolvedCountText: function resolvedCountText() {\n return this.discussionCount === 1 ? '讨论' : '讨论';\n }\n }\n});\n\n/***/ }),\n\n/***/ \"./diff_notes/components/resolve_discussion_btn.js\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(\"../../../node_modules/vue/dist/vue.esm.js\");\n/* eslint-disable object-shorthand, func-names, space-before-function-paren, comma-dangle, no-else-return, quotes, max-len */\n/* global CommentsStore */\n/* global ResolveService */\n\n\n\nvar ResolveDiscussionBtn = __WEBPACK_IMPORTED_MODULE_0_vue__[\"a\" /* default */].extend({\n props: {\n discussionId: String,\n mergeRequestId: Number,\n canResolve: Boolean\n },\n data: function data() {\n return {\n discussion: {}\n };\n },\n computed: {\n showButton: function showButton() {\n if (this.discussion) {\n return this.discussion.isResolvable();\n } else {\n return false;\n }\n },\n isDiscussionResolved: function isDiscussionResolved() {\n if (this.discussion) {\n return this.discussion.isResolved();\n } else {\n return false;\n }\n },\n buttonText: function buttonText() {\n if (this.isDiscussionResolved) {\n return \"Unresolve discussion\";\n } else {\n return \"Resolve discussion\";\n }\n },\n loading: function loading() {\n if (this.discussion) {\n return this.discussion.loading;\n } else {\n return false;\n }\n }\n },\n methods: {\n resolve: function resolve() {\n ResolveService.toggleResolveForDiscussion(this.mergeRequestId, this.discussionId);\n }\n },\n created: function created() {\n CommentsStore.createDiscussion(this.discussionId, this.canResolve);\n\n this.discussion = CommentsStore.state[this.discussionId];\n }\n});\n\n__WEBPACK_IMPORTED_MODULE_0_vue__[\"a\" /* default */].component('resolve-discussion-btn', ResolveDiscussionBtn);\n\n/***/ }),\n\n/***/ \"./diff_notes/diff_notes_bundle.js\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(\"../../../node_modules/vue/dist/vue.esm.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__models_discussion__ = __webpack_require__(\"./diff_notes/models/discussion.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__models_note__ = __webpack_require__(\"./diff_notes/models/note.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__models_note___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_2__models_note__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__stores_comments__ = __webpack_require__(\"./diff_notes/stores/comments.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__services_resolve__ = __webpack_require__(\"./diff_notes/services/resolve.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__mixins_discussion__ = __webpack_require__(\"./diff_notes/mixins/discussion.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__mixins_discussion___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_5__mixins_discussion__);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__components_comment_resolve_btn__ = __webpack_require__(\"./diff_notes/components/comment_resolve_btn.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__components_jump_to_discussion__ = __webpack_require__(\"./diff_notes/components/jump_to_discussion.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__components_resolve_btn__ = __webpack_require__(\"./diff_notes/components/resolve_btn.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__components_resolve_count__ = __webpack_require__(\"./diff_notes/components/resolve_count.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__components_resolve_discussion_btn__ = __webpack_require__(\"./diff_notes/components/resolve_discussion_btn.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__components_diff_note_avatars__ = __webpack_require__(\"./diff_notes/components/diff_note_avatars.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__components_new_issue_for_discussion__ = __webpack_require__(\"./diff_notes/components/new_issue_for_discussion.js\");\n/* eslint-disable func-names, comma-dangle, new-cap, no-new, max-len */\n/* global ResolveCount */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n$(function () {\n var projectPathHolder = document.querySelector('.merge-request') || document.querySelector('.commit-box');\n var projectPath = projectPathHolder.dataset.projectPath;\n var COMPONENT_SELECTOR = 'resolve-btn, resolve-discussion-btn, jump-to-discussion, comment-and-resolve-btn, new-issue-for-discussion-btn';\n\n window.gl = window.gl || {};\n window.gl.diffNoteApps = {};\n\n window.ResolveService = new gl.DiffNotesResolveServiceClass(projectPath);\n\n gl.diffNotesCompileComponents = function () {\n $('diff-note-avatars').each(function () {\n var tmp = __WEBPACK_IMPORTED_MODULE_0_vue__[\"a\" /* default */].extend({\n template: $(this).get(0).outerHTML\n });\n var tmpApp = new tmp().$mount();\n\n $(this).replaceWith(tmpApp.$el);\n $(tmpApp.$el).one('remove.vue', function () {\n tmpApp.$destroy();\n tmpApp.$el.remove();\n });\n });\n\n var $components = $(COMPONENT_SELECTOR).filter(function () {\n return $(this).closest('resolve-count').length !== 1;\n });\n\n if ($components) {\n $components.each(function () {\n var $this = $(this);\n var noteId = $this.attr(':note-id');\n var discussionId = $this.attr(':discussion-id');\n\n if ($this.is('comment-and-resolve-btn') && !discussionId) return;\n\n var tmp = __WEBPACK_IMPORTED_MODULE_0_vue__[\"a\" /* default */].extend({\n template: $this.get(0).outerHTML\n });\n var tmpApp = new tmp().$mount();\n\n if (noteId) {\n gl.diffNoteApps['note_' + noteId] = tmpApp;\n }\n\n $this.replaceWith(tmpApp.$el);\n });\n }\n };\n\n gl.diffNotesCompileComponents();\n\n new __WEBPACK_IMPORTED_MODULE_0_vue__[\"a\" /* default */]({\n el: '#resolve-count-app',\n components: {\n 'resolve-count': ResolveCount\n }\n });\n\n $(window).trigger('resize.nav');\n});\n/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(\"../../../node_modules/jquery/dist/jquery.js\")))\n\n/***/ }),\n\n/***/ \"./diff_notes/icons/collapse_icon.svg\":\n/***/ (function(module, exports) {\n\nmodule.exports = \"\\n\"\n\n/***/ }),\n\n/***/ \"./diff_notes/mixins/discussion.js\":\n/***/ (function(module, exports) {\n\n/* eslint-disable object-shorthand, func-names, guard-for-in, no-restricted-syntax, comma-dangle, no-param-reassign, max-len */\n\nwindow.DiscussionMixins = {\n computed: {\n discussionCount: function discussionCount() {\n return Object.keys(this.discussions).length;\n },\n resolvedDiscussionCount: function resolvedDiscussionCount() {\n var resolvedCount = 0;\n\n for (var discussionId in this.discussions) {\n var discussion = this.discussions[discussionId];\n\n if (discussion.isResolved()) {\n resolvedCount += 1;\n }\n }\n\n return resolvedCount;\n },\n unresolvedDiscussionCount: function unresolvedDiscussionCount() {\n var unresolvedCount = 0;\n\n for (var discussionId in this.discussions) {\n var discussion = this.discussions[discussionId];\n\n if (!discussion.isResolved()) {\n unresolvedCount += 1;\n }\n }\n\n return unresolvedCount;\n }\n }\n};\n\n/***/ }),\n\n/***/ \"./diff_notes/models/discussion.js\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* WEBPACK VAR INJECTION */(function($) {/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(\"../../../node_modules/vue/dist/vue.esm.js\");\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/* eslint-disable space-before-function-paren, camelcase, guard-for-in, no-restricted-syntax, no-unused-vars, max-len */\n/* global NoteModel */\n\n\n\nvar DiscussionModel = function () {\n function DiscussionModel(discussionId) {\n _classCallCheck(this, DiscussionModel);\n\n this.id = discussionId;\n this.notes = {};\n this.loading = false;\n this.canResolve = false;\n }\n\n _createClass(DiscussionModel, [{\n key: 'createNote',\n value: function createNote(noteObj) {\n __WEBPACK_IMPORTED_MODULE_0_vue__[\"a\" /* default */].set(this.notes, noteObj.noteId, new NoteModel(this.id, noteObj));\n }\n }, {\n key: 'deleteNote',\n value: function deleteNote(noteId) {\n __WEBPACK_IMPORTED_MODULE_0_vue__[\"a\" /* default */].delete(this.notes, noteId);\n }\n }, {\n key: 'getNote',\n value: function getNote(noteId) {\n return this.notes[noteId];\n }\n }, {\n key: 'notesCount',\n value: function notesCount() {\n return Object.keys(this.notes).length;\n }\n }, {\n key: 'isResolved',\n value: function isResolved() {\n for (var noteId in this.notes) {\n var note = this.notes[noteId];\n\n if (!note.resolved) {\n return false;\n }\n }\n return true;\n }\n }, {\n key: 'resolveAllNotes',\n value: function resolveAllNotes(resolved_by) {\n for (var noteId in this.notes) {\n var note = this.notes[noteId];\n\n if (!note.resolved) {\n note.resolved = true;\n note.resolved_by = resolved_by;\n }\n }\n }\n }, {\n key: 'unResolveAllNotes',\n value: function unResolveAllNotes() {\n for (var noteId in this.notes) {\n var note = this.notes[noteId];\n\n if (note.resolved) {\n note.resolved = false;\n note.resolved_by = null;\n }\n }\n }\n }, {\n key: 'updateHeadline',\n value: function updateHeadline(data) {\n var discussionSelector = '.discussion[data-discussion-id=\"' + this.id + '\"]';\n var $discussionHeadline = $(discussionSelector + ' .js-discussion-headline');\n\n if (data.discussion_headline_html) {\n if ($discussionHeadline.length) {\n $discussionHeadline.replaceWith(data.discussion_headline_html);\n } else {\n $(discussionSelector + ' .discussion-header').append(data.discussion_headline_html);\n }\n\n gl.utils.localTimeAgo($('.js-timeago', '' + discussionSelector));\n } else {\n $discussionHeadline.remove();\n }\n }\n }, {\n key: 'isResolvable',\n value: function isResolvable() {\n if (!this.canResolve) {\n return false;\n }\n\n for (var noteId in this.notes) {\n var note = this.notes[noteId];\n\n if (note.canResolve) {\n return true;\n }\n }\n\n return false;\n }\n }]);\n\n return DiscussionModel;\n}();\n\nwindow.DiscussionModel = DiscussionModel;\n/* WEBPACK VAR INJECTION */}.call(__webpack_exports__, __webpack_require__(\"../../../node_modules/jquery/dist/jquery.js\")))\n\n/***/ }),\n\n/***/ \"./diff_notes/models/note.js\":\n/***/ (function(module, exports) {\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/* eslint-disable camelcase, no-unused-vars */\n\nvar NoteModel = function NoteModel(discussionId, noteObj) {\n _classCallCheck(this, NoteModel);\n\n this.discussionId = discussionId;\n this.id = noteObj.noteId;\n this.canResolve = noteObj.canResolve;\n this.resolved = noteObj.resolved;\n this.resolved_by = noteObj.resolvedBy;\n this.authorName = noteObj.authorName;\n this.authorAvatar = noteObj.authorAvatar;\n this.noteTruncated = noteObj.noteTruncated;\n};\n\nwindow.NoteModel = NoteModel;\n\n/***/ }),\n\n/***/ \"./diff_notes/services/resolve.js\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(\"../../../node_modules/vue/dist/vue.esm.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__flash__ = __webpack_require__(\"./flash.js\");\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__vue_shared_vue_resource_interceptor__ = __webpack_require__(\"./vue_shared/vue_resource_interceptor.js\");\nvar _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n/* global CommentsStore */\n\n\n\n\n\nwindow.gl = window.gl || {};\n\nvar ResolveServiceClass = function () {\n function ResolveServiceClass(root) {\n _classCallCheck(this, ResolveServiceClass);\n\n this.noteResource = __WEBPACK_IMPORTED_MODULE_0_vue__[\"a\" /* default */].resource(root + '/notes{/noteId}/resolve');\n this.discussionResource = __WEBPACK_IMPORTED_MODULE_0_vue__[\"a\" /* default */].resource(root + '/merge_requests{/mergeRequestId}/discussions{/discussionId}/resolve');\n }\n\n _createClass(ResolveServiceClass, [{\n key: 'resolve',\n value: function resolve(noteId) {\n return this.noteResource.save({ noteId: noteId }, {});\n }\n }, {\n key: 'unresolve',\n value: function unresolve(noteId) {\n return this.noteResource.delete({ noteId: noteId }, {});\n }\n }, {\n key: 'toggleResolveForDiscussion',\n value: function toggleResolveForDiscussion(mergeRequestId, discussionId) {\n var discussion = CommentsStore.state[discussionId];\n var isResolved = discussion.isResolved();\n var promise = void 0;\n\n if (isResolved) {\n promise = this.unResolveAll(mergeRequestId, discussionId);\n } else {\n promise = this.resolveAll(mergeRequestId, discussionId);\n }\n\n promise.then(function (resp) {\n return resp.json();\n }).then(function (data) {\n discussion.loading = false;\n var resolvedBy = data ? data.resolved_by : null;\n\n if (isResolved) {\n discussion.unResolveAllNotes();\n } else {\n discussion.resolveAllNotes(resolvedBy);\n }\n\n if (gl.mrWidget) gl.mrWidget.checkStatus();\n discussion.updateHeadline(data);\n }).catch(function () {\n return new __WEBPACK_IMPORTED_MODULE_1__flash__[\"a\" /* default */]('An error occurred when trying to resolve a discussion. Please try again.');\n });\n }\n }, {\n key: 'resolveAll',\n value: function resolveAll(mergeRequestId, discussionId) {\n var discussion = CommentsStore.state[discussionId];\n\n discussion.loading = true;\n\n return this.discussionResource.save({\n mergeRequestId: mergeRequestId,\n discussionId: discussionId\n }, {});\n }\n }, {\n key: 'unResolveAll',\n value: function unResolveAll(mergeRequestId, discussionId) {\n var discussion = CommentsStore.state[discussionId];\n\n discussion.loading = true;\n\n return this.discussionResource.delete({\n mergeRequestId: mergeRequestId,\n discussionId: discussionId\n }, {});\n }\n }]);\n\n return ResolveServiceClass;\n}();\n\ngl.DiffNotesResolveServiceClass = ResolveServiceClass;\n\n/***/ }),\n\n/***/ \"./diff_notes/stores/comments.js\":\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_vue__ = __webpack_require__(\"../../../node_modules/vue/dist/vue.esm.js\");\n/* eslint-disable object-shorthand, func-names, camelcase, no-restricted-syntax, guard-for-in, comma-dangle, max-len, no-param-reassign */\n/* global DiscussionModel */\n\n\n\nwindow.CommentsStore = {\n state: {},\n get: function get(discussionId, noteId) {\n return this.state[discussionId].getNote(noteId);\n },\n createDiscussion: function createDiscussion(discussionId, canResolve) {\n var discussion = this.state[discussionId];\n if (!this.state[discussionId]) {\n discussion = new DiscussionModel(discussionId);\n __WEBPACK_IMPORTED_MODULE_0_vue__[\"a\" /* default */].set(this.state, discussionId, discussion);\n }\n\n if (canResolve !== undefined) {\n discussion.canResolve = canResolve;\n }\n\n return discussion;\n },\n create: function create(noteObj) {\n var discussion = this.createDiscussion(noteObj.discussionId);\n\n discussion.createNote(noteObj);\n },\n update: function update(discussionId, noteId, resolved, resolved_by) {\n var discussion = this.state[discussionId];\n var note = discussion.getNote(noteId);\n note.resolved = resolved;\n note.resolved_by = resolved_by;\n },\n delete: function _delete(discussionId, noteId) {\n var discussion = this.state[discussionId];\n discussion.deleteNote(noteId);\n\n if (discussion.notesCount() === 0) {\n __WEBPACK_IMPORTED_MODULE_0_vue__[\"a\" /* default */].delete(this.state, discussionId);\n }\n },\n unresolvedDiscussionIds: function unresolvedDiscussionIds() {\n var ids = [];\n\n for (var discussionId in this.state) {\n var discussion = this.state[discussionId];\n\n if (!discussion.isResolved()) {\n ids.push(discussion.id);\n }\n }\n\n return ids;\n }\n};\n\n/***/ })\n\n},[\"./diff_notes/diff_notes_bundle.js\"]);\n\n\n// WEBPACK FOOTER //\n// diff_notes.52d57a3ff370892e059b.bundle.js","module.exports = \"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEsAAABLCAAAAAAdJSU2AAACNElEQVR4AdXYBa7jMBCA4b3/JZahzIkjp2qt+BWUWnG5ln2XxaJJb2b5F2ukL4wvzK/rP7bUcbf92u6oftLSe1ldk8efsfaVeEjusZZeC6e1RllaCk/yG6ag1lZ4WwPX69uyD6tAe/g2ipAlNMRS37awDLaFrpcMWxXQOi0jnWCWjFkSZomYJWDWKmatYNZyEWkJsvQimoZYah5NgdaLxagCtF6GRy0DshZPkeYwS/KIJWGWYjwYUzDLxCwDtJ54OKglimBLqHWahii2g1pmHLLGBmwVoRjcKlmgOdw65H5qKuGWCVi5Qlhs6m1sENZi4q3AWNvca5UYy2RjT/SAsiZey6CsIvc0wVlV5lJ0ibPMyLUGCmlxQq0IM0hLdWyro7CWEc3sXsqaK4O2zLxOsmtpfW5Q1u68ZrVmepaaNXEewawtI9X5Xl3U3n1qND6+rfPzvqoIWz/fklNCSLY153YV53J/XUxGCJnKZ1lajsn3/Ffegf6Y5pV2LUsSNL2UHzxUfh3TlYpZqqTpXZm0KZk9zJcqaEmaWPHDw0pxe05K7bWOLHFLWXVetqpYmrjle4+1y0aBaF4UOQ1NU+lYezJClkjLUnSEjqhH6zjAW4OjtY39Ibq+sawUb6W2RQfoqG0VeKuwrRJvlba17faRdbe2pTtYq6Nty/S7yAbGsQjWIq41wVoT1+IdZNy1djUcVdu5lklQWC0xHkt1X31qNEE1Pr3qKv/9XiSNj6Aaifj3/69+AYujsR/MvkpZAAAAAElFTkSuQmCC\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ../images/no_avatar.png\n// module id = ../images/no_avatar.png\n// module chunks = boards sidebar commit_pipelines diff_notes environments cycle_analytics job_details notes pipelines pipelines_details environments_folder","/* eslint-disable comma-dangle, object-shorthand, func-names, no-else-return, quotes, no-lonely-if, max-len */\n/* global CommentsStore */\n\nimport Vue from 'vue';\n\nconst CommentAndResolveBtn = Vue.extend({\n props: {\n discussionId: String,\n },\n data() {\n return {\n textareaIsEmpty: true,\n discussion: {},\n };\n },\n computed: {\n showButton: function () {\n if (this.discussion) {\n return this.discussion.isResolvable();\n } else {\n return false;\n }\n },\n isDiscussionResolved: function () {\n return this.discussion.isResolved();\n },\n buttonText: function () {\n if (this.isDiscussionResolved) {\n if (this.textareaIsEmpty) {\n return \"未解决讨论\";\n } else {\n return \"评论 & 未解决讨论\";\n }\n } else {\n if (this.textareaIsEmpty) {\n return \"解决讨论\";\n } else {\n return \"评论 & 解决讨论\";\n }\n }\n }\n },\n created() {\n if (this.discussionId) {\n this.discussion = CommentsStore.state[this.discussionId];\n }\n },\n mounted: function () {\n if (!this.discussionId) return;\n\n const $textarea = $(`.js-discussion-note-form[data-discussion-id=${this.discussionId}] .note-textarea`);\n this.textareaIsEmpty = $textarea.val() === '';\n\n $textarea.on('input.comment-and-resolve-btn', () => {\n this.textareaIsEmpty = $textarea.val() === '';\n });\n },\n destroyed: function () {\n if (!this.discussionId) return;\n\n $(`.js-discussion-note-form[data-discussion-id=${this.discussionId}] .note-textarea`).off('input.comment-and-resolve-btn');\n }\n});\n\nVue.component('comment-and-resolve-btn', CommentAndResolveBtn);\n\n\n\n// WEBPACK FOOTER //\n// ./diff_notes/components/comment_resolve_btn.js","/* global CommentsStore */\n/* global notes */\n\nimport Vue from 'vue';\nimport collapseIcon from '../icons/collapse_icon.svg';\nimport userAvatarImage from '../../vue_shared/components/user_avatar/user_avatar_image.vue';\n\nconst DiffNoteAvatars = Vue.extend({\n props: ['discussionId'],\n data() {\n return {\n isVisible: false,\n lineType: '',\n storeState: CommentsStore.state,\n shownAvatars: 3,\n collapseIcon,\n };\n },\n components: {\n userAvatarImage,\n },\n template: `\n
\n
\n \n \n shownAvatars\"\n class=\"diff-comments-more-count has-tooltip js-diff-comment-avatar\"\n data-container=\"body\"\n data-placement=\"top\"\n ref=\"extraComments\"\n role=\"button\"\n :data-line-type=\"lineType\"\n :title=\"extraNotesTitle\"\n @click=\"clickedAvatar($event)\">{{ moreText }}\n
\n \n
\n `,\n mounted() {\n this.$nextTick(() => {\n this.addNoCommentClass();\n this.setDiscussionVisible();\n\n this.lineType = $(this.$el).closest('.diff-line-num').hasClass('old_line') ? 'old' : 'new';\n });\n\n $(document).on('toggle.comments', () => {\n this.$nextTick(() => {\n this.setDiscussionVisible();\n });\n });\n },\n beforeDestroy() {\n this.addNoCommentClass();\n $(document).off('toggle.comments');\n },\n watch: {\n storeState: {\n handler() {\n this.$nextTick(() => {\n $('.has-tooltip', this.$el).tooltip('fixTitle');\n\n // We need to add/remove a class to an element that is outside the Vue instance\n this.addNoCommentClass();\n });\n },\n deep: true,\n },\n },\n computed: {\n discussionClassName() {\n return `js-diff-avatars-${this.discussionId}`;\n },\n notesSubset() {\n let notes = [];\n\n if (this.discussion) {\n notes = Object.keys(this.discussion.notes)\n .slice(0, this.shownAvatars)\n .map(noteId => this.discussion.notes[noteId]);\n }\n\n return notes;\n },\n extraNotesTitle() {\n if (this.discussion) {\n const extra = this.discussion.notesCount() - this.shownAvatars;\n\n return `${extra} more comment${extra > 1 ? 's' : ''}`;\n }\n\n return '';\n },\n discussion() {\n return this.storeState[this.discussionId];\n },\n notesCount() {\n if (this.discussion) {\n return this.discussion.notesCount();\n }\n\n return 0;\n },\n moreText() {\n const plusSign = this.notesCount < 100 ? '+' : '';\n\n return `${plusSign}${this.notesCount - this.shownAvatars}`;\n },\n },\n methods: {\n clickedAvatar(e) {\n notes.onAddDiffNote(e);\n\n // Toggle the active state of the toggle all button\n this.toggleDiscussionsToggleState();\n\n this.$nextTick(() => {\n this.setDiscussionVisible();\n\n $('.has-tooltip', this.$el).tooltip('fixTitle');\n $('.has-tooltip', this.$el).tooltip('hide');\n });\n },\n addNoCommentClass() {\n const notesCount = this.notesCount;\n\n $(this.$el).closest('.js-avatar-container')\n .toggleClass('no-comment-btn', notesCount > 0)\n .nextUntil('.js-avatar-container')\n .toggleClass('no-comment-btn', notesCount > 0);\n },\n toggleDiscussionsToggleState() {\n const $notesHolders = $(this.$el).closest('.code').find('.notes_holder');\n const $visibleNotesHolders = $notesHolders.filter(':visible');\n const $toggleDiffCommentsBtn = $(this.$el).closest('.diff-file').find('.js-toggle-diff-comments');\n\n $toggleDiffCommentsBtn.toggleClass('active', $notesHolders.length === $visibleNotesHolders.length);\n },\n setDiscussionVisible() {\n this.isVisible = $(`.diffs .notes[data-discussion-id=\"${this.discussion.id}\"]`).is(':visible');\n },\n getTooltipText(note) {\n return `${note.authorName}: ${note.noteTruncated}`;\n },\n },\n});\n\nVue.component('diff-note-avatars', DiffNoteAvatars);\n\n\n\n// WEBPACK FOOTER //\n// ./diff_notes/components/diff_note_avatars.js","/* eslint-disable comma-dangle, object-shorthand, func-names, no-else-return, guard-for-in, no-restricted-syntax, one-var, space-before-function-paren, no-lonely-if, no-continue, brace-style, max-len, quotes */\n/* global DiscussionMixins */\n/* global CommentsStore */\n\nimport Vue from 'vue';\n\nimport '../mixins/discussion';\n\nconst JumpToDiscussion = Vue.extend({\n mixins: [DiscussionMixins],\n props: {\n discussionId: String\n },\n data: function () {\n return {\n discussions: CommentsStore.state,\n discussion: {},\n };\n },\n computed: {\n buttonText: function () {\n if (this.discussionId) {\n return 'Jump to next unresolved discussion';\n } else {\n return 'Jump to first unresolved discussion';\n }\n },\n allResolved: function () {\n return this.unresolvedDiscussionCount === 0;\n },\n showButton: function () {\n if (this.discussionId) {\n if (this.unresolvedDiscussionCount > 1) {\n return true;\n } else {\n return this.discussionId !== this.lastResolvedId;\n }\n } else {\n return this.unresolvedDiscussionCount >= 1;\n }\n },\n lastResolvedId: function () {\n let lastId;\n for (const discussionId in this.discussions) {\n const discussion = this.discussions[discussionId];\n\n if (!discussion.isResolved()) {\n lastId = discussion.id;\n }\n }\n return lastId;\n }\n },\n methods: {\n jumpToNextUnresolvedDiscussion: function () {\n let discussionsSelector;\n let discussionIdsInScope;\n let firstUnresolvedDiscussionId;\n let nextUnresolvedDiscussionId;\n let activeTab = window.mrTabs.currentAction;\n let hasDiscussionsToJumpTo = true;\n let jumpToFirstDiscussion = !this.discussionId;\n\n const discussionIdsForElements = function(elements) {\n return elements.map(function() {\n return $(this).attr('data-discussion-id');\n }).toArray();\n };\n\n const discussions = this.discussions;\n\n if (activeTab === 'diffs') {\n discussionsSelector = '.diffs .notes[data-discussion-id]';\n discussionIdsInScope = discussionIdsForElements($(discussionsSelector));\n\n let unresolvedDiscussionCount = 0;\n\n for (let i = 0; i < discussionIdsInScope.length; i += 1) {\n const discussionId = discussionIdsInScope[i];\n const discussion = discussions[discussionId];\n if (discussion && !discussion.isResolved()) {\n unresolvedDiscussionCount += 1;\n }\n }\n\n if (this.discussionId && !this.discussion.isResolved()) {\n // If this is the last unresolved discussion on the diffs tab,\n // there are no discussions to jump to.\n if (unresolvedDiscussionCount === 1) {\n hasDiscussionsToJumpTo = false;\n }\n } else {\n // If there are no unresolved discussions on the diffs tab at all,\n // there are no discussions to jump to.\n if (unresolvedDiscussionCount === 0) {\n hasDiscussionsToJumpTo = false;\n }\n }\n } else if (activeTab !== 'show') {\n // If we are on the commits or builds tabs,\n // there are no discussions to jump to.\n hasDiscussionsToJumpTo = false;\n }\n\n if (!hasDiscussionsToJumpTo) {\n // If there are no discussions to jump to on the current page,\n // switch to the notes tab and jump to the first disucssion there.\n window.mrTabs.activateTab('show');\n activeTab = 'show';\n jumpToFirstDiscussion = true;\n }\n\n if (activeTab === 'show') {\n discussionsSelector = '.discussion[data-discussion-id]';\n discussionIdsInScope = discussionIdsForElements($(discussionsSelector));\n }\n\n let currentDiscussionFound = false;\n for (let i = 0; i < discussionIdsInScope.length; i += 1) {\n const discussionId = discussionIdsInScope[i];\n const discussion = discussions[discussionId];\n\n if (!discussion) {\n // Discussions for comments on commits in this MR don't have a resolved status.\n continue;\n }\n\n if (!firstUnresolvedDiscussionId && !discussion.isResolved()) {\n firstUnresolvedDiscussionId = discussionId;\n\n if (jumpToFirstDiscussion) {\n break;\n }\n }\n\n if (!jumpToFirstDiscussion) {\n if (currentDiscussionFound) {\n if (!discussion.isResolved()) {\n nextUnresolvedDiscussionId = discussionId;\n break;\n }\n else {\n continue;\n }\n }\n\n if (discussionId === this.discussionId) {\n currentDiscussionFound = true;\n }\n }\n }\n\n nextUnresolvedDiscussionId = nextUnresolvedDiscussionId || firstUnresolvedDiscussionId;\n\n if (!nextUnresolvedDiscussionId) {\n return;\n }\n\n let $target = $(`${discussionsSelector}[data-discussion-id=\"${nextUnresolvedDiscussionId}\"]`);\n\n if (activeTab === 'show') {\n $target = $target.closest('.note-discussion');\n\n // If the next discussion is closed, toggle it open.\n if ($target.find('.js-toggle-content').is(':hidden')) {\n $target.find('.js-toggle-button i').trigger('click');\n }\n } else if (activeTab === 'diffs') {\n // Resolved discussions are hidden in the diffs tab by default.\n // If they are marked unresolved on the notes tab, they will still be hidden on the diffs tab.\n // When jumping between unresolved discussions on the diffs tab, we show them.\n $target.closest(\".content\").show();\n\n const $notesHolder = $target.closest(\"tr.notes_holder\");\n\n // Image diff discussions does not use notes_holder\n // so we should keep original $target value in those cases\n if ($notesHolder.length > 0) {\n $target = $notesHolder;\n }\n\n $target.show();\n\n // If we are on the diffs tab, we don't scroll to the discussion itself, but to\n // 4 diff lines above it: the line the discussion was in response to + 3 context\n let prevEl;\n for (let i = 0; i < 4; i += 1) {\n prevEl = $target.prev();\n\n // If the discussion doesn't have 4 lines above it, we'll have to do with fewer.\n if (!prevEl.hasClass(\"line_holder\")) {\n break;\n }\n\n $target = prevEl;\n }\n }\n\n $.scrollTo($target, {\n offset: 0\n });\n }\n },\n created() {\n this.discussion = this.discussions[this.discussionId];\n },\n});\n\nVue.component('jump-to-discussion', JumpToDiscussion);\n\n\n\n// WEBPACK FOOTER //\n// ./diff_notes/components/jump_to_discussion.js","/* global CommentsStore */\n\nimport Vue from 'vue';\n\nconst NewIssueForDiscussion = Vue.extend({\n props: {\n discussionId: {\n type: String,\n required: true,\n },\n },\n data() {\n return {\n discussions: CommentsStore.state,\n };\n },\n computed: {\n discussion() {\n return this.discussions[this.discussionId];\n },\n showButton() {\n if (this.discussion) return !this.discussion.isResolved();\n return false;\n },\n },\n});\n\nVue.component('new-issue-for-discussion-btn', NewIssueForDiscussion);\n\n\n\n// WEBPACK FOOTER //\n// ./diff_notes/components/new_issue_for_discussion.js","/* eslint-disable comma-dangle, object-shorthand, func-names, quote-props, no-else-return, camelcase, max-len */\n/* global CommentsStore */\n/* global ResolveService */\n\nimport Vue from 'vue';\nimport Flash from '../../flash';\n\nconst ResolveBtn = Vue.extend({\n props: {\n noteId: Number,\n discussionId: String,\n resolved: Boolean,\n canResolve: Boolean,\n resolvedBy: String,\n authorName: String,\n authorAvatar: String,\n noteTruncated: String,\n },\n data: function () {\n return {\n discussions: CommentsStore.state,\n loading: false\n };\n },\n watch: {\n 'discussions': {\n handler: 'updateTooltip',\n deep: true\n }\n },\n computed: {\n discussion: function () {\n return this.discussions[this.discussionId];\n },\n note: function () {\n return this.discussion ? this.discussion.getNote(this.noteId) : {};\n },\n buttonText: function () {\n if (this.isResolved) {\n return `Resolved by ${this.resolvedByName}`;\n } else if (this.canResolve) {\n return '标记为已解决';\n } else {\n return '无法解决';\n }\n },\n isResolved: function () {\n if (this.note) {\n return this.note.resolved;\n } else {\n return false;\n }\n },\n resolvedByName: function () {\n return this.note.resolved_by;\n },\n },\n methods: {\n updateTooltip: function () {\n this.$nextTick(() => {\n $(this.$refs.button)\n .tooltip('hide')\n .tooltip('fixTitle');\n });\n },\n resolve: function () {\n if (!this.canResolve) return;\n\n let promise;\n this.loading = true;\n\n if (this.isResolved) {\n promise = ResolveService\n .unresolve(this.noteId);\n } else {\n promise = ResolveService\n .resolve(this.noteId);\n }\n\n promise\n .then(resp => resp.json())\n .then((data) => {\n this.loading = false;\n\n const resolved_by = data ? data.resolved_by : null;\n\n CommentsStore.update(this.discussionId, this.noteId, !this.isResolved, resolved_by);\n this.discussion.updateHeadline(data);\n gl.mrWidget.checkStatus();\n\n this.updateTooltip();\n })\n .catch(() => new Flash('An error occurred when trying to resolve a comment. Please try again.'));\n }\n },\n mounted: function () {\n $(this.$refs.button).tooltip({\n container: 'body'\n });\n },\n beforeDestroy: function () {\n CommentsStore.delete(this.discussionId, this.noteId);\n },\n created: function () {\n CommentsStore.create({\n discussionId: this.discussionId,\n noteId: this.noteId,\n canResolve: this.canResolve,\n resolved: this.resolved,\n resolvedBy: this.resolvedBy,\n authorName: this.authorName,\n authorAvatar: this.authorAvatar,\n noteTruncated: this.noteTruncated,\n });\n }\n});\n\nVue.component('resolve-btn', ResolveBtn);\n\n\n\n// WEBPACK FOOTER //\n// ./diff_notes/components/resolve_btn.js","/* eslint-disable comma-dangle, object-shorthand, func-names, no-param-reassign */\n/* global DiscussionMixins */\n/* global CommentsStore */\n\nimport Vue from 'vue';\n\nimport '../mixins/discussion';\n\nwindow.ResolveCount = Vue.extend({\n mixins: [DiscussionMixins],\n props: {\n loggedOut: Boolean\n },\n data: function () {\n return {\n discussions: CommentsStore.state\n };\n },\n computed: {\n allResolved: function () {\n return this.resolvedDiscussionCount === this.discussionCount;\n },\n resolvedCountText() {\n return this.discussionCount === 1 ? '讨论' : '讨论';\n }\n }\n});\n\n\n\n// WEBPACK FOOTER //\n// ./diff_notes/components/resolve_count.js","/* eslint-disable object-shorthand, func-names, space-before-function-paren, comma-dangle, no-else-return, quotes, max-len */\n/* global CommentsStore */\n/* global ResolveService */\n\nimport Vue from 'vue';\n\nconst ResolveDiscussionBtn = Vue.extend({\n props: {\n discussionId: String,\n mergeRequestId: Number,\n canResolve: Boolean,\n },\n data: function() {\n return {\n discussion: {},\n };\n },\n computed: {\n showButton: function () {\n if (this.discussion) {\n return this.discussion.isResolvable();\n } else {\n return false;\n }\n },\n isDiscussionResolved: function () {\n if (this.discussion) {\n return this.discussion.isResolved();\n } else {\n return false;\n }\n },\n buttonText: function () {\n if (this.isDiscussionResolved) {\n return \"Unresolve discussion\";\n } else {\n return \"Resolve discussion\";\n }\n },\n loading: function () {\n if (this.discussion) {\n return this.discussion.loading;\n } else {\n return false;\n }\n }\n },\n methods: {\n resolve: function () {\n ResolveService.toggleResolveForDiscussion(this.mergeRequestId, this.discussionId);\n }\n },\n created: function () {\n CommentsStore.createDiscussion(this.discussionId, this.canResolve);\n\n this.discussion = CommentsStore.state[this.discussionId];\n }\n});\n\nVue.component('resolve-discussion-btn', ResolveDiscussionBtn);\n\n\n\n// WEBPACK FOOTER //\n// ./diff_notes/components/resolve_discussion_btn.js","/* eslint-disable func-names, comma-dangle, new-cap, no-new, max-len */\n/* global ResolveCount */\n\nimport Vue from 'vue';\nimport './models/discussion';\nimport './models/note';\nimport './stores/comments';\nimport './services/resolve';\nimport './mixins/discussion';\nimport './components/comment_resolve_btn';\nimport './components/jump_to_discussion';\nimport './components/resolve_btn';\nimport './components/resolve_count';\nimport './components/resolve_discussion_btn';\nimport './components/diff_note_avatars';\nimport './components/new_issue_for_discussion';\n\n$(() => {\n const projectPathHolder = document.querySelector('.merge-request') || document.querySelector('.commit-box');\n const projectPath = projectPathHolder.dataset.projectPath;\n const COMPONENT_SELECTOR = 'resolve-btn, resolve-discussion-btn, jump-to-discussion, comment-and-resolve-btn, new-issue-for-discussion-btn';\n\n window.gl = window.gl || {};\n window.gl.diffNoteApps = {};\n\n window.ResolveService = new gl.DiffNotesResolveServiceClass(projectPath);\n\n gl.diffNotesCompileComponents = () => {\n $('diff-note-avatars').each(function () {\n const tmp = Vue.extend({\n template: $(this).get(0).outerHTML\n });\n const tmpApp = new tmp().$mount();\n\n $(this).replaceWith(tmpApp.$el);\n $(tmpApp.$el).one('remove.vue', () => {\n tmpApp.$destroy();\n tmpApp.$el.remove();\n });\n });\n\n const $components = $(COMPONENT_SELECTOR).filter(function () {\n return $(this).closest('resolve-count').length !== 1;\n });\n\n if ($components) {\n $components.each(function () {\n const $this = $(this);\n const noteId = $this.attr(':note-id');\n const discussionId = $this.attr(':discussion-id');\n\n if ($this.is('comment-and-resolve-btn') && !discussionId) return;\n\n const tmp = Vue.extend({\n template: $this.get(0).outerHTML\n });\n const tmpApp = new tmp().$mount();\n\n if (noteId) {\n gl.diffNoteApps[`note_${noteId}`] = tmpApp;\n }\n\n $this.replaceWith(tmpApp.$el);\n });\n }\n };\n\n gl.diffNotesCompileComponents();\n\n new Vue({\n el: '#resolve-count-app',\n components: {\n 'resolve-count': ResolveCount\n }\n });\n\n $(window).trigger('resize.nav');\n});\n\n\n\n// WEBPACK FOOTER //\n// ./diff_notes/diff_notes_bundle.js","module.exports = \"\\n\"\n\n\n//////////////////\n// WEBPACK FOOTER\n// ./diff_notes/icons/collapse_icon.svg\n// module id = ./diff_notes/icons/collapse_icon.svg\n// module chunks = diff_notes","/* eslint-disable object-shorthand, func-names, guard-for-in, no-restricted-syntax, comma-dangle, no-param-reassign, max-len */\n\nwindow.DiscussionMixins = {\n computed: {\n discussionCount: function () {\n return Object.keys(this.discussions).length;\n },\n resolvedDiscussionCount: function () {\n let resolvedCount = 0;\n\n for (const discussionId in this.discussions) {\n const discussion = this.discussions[discussionId];\n\n if (discussion.isResolved()) {\n resolvedCount += 1;\n }\n }\n\n return resolvedCount;\n },\n unresolvedDiscussionCount: function () {\n let unresolvedCount = 0;\n\n for (const discussionId in this.discussions) {\n const discussion = this.discussions[discussionId];\n\n if (!discussion.isResolved()) {\n unresolvedCount += 1;\n }\n }\n\n return unresolvedCount;\n }\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ./diff_notes/mixins/discussion.js","/* eslint-disable space-before-function-paren, camelcase, guard-for-in, no-restricted-syntax, no-unused-vars, max-len */\n/* global NoteModel */\n\nimport Vue from 'vue';\n\nclass DiscussionModel {\n constructor (discussionId) {\n this.id = discussionId;\n this.notes = {};\n this.loading = false;\n this.canResolve = false;\n }\n\n createNote (noteObj) {\n Vue.set(this.notes, noteObj.noteId, new NoteModel(this.id, noteObj));\n }\n\n deleteNote (noteId) {\n Vue.delete(this.notes, noteId);\n }\n\n getNote (noteId) {\n return this.notes[noteId];\n }\n\n notesCount() {\n return Object.keys(this.notes).length;\n }\n\n isResolved () {\n for (const noteId in this.notes) {\n const note = this.notes[noteId];\n\n if (!note.resolved) {\n return false;\n }\n }\n return true;\n }\n\n resolveAllNotes (resolved_by) {\n for (const noteId in this.notes) {\n const note = this.notes[noteId];\n\n if (!note.resolved) {\n note.resolved = true;\n note.resolved_by = resolved_by;\n }\n }\n }\n\n unResolveAllNotes () {\n for (const noteId in this.notes) {\n const note = this.notes[noteId];\n\n if (note.resolved) {\n note.resolved = false;\n note.resolved_by = null;\n }\n }\n }\n\n updateHeadline (data) {\n const discussionSelector = `.discussion[data-discussion-id=\"${this.id}\"]`;\n const $discussionHeadline = $(`${discussionSelector} .js-discussion-headline`);\n\n if (data.discussion_headline_html) {\n if ($discussionHeadline.length) {\n $discussionHeadline.replaceWith(data.discussion_headline_html);\n } else {\n $(`${discussionSelector} .discussion-header`).append(data.discussion_headline_html);\n }\n\n gl.utils.localTimeAgo($('.js-timeago', `${discussionSelector}`));\n } else {\n $discussionHeadline.remove();\n }\n }\n\n isResolvable () {\n if (!this.canResolve) {\n return false;\n }\n\n for (const noteId in this.notes) {\n const note = this.notes[noteId];\n\n if (note.canResolve) {\n return true;\n }\n }\n\n return false;\n }\n}\n\nwindow.DiscussionModel = DiscussionModel;\n\n\n\n// WEBPACK FOOTER //\n// ./diff_notes/models/discussion.js","/* eslint-disable camelcase, no-unused-vars */\n\nclass NoteModel {\n constructor(discussionId, noteObj) {\n this.discussionId = discussionId;\n this.id = noteObj.noteId;\n this.canResolve = noteObj.canResolve;\n this.resolved = noteObj.resolved;\n this.resolved_by = noteObj.resolvedBy;\n this.authorName = noteObj.authorName;\n this.authorAvatar = noteObj.authorAvatar;\n this.noteTruncated = noteObj.noteTruncated;\n }\n}\n\nwindow.NoteModel = NoteModel;\n\n\n\n// WEBPACK FOOTER //\n// ./diff_notes/models/note.js","/* global CommentsStore */\n\nimport Vue from 'vue';\nimport Flash from '../../flash';\nimport '../../vue_shared/vue_resource_interceptor';\n\nwindow.gl = window.gl || {};\n\nclass ResolveServiceClass {\n constructor(root) {\n this.noteResource = Vue.resource(`${root}/notes{/noteId}/resolve`);\n this.discussionResource = Vue.resource(`${root}/merge_requests{/mergeRequestId}/discussions{/discussionId}/resolve`);\n }\n\n resolve(noteId) {\n return this.noteResource.save({ noteId }, {});\n }\n\n unresolve(noteId) {\n return this.noteResource.delete({ noteId }, {});\n }\n\n toggleResolveForDiscussion(mergeRequestId, discussionId) {\n const discussion = CommentsStore.state[discussionId];\n const isResolved = discussion.isResolved();\n let promise;\n\n if (isResolved) {\n promise = this.unResolveAll(mergeRequestId, discussionId);\n } else {\n promise = this.resolveAll(mergeRequestId, discussionId);\n }\n\n promise\n .then(resp => resp.json())\n .then((data) => {\n discussion.loading = false;\n const resolvedBy = data ? data.resolved_by : null;\n\n if (isResolved) {\n discussion.unResolveAllNotes();\n } else {\n discussion.resolveAllNotes(resolvedBy);\n }\n\n if (gl.mrWidget) gl.mrWidget.checkStatus();\n discussion.updateHeadline(data);\n })\n .catch(() => new Flash('An error occurred when trying to resolve a discussion. Please try again.'));\n }\n\n resolveAll(mergeRequestId, discussionId) {\n const discussion = CommentsStore.state[discussionId];\n\n discussion.loading = true;\n\n return this.discussionResource.save({\n mergeRequestId,\n discussionId,\n }, {});\n }\n\n unResolveAll(mergeRequestId, discussionId) {\n const discussion = CommentsStore.state[discussionId];\n\n discussion.loading = true;\n\n return this.discussionResource.delete({\n mergeRequestId,\n discussionId,\n }, {});\n }\n}\n\ngl.DiffNotesResolveServiceClass = ResolveServiceClass;\n\n\n\n// WEBPACK FOOTER //\n// ./diff_notes/services/resolve.js","/* eslint-disable object-shorthand, func-names, camelcase, no-restricted-syntax, guard-for-in, comma-dangle, max-len, no-param-reassign */\n/* global DiscussionModel */\n\nimport Vue from 'vue';\n\nwindow.CommentsStore = {\n state: {},\n get: function (discussionId, noteId) {\n return this.state[discussionId].getNote(noteId);\n },\n createDiscussion: function (discussionId, canResolve) {\n let discussion = this.state[discussionId];\n if (!this.state[discussionId]) {\n discussion = new DiscussionModel(discussionId);\n Vue.set(this.state, discussionId, discussion);\n }\n\n if (canResolve !== undefined) {\n discussion.canResolve = canResolve;\n }\n\n return discussion;\n },\n create: function (noteObj) {\n const discussion = this.createDiscussion(noteObj.discussionId);\n\n discussion.createNote(noteObj);\n },\n update: function (discussionId, noteId, resolved, resolved_by) {\n const discussion = this.state[discussionId];\n const note = discussion.getNote(noteId);\n note.resolved = resolved;\n note.resolved_by = resolved_by;\n },\n delete: function (discussionId, noteId) {\n const discussion = this.state[discussionId];\n discussion.deleteNote(noteId);\n\n if (discussion.notesCount() === 0) {\n Vue.delete(this.state, discussionId);\n }\n },\n unresolvedDiscussionIds: function () {\n const ids = [];\n\n for (const discussionId in this.state) {\n const discussion = this.state[discussionId];\n\n if (!discussion.isResolved()) {\n ids.push(discussion.id);\n }\n }\n\n return ids;\n }\n};\n\n\n\n// WEBPACK FOOTER //\n// ./diff_notes/stores/comments.js"],"sourceRoot":""}