text: (this.webpackJsonp=this.webpackJsonp||[]).push([[68],{1037:function(e,t,n){n(42),n(110),e.exports=n(1038)},1038:function(e,t,n){"use strict";n.r(t);var s=n(477),o=n(301),i=n(341);document.addEventListener("DOMContentLoaded",function(){Object(s.a)(),Object(o.a)(),i.a.initDeprecationMessage()})},110:function(e,t,n){"use strict";n.r(t);var s=n(36),o=n(38);document.addEventListener("DOMContentLoaded",function(){var e,t=document.body.dataset.page;["groups:clusters:new","groups:clusters:create_gcp","groups:clusters:create_user"].indexOf(t)>-1&&((e=document.querySelector(".gcp-signup-offer"))&&new s.a(e),Object(o.a)())})},128:function(e,t,n){"use strict";function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}var o={name:"DeprecatedModal",props:{id:{type:String,required:!1},title:{type:String,required:!1},text:{type:String,required:!1},hideFooter:{type:Boolean,required:!1,default:!1},kind:{type:String,required:!1,default:"primary"},modalDialogClass:{type:String,required:!1,default:""},closeKind:{type:String,required:!1,default:"default"},closeButtonLabel:{type:String,required:!1,default:"Cancel"},primaryButtonLabel:{type:String,required:!1,default:""},secondaryButtonLabel:{type:String,required:!1,default:""},submitDisabled:{type:Boolean,required:!1,default:!1}},computed:{btnKindClass:function(){return s({},"btn-".concat(this.kind),!0)},btnCancelKindClass:function(){return s({},"btn-".concat(this.closeKind),!0)}},methods:{emitCancel:function(e){this.$emit("cancel",e)},emitSubmit:function(e){this.$emit("submit",e)}}},i=n(3),l=Object(i.a)(o,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("div",{staticClass:"modal-open"},[n("div",{staticClass:"modal",class:e.id?"":"d-block",attrs:{id:e.id,role:"dialog",tabindex:"-1"}},[n("div",{staticClass:"modal-dialog",class:e.modalDialogClass,attrs:{role:"document"}},[n("div",{staticClass:"modal-content"},[n("div",{staticClass:"modal-header"},[e._t("header",[n("h4",{staticClass:"modal-title float-left"},[e._v(e._s(e.title))]),e._v(" "),n("button",{staticClass:"close float-right",attrs:{type:"button","data-dismiss":"modal","aria-label":"Close"},on:{click:function(t){e.emitCancel(t)}}},[n("span",{attrs:{"aria-hidden":"true"}},[e._v("×")])])])],2),e._v(" "),n("div",{staticClass:"modal-body"},[e._t("body",[n("p",[e._v(e._s(e.text))])],{text:e.text})],2),e._v(" "),e.hideFooter?e._e():n("div",{staticClass:"modal-footer"},[n("button",{staticClass:"btn",class:e.btnCancelKindClass,attrs:{type:"button","data-dismiss":"modal"},on:{click:function(t){e.emitCancel(t)}}},[e._v("\n            "+e._s(e.closeButtonLabel)+"\n          ")]),e._v(" "),e.secondaryButtonLabel?e._t("secondary-button",[e.secondaryButtonLabel?n("button",{staticClass:"btn",attrs:{type:"button","data-dismiss":"modal"}},[e._v("\n              "+e._s(e.secondaryButtonLabel)+"\n            ")]):e._e()]):e._e(),e._v(" "),e.primaryButtonLabel?n("button",{staticClass:"btn js-primary-button",class:e.btnKindClass,attrs:{disabled:e.submitDisabled,type:"button","data-dismiss":"modal"},on:{click:function(t){e.emitSubmit(t)}}},[e._v("\n            "+e._s(e.primaryButtonLabel)+"\n          ")]):e._e()],2)])])]),e._v(" "),e.id?e._e():n("div",{staticClass:"modal-backdrop fade show"})])},[],!1,null,null,null);l.options.__file="deprecated_modal.vue";t.a=l.exports},301:function(e,t,n){"use strict";var s=n(11),o=n(78),i=n(6),l=n(7),a=n(128),r=n(1),d=n(19),u=n(68),c={components:{DeprecatedModal:a.a},props:{issueCount:{type:Number,required:!0},mergeRequestCount:{type:Number,required:!0},milestoneId:{type:Number,required:!0},milestoneTitle:{type:String,required:!0},milestoneUrl:{type:String,required:!0}},computed:{text:function(){var e=Object(r.f)("<strong>%{milestoneTitle}</strong>",{milestoneTitle:this.milestoneTitle});return 0===this.issueCount&&0===this.mergeRequestCount?Object(r.f)(Object(r.e)("Milestones|\nYou’re about to permanently delete the milestone %{milestoneTitle}.\nThis milestone is not currently used in any issues or merge requests."),{milestoneTitle:e},!1):Object(r.f)(Object(r.e)("Milestones|\nYou’re about to permanently delete the milestone %{milestoneTitle} and remove it from %{issuesWithCount} and %{mergeRequestsWithCount}.\nOnce deleted, it cannot be undone or recovered."),{milestoneTitle:e,issuesWithCount:Object(r.d)("%d issue","%d issues",this.issueCount),mergeRequestsWithCount:Object(r.d)("%d merge request","%d merge requests",this.mergeRequestCount)},!1)},title:function(){return Object(r.f)(Object(r.e)("Milestones|Delete milestone %{milestoneTitle}?"),{milestoneTitle:this.milestoneTitle})}},methods:{onSubmit:function(){var e=this;return u.a.$emit("deleteMilestoneModal.requestStarted",this.milestoneUrl),i.a.delete(this.milestoneUrl).then(function(t){u.a.$emit("deleteMilestoneModal.requestFinished",{milestoneUrl:e.milestoneUrl,successful:!0}),Object(d.d)(t.request.responseURL)}).catch(function(t){throw u.a.$emit("deleteMilestoneModal.requestFinished",{milestoneUrl:e.milestoneUrl,successful:!1}),t.response&&404===t.response.status?Object(l.a)(Object(r.f)(Object(r.e)("Milestones|Milestone %{milestoneTitle} was not found"),{milestoneTitle:e.milestoneTitle})):Object(l.a)(Object(r.f)(Object(r.e)("Milestones|Failed to delete milestone %{milestoneTitle}"),{milestoneTitle:e.milestoneTitle})),t})}}},m=n(3),b=Object(m.a)(c,function(){var e=this,t=e.$createElement,n=e._self._c||t;return n("deprecated-modal",{attrs:{id:"delete-milestone-modal",title:e.title,text:e.text,"primary-button-label":e.s__("Milestones|Delete milestone"),kind:"danger"},on:{submit:e.onSubmit},scopedSlots:e._u([{key:"body",fn:function(t){return[n("p",{domProps:{innerHTML:e._s(t.text)}})]}}])})},[],!1,null,null,null);b.options.__file="delete_milestone_modal.vue";var p=b.exports;t.a=function(){s.default.use(o.a);var e=function(e){var t=e.milestoneUrl,n=e.successful,s=document.querySelector('.js-delete-milestone-button[data-milestone-url="'.concat(t,'"]'));n||s.removeAttribute("disabled"),s.querySelector(".js-loading-icon").classList.add("hidden")},t=function(t){var n=document.querySelector('.js-delete-milestone-button[data-milestone-url="'.concat(t,'"]'));n.setAttribute("disabled",""),n.querySelector(".js-loading-icon").classList.remove("hidden"),u.a.$once("deleteMilestoneModal.requestFinished",e)},n=function(e){var n=e.currentTarget,s={milestoneId:parseInt(n.dataset.milestoneId,10),milestoneTitle:n.dataset.milestoneTitle,milestoneUrl:n.dataset.milestoneUrl,issueCount:parseInt(n.dataset.milestoneIssueCount,10),mergeRequestCount:parseInt(n.dataset.milestoneMergeRequestCount,10)};u.a.$once("deleteMilestoneModal.requestStarted",t),u.a.$emit("deleteMilestoneModal.props",s)},i=document.querySelectorAll(".js-delete-milestone-button");return i.forEach(function(e){e.addEventListener("click",n)}),u.a.$once("deleteMilestoneModal.mounted",function(){i.forEach(function(e){e.removeAttribute("disabled")})}),new s.default({el:"#delete-milestone-modal",components:{deleteMilestoneModal:p},data:function(){return{modalProps:{milestoneId:-1,milestoneTitle:"",milestoneUrl:"",issueCount:-1,mergeRequestCount:-1}}},mounted:function(){u.a.$on("deleteMilestoneModal.props",this.setModalProps),u.a.$emit("deleteMilestoneModal.mounted")},beforeDestroy:function(){u.a.$off("deleteMilestoneModal.props",this.setModalProps)},methods:{setModalProps:function(e){this.modalProps=e}},render:function(e){return e(p,{props:this.modalProps})}})}},477:function(e,t,n){"use strict";var s=n(341),o=n(159),i=n(416);t.a=function(){new s.a,new o.a,new i.a}},68:function(e,t,n){"use strict";var s=n(11);t.a=new s.default}},[[1037,1,0,2,14]]]);
  //# sourceMappingURL=pages.groups.milestones.show.6dcbe2ef.chunk.js.map