!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.VuePreventUnload=n()}(this,function(){"use strict";return{name:"PreventUnload",abstract:!0,render:function(){return null},props:{when:Boolean,message:{type:String,default:"Changes you made may not be saved."}},methods:{handleUnload:function(e){if(this.when)return e.returnValue=this.message,this.message}},mounted:function(){window.addEventListener("beforeunload",this.handleUnload)},beforeDestroy:function(){window.removeEventListener("beforeunload",this.handleUnload)}}});