"use strict";define(["app","handlebars","View","text!/v2/components/Confirmation/Templates/ConfirmationTemplate.html","text!/v2/components/Confirmation/Templates/ConfirmationTemplate2.html","utils"],function(d,g,f,c,b,a){var e=f.extend({id:"confirmation",overlay:null,callback:null,confirmationTemplate:null,events:{"click #yes,#no,#cancel,.close":"yesNo"},yesNo:function(j){this.overlay.close();if(this.callback){var h=$(j.target).data("value");var i=this.$el.find("#cancel").css("display")!=="none";this.callback.apply(this,[i?h:h===1]);}},initialize:function(h){f.prototype.initialize.apply(this,arguments);this.options=h||{};this.overlay=this.options.parent;},render:function(h,i){f.prototype.render.apply(this,arguments);this.setParent(h.parent);this.callback=i;this.confirmationTemplate=(d.instance().FrontendFramework()==="semantic")?g.compile(b):g.compile(c);this.$el.html(this.confirmationTemplate({}));if(h.header!==null){this.$el.find(".header-title").html(h.header);}if(h.message!==null){this.$el.find(".modal-body").html(h.message);}if(h.yes!==null){this.$el.find("#yes").html(h.yes);}if(h.no!==null){this.$el.find("#no").html(h.no);}if(h.cancel!==null&&h.cancel!==undefined){this.$el.find("#cancel").css("display","inline-block");this.$el.find("#cancel").html(h.cancel);}this.overlay.render().$el.find("#overlay").html(this.$el);h.parent.$el.append(this.overlay.$el);this.delegateEvents();return this;}});return e;});