!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.VueDirectiveImagePreviewer=e():t.VueDirectiveImagePreviewer=e()}(this,function(){return function(t){function e(r){if(n[r])return n[r].exports;var i=n[r]={i:r,l:!1,exports:{}};return t[r].call(i.exports,i,i.exports,e),i.l=!0,i.exports}var n={};return e.m=t,e.c=n,e.i=function(t){return t},e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:r})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/",e(e.s=41)}([function(t,e){var n=t.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)},function(t,e,n){t.exports=!n(8)(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a})},function(t,e){var n={}.hasOwnProperty;t.exports=function(t,e){return n.call(t,e)}},function(t,e,n){var r=n(4),i=n(14);t.exports=n(1)?function(t,e,n){return r.f(t,e,i(1,n))}:function(t,e,n){return t[e]=n,t}},function(t,e,n){var r=n(10),i=n(33),o=n(27),a=Object.defineProperty;e.f=n(1)?Object.defineProperty:function(t,e,n){if(r(t),e=o(e,!0),r(n),i)try{return a(t,e,n)}catch(t){}if("get"in n||"set"in n)throw TypeError("Accessors not supported!");return"value"in n&&(t[e]=n.value),t}},function(t,e,n){var r=n(34),i=n(17);t.exports=function(t){return r(i(t))}},function(t,e,n){var r=n(24)("wks"),i=n(15),o=n(0).Symbol,a="function"==typeof o;(t.exports=function(t){return r[t]||(r[t]=a&&o[t]||(a?o:i)("Symbol."+t))}).store=r},function(t,e){var n=t.exports={version:"2.6.9"};"number"==typeof __e&&(__e=n)},function(t,e){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,e){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,e,n){var r=n(9);t.exports=function(t){if(!r(t))throw TypeError(t+" is not an object!");return t}},function(t,e){t.exports=!0},function(t,e,n){var r=n(38),i=n(18);t.exports=Object.keys||function(t){return r(t,i)}},function(t,e){e.f={}.propertyIsEnumerable},function(t,e){t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},function(t,e){var n=0,r=Math.random();t.exports=function(t){return"Symbol(".concat(void 0===t?"":t,")_",(++n+r).toString(36))}},function(t,e){var n;n=function(){return this}();try{n=n||Function("return this")()||(0,eval)("this")}catch(t){"object"==typeof window&&(n=window)}t.exports=n},function(t,e){t.exports=function(t){if(void 0==t)throw TypeError("Can't call method on "+t);return t}},function(t,e){t.exports="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(",")},function(t,e,n){var r=n(0),i=n(7),o=n(53),a=n(3),u=n(2),c=function(t,e,n){var s,f,l,p=t&c.F,d=t&c.G,v=t&c.S,h=t&c.P,g=t&c.B,y=t&c.W,m=d?i:i[e]||(i[e]={}),_=m.prototype,b=d?r:v?r[e]:(r[e]||{}).prototype;d&&(n=e);for(s in n)(f=!p&&b&&void 0!==b[s])&&u(m,s)||(l=f?b[s]:n[s],m[s]=d&&"function"!=typeof b[s]?n[s]:g&&f?o(l,r):y&&b[s]==l?function(t){var e=function(e,n,r){if(this instanceof t){switch(arguments.length){case 0:return new t;case 1:return new t(e);case 2:return new t(e,n)}return new t(e,n,r)}return t.apply(this,arguments)};return e.prototype=t.prototype,e}(l):h&&"function"==typeof l?o(Function.call,l):l,h&&((m.virtual||(m.virtual={}))[s]=l,t&c.R&&_&&!_[s]&&a(_,s,l)))};c.F=1,c.G=2,c.S=4,c.P=8,c.B=16,c.W=32,c.U=64,c.R=128,t.exports=c},function(t,e){t.exports={}},function(t,e){e.f=Object.getOwnPropertySymbols},function(t,e,n){var r=n(4).f,i=n(2),o=n(6)("toStringTag");t.exports=function(t,e,n){t&&!i(t=n?t:t.prototype,o)&&r(t,o,{configurable:!0,value:e})}},function(t,e,n){var r=n(24)("keys"),i=n(15);t.exports=function(t){return r[t]||(r[t]=i(t))}},function(t,e,n){var r=n(7),i=n(0),o=i["__core-js_shared__"]||(i["__core-js_shared__"]={});(t.exports=function(t,e){return o[t]||(o[t]=void 0!==e?e:{})})("versions",[]).push({version:r.version,mode:n(11)?"pure":"global",copyright:"© 2019 Denis Pushkarev (zloirock.ru)"})},function(t,e){var n=Math.ceil,r=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?r:n)(t)}},function(t,e,n){var r=n(17);t.exports=function(t){return Object(r(t))}},function(t,e,n){var r=n(9);t.exports=function(t,e){if(!r(t))return t;var n,i;if(e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;if("function"==typeof(n=t.valueOf)&&!r(i=n.call(t)))return i;if(!e&&"function"==typeof(n=t.toString)&&!r(i=n.call(t)))return i;throw TypeError("Can't convert object to primitive value")}},function(t,e,n){var r=n(0),i=n(7),o=n(11),a=n(29),u=n(4).f;t.exports=function(t){var e=i.Symbol||(i.Symbol=o?{}:r.Symbol||{});"_"==t.charAt(0)||t in e||u(e,t,{value:a.f(t)})}},function(t,e,n){e.f=n(6)},function(t,e,n){"use strict";var r=n(46),i=n.n(r),o=n(45),a=n.n(o);e.a={name:"vue-directive-image-previewer",props:{zIndex:{type:Number,default:1},src:{type:Array,default:function(){return[]}},background:{type:String||Object,default:"rgba(0, 0, 0, 0.5)"},sourceDom:{},cursor:{type:String,default:"pointer"},animate:{type:Object,default:function(){return{duration:500}}},maxWidth:{type:[String,Number]},maxHeight:{type:[String,Number]},previewSize:{type:[String,Number]}},data:function(){return{isShow:!1,pictureSize:{},imgStyle:{},key:"image-previewer-"+(new Date).valueOf(),status:""}},methods:{init:function(){this.imgStyle.cursor=this.cursor},close:function(){var t=this;this.setPictureBegin(),this.isShow=!1,setTimeout(function(){t.$emit("close")},this.animate.duration+this.animate.delay)},open:function(){this.isShow=!0,this.setPictureSize()},handleTransition:function(t){var e=t.duration,n=t.delay,r=t.func;return(e||0)+"ms "+(n||0)+"ms "+(r||"")},setPictureSize:function(){var t={},e=this.$refs.picture,n=e.naturalWidth/e.naturalHeight;if(n>=window.innerWidth/window.innerHeight){var r=this.maxWidthComputed;t.width=parseInt(r),t.height=parseInt(r/n)}else{var i=this.maxHeightComputed;t.height=parseInt(i),t.width=parseInt(i*n)}t.top=(window.innerHeight-parseInt(t.height))/2,t.left=(window.innerWidth-parseInt(t.width))/2,this.pictureSize=t},setPictureBegin:function(){var t=this.sourceDom.getBoundingClientRect(),e=t.width,n=t.height,r=t.top,i=t.left;this.pictureSize={width:e,height:n,top:r,left:i}}},computed:{bgStyle:function(){var t="string"==typeof this.background?{backgroundColor:this.background}:a()({backgroundColor:"rgba(0, 0, 0, 0.5)"},this.background);return t.transition=this.handleTransition(this.animate),a()({opacity:this.isShow?"1":"0"},t)},maxWidthComputed:function(){var t=window.innerWidth,e="";switch(i()(this.maxWidth)){case"number":e=this.maxWidth;break;case"string":e=/\d+%$/.test(this.maxWidth)?parseFloat(this.maxWidth)/100*t:parseFloat(this.maxWidth);break;default:e=.8*t}return void 0!==this.previewSize&&(e=Math.min(e,this.previewSize*this.pictureSize.width)),e},maxHeightComputed:function(){var t=window.innerHeight,e="";switch(i()(this.maxHeight)){case"number":e=this.maxHeight;break;case"string":e=/\d+%$/.test(this.maxHeight)?parseFloat(this.maxHeight)/100*t:parseFloat(this.maxHeight);break;default:e=.8*t}return void 0!==this.previewSize&&(e=Math.min(e,this.previewSize*this.pictureSize.height)),e}},watch:{pictureSize:{deep:!0,handler:function(t){var e=this;["top","left","width","height"].forEach(function(n){e.$set(e.imgStyle,n,t[n]+"px")}),this.$set(this.imgStyle,"transition",this.handleTransition(this.animate)),this.$set(this.imgStyle,"cursor",this.cursor)}},cursor:function(t){this.imgStyle.cursor=t}},created:function(){this.init()},mounted:function(){var t=this;window.addEventListener("resize",function(){t.setPictureSize()})}}},function(t,e){var n={}.toString;t.exports=function(t){return n.call(t).slice(8,-1)}},function(t,e,n){var r=n(9),i=n(0).document,o=r(i)&&r(i.createElement);t.exports=function(t){return o?i.createElement(t):{}}},function(t,e,n){t.exports=!n(1)&&!n(8)(function(){return 7!=Object.defineProperty(n(32)("div"),"a",{get:function(){return 7}}).a})},function(t,e,n){var r=n(31);t.exports=Object("z").propertyIsEnumerable(0)?Object:function(t){return"String"==r(t)?t.split(""):Object(t)}},function(t,e,n){"use strict";var r=n(11),i=n(19),o=n(39),a=n(3),u=n(20),c=n(57),s=n(22),f=n(64),l=n(6)("iterator"),p=!([].keys&&"next"in[].keys()),d=function(){return this};t.exports=function(t,e,n,v,h,g,y){c(n,e,v);var m,_,b,w=function(t){if(!p&&t in k)return k[t];switch(t){case"keys":case"values":return function(){return new n(this,t)}}return function(){return new n(this,t)}},x=e+" Iterator",$="values"==h,S=!1,k=t.prototype,O=k[l]||k["@@iterator"]||h&&k[h],A=O||w(h),C=h?$?w("entries"):A:void 0,j="Array"==e?k.entries||O:O;if(j&&(b=f(j.call(new t)))!==Object.prototype&&b.next&&(s(b,x,!0),r||"function"==typeof b[l]||a(b,l,d)),$&&O&&"values"!==O.name&&(S=!0,A=function(){return O.call(this)}),r&&!y||!p&&!S&&k[l]||a(k,l,A),u[e]=A,u[x]=d,h)if(m={values:$?A:w("values"),keys:g?A:w("keys"),entries:C},y)for(_ in m)_ in k||o(k,_,m[_]);else i(i.P+i.F*(p||S),e,m);return m}},function(t,e,n){var r=n(10),i=n(61),o=n(18),a=n(23)("IE_PROTO"),u=function(){},c=function(){var t,e=n(32)("iframe"),r=o.length;for(e.style.display="none",n(55).appendChild(e),e.src="javascript:",t=e.contentWindow.document,t.open(),t.write("