{"version":3,"file":"vendors-d7bc387f.cbeb19fd4566a354b1ce.bundle.js","mappings":";;;;;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AAAA;AAAA;AAAA;AAAA;AACA;AAOA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;;;;;;ACnmDA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;;ACPA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACpFA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;;;;;;;ACzBA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA","sources":["webpack://SpotOnDays.WebClient/./node_modules/croppie/croppie.js","webpack://SpotOnDays.WebClient/./node_modules/croppie/croppie.css","webpack://SpotOnDays.WebClient/./node_modules/css-loader/dist/runtime/api.js","webpack://SpotOnDays.WebClient/./node_modules/css-loader/dist/runtime/getUrl.js","webpack://SpotOnDays.WebClient/./node_modules/css-loader/dist/runtime/sourceMaps.js"],"sourcesContent":["/*************************\r\n * Croppie\r\n * Copyright 2019\r\n * Foliotek\r\n * Version: 2.6.5\r\n *************************/\r\n(function (root, factory) {\r\n if (typeof define === 'function' && define.amd) {\r\n // AMD. Register as an anonymous module.\r\n define(factory);\r\n } else if (typeof exports === 'object' && typeof exports.nodeName !== 'string') {\r\n // CommonJS\r\n module.exports = factory();\r\n } else {\r\n // Browser globals\r\n root.Croppie = factory();\r\n }\r\n}(typeof self !== 'undefined' ? self : this, function () {\r\n\r\n /* Polyfills */\r\n if (typeof Promise !== 'function') {\r\n /*! promise-polyfill 3.1.0 */\r\n !function(a){function b(a,b){return function(){a.apply(b,arguments)}}function c(a){if(\"object\"!==typeof this)throw new TypeError(\"Promises must be constructed via new\");if(\"function\"!==typeof a)throw new TypeError(\"not a function\");this._state=null,this._value=null,this._deferreds=[],i(a,b(e,this),b(f,this))}function d(a){var b=this;return null===this._state?void this._deferreds.push(a):void k(function(){var c=b._state?a.onFulfilled:a.onRejected;if(null===c)return void(b._state?a.resolve:a.reject)(b._value);var d;try{d=c(b._value)}catch(e){return void a.reject(e)}a.resolve(d)})}function e(a){try{if(a===this)throw new TypeError(\"A promise cannot be resolved with itself.\");if(a&&(\"object\"===typeof a||\"function\"===typeof a)){var c=a.then;if(\"function\"===typeof c)return void i(b(c,a),b(e,this),b(f,this))}this._state=!0,this._value=a,g.call(this)}catch(d){f.call(this,d)}}function f(a){this._state=!1,this._value=a,g.call(this)}function g(){for(var a=0,b=this._deferreds.length;b>a;a++)d.call(this,this._deferreds[a]);this._deferreds=null}function h(a,b,c,d){this.onFulfilled=\"function\"===typeof a?a:null,this.onRejected=\"function\"===typeof b?b:null,this.resolve=c,this.reject=d}function i(a,b,c){var d=!1;try{a(function(a){d||(d=!0,b(a))},function(a){d||(d=!0,c(a))})}catch(e){if(d)return;d=!0,c(e)}}var j=setTimeout,k=\"function\"===typeof setImmediate&&setImmediate||function(a){j(a,1)},l=Array.isArray||function(a){return\"[object Array]\"===Object.prototype.toString.call(a)};c.prototype[\"catch\"]=function(a){return this.then(null,a)},c.prototype.then=function(a,b){var e=this;return new c(function(c,f){d.call(e,new h(a,b,c,f))})},c.all=function(){var a=Array.prototype.slice.call(1===arguments.length&&l(arguments[0])?arguments[0]:arguments);return new c(function(b,c){function d(f,g){try{if(g&&(\"object\"===typeof g||\"function\"===typeof g)){var h=g.then;if(\"function\"===typeof h)return void h.call(g,function(a){d(f,a)},c)}a[f]=g,0===--e&&b(a)}catch(i){c(i)}}if(0===a.length)return b([]);for(var e=a.length,f=0;fd;d++)a[d].then(b,c)})},c._setImmediateFn=function(a){k=a},\"undefined\"!==typeof module&&module.exports?module.exports=c:a.Promise||(a.Promise=c)}(this);\r\n }\r\n\r\n if (typeof window !== 'undefined' && typeof window.CustomEvent !== \"function\") {\r\n (function(){\r\n function CustomEvent ( event, params ) {\r\n params = params || { bubbles: false, cancelable: false, detail: undefined };\r\n var evt = document.createEvent( 'CustomEvent' );\r\n evt.initCustomEvent( event, params.bubbles, params.cancelable, params.detail );\r\n return evt;\r\n }\r\n CustomEvent.prototype = window.Event.prototype;\r\n window.CustomEvent = CustomEvent;\r\n }());\r\n }\r\n\r\n if (typeof HTMLCanvasElement !== 'undefined' && !HTMLCanvasElement.prototype.toBlob) {\r\n Object.defineProperty(HTMLCanvasElement.prototype, 'toBlob', {\r\n value: function (callback, type, quality) {\r\n var binStr = atob( this.toDataURL(type, quality).split(',')[1] ),\r\n len = binStr.length,\r\n arr = new Uint8Array(len);\r\n\r\n for (var i=0; i -1 ? EXIF_NORM : EXIF_FLIP,\r\n index = arr.indexOf(ornt),\r\n offset = (rotate / 90) % arr.length;// 180 = 2%4 = 2 shift exif by 2 indexes\r\n\r\n return arr[(arr.length + index + (offset % arr.length)) % arr.length];\r\n }\r\n\r\n // Credits to : Andrew Dupont - http://andrewdupont.net/2009/08/28/deep-extending-objects-in-javascript/\r\n function deepExtend(destination, source) {\r\n destination = destination || {};\r\n for (var property in source) {\r\n if (source[property] && source[property].constructor && source[property].constructor === Object) {\r\n destination[property] = destination[property] || {};\r\n deepExtend(destination[property], source[property]);\r\n } else {\r\n destination[property] = source[property];\r\n }\r\n }\r\n return destination;\r\n }\r\n\r\n function clone(object) {\r\n return deepExtend({}, object);\r\n }\r\n\r\n function debounce(func, wait, immediate) {\r\n var timeout;\r\n return function () {\r\n var context = this, args = arguments;\r\n var later = function () {\r\n timeout = null;\r\n if (!immediate) func.apply(context, args);\r\n };\r\n var callNow = immediate && !timeout;\r\n clearTimeout(timeout);\r\n timeout = setTimeout(later, wait);\r\n if (callNow) func.apply(context, args);\r\n };\r\n }\r\n\r\n function dispatchChange(element) {\r\n if (\"createEvent\" in document) {\r\n var evt = document.createEvent(\"HTMLEvents\");\r\n evt.initEvent(\"change\", false, true);\r\n element.dispatchEvent(evt);\r\n }\r\n else {\r\n element.fireEvent(\"onchange\");\r\n }\r\n }\r\n\r\n //http://jsperf.com/vanilla-css\r\n function css(el, styles, val) {\r\n if (typeof (styles) === 'string') {\r\n var tmp = styles;\r\n styles = {};\r\n styles[tmp] = val;\r\n }\r\n\r\n for (var prop in styles) {\r\n el.style[prop] = styles[prop];\r\n }\r\n }\r\n\r\n function addClass(el, c) {\r\n if (el.classList) {\r\n el.classList.add(c);\r\n }\r\n else {\r\n el.className += ' ' + c;\r\n }\r\n }\r\n\r\n function removeClass(el, c) {\r\n if (el.classList) {\r\n el.classList.remove(c);\r\n }\r\n else {\r\n el.className = el.className.replace(c, '');\r\n }\r\n }\r\n\r\n function setAttributes(el, attrs) {\r\n for (var key in attrs) {\r\n el.setAttribute(key, attrs[key]);\r\n }\r\n }\r\n\r\n function num(v) {\r\n return parseInt(v, 10);\r\n }\r\n\r\n /* Utilities */\r\n function loadImage(src, doExif) {\r\n if (!src) { throw 'Source image missing'; }\r\n \r\n var img = new Image();\r\n img.style.opacity = '0';\r\n return new Promise(function (resolve, reject) {\r\n function _resolve() {\r\n img.style.opacity = '1';\r\n setTimeout(function () {\r\n resolve(img);\r\n }, 1);\r\n }\r\n\r\n img.removeAttribute('crossOrigin');\r\n if (src.match(/^https?:\\/\\/|^\\/\\//)) {\r\n img.setAttribute('crossOrigin', 'anonymous');\r\n }\r\n\r\n img.onload = function () {\r\n if (doExif) {\r\n EXIF.getData(img, function () {\r\n _resolve();\r\n });\r\n }\r\n else {\r\n _resolve();\r\n }\r\n };\r\n img.onerror = function (ev) {\r\n img.style.opacity = 1;\r\n setTimeout(function () {\r\n reject(ev);\r\n }, 1);\r\n };\r\n img.src = src;\r\n });\r\n }\r\n\r\n function naturalImageDimensions(img, ornt) {\r\n var w = img.naturalWidth;\r\n var h = img.naturalHeight;\r\n var orient = ornt || getExifOrientation(img);\r\n if (orient && orient >= 5) {\r\n var x= w;\r\n w = h;\r\n h = x;\r\n }\r\n return { width: w, height: h };\r\n }\r\n\r\n /* CSS Transform Prototype */\r\n var TRANSLATE_OPTS = {\r\n 'translate3d': {\r\n suffix: ', 0px'\r\n },\r\n 'translate': {\r\n suffix: ''\r\n }\r\n };\r\n var Transform = function (x, y, scale) {\r\n this.x = parseFloat(x);\r\n this.y = parseFloat(y);\r\n this.scale = parseFloat(scale);\r\n };\r\n\r\n Transform.parse = function (v) {\r\n if (v.style) {\r\n return Transform.parse(v.style[CSS_TRANSFORM]);\r\n }\r\n else if (v.indexOf('matrix') > -1 || v.indexOf('none') > -1) {\r\n return Transform.fromMatrix(v);\r\n }\r\n else {\r\n return Transform.fromString(v);\r\n }\r\n };\r\n\r\n Transform.fromMatrix = function (v) {\r\n var vals = v.substring(7).split(',');\r\n if (!vals.length || v === 'none') {\r\n vals = [1, 0, 0, 1, 0, 0];\r\n }\r\n\r\n return new Transform(num(vals[4]), num(vals[5]), parseFloat(vals[0]));\r\n };\r\n\r\n Transform.fromString = function (v) {\r\n var values = v.split(') '),\r\n translate = values[0].substring(Croppie.globals.translate.length + 1).split(','),\r\n scale = values.length > 1 ? values[1].substring(6) : 1,\r\n x = translate.length > 1 ? translate[0] : 0,\r\n y = translate.length > 1 ? translate[1] : 0;\r\n\r\n return new Transform(x, y, scale);\r\n };\r\n\r\n Transform.prototype.toString = function () {\r\n var suffix = TRANSLATE_OPTS[Croppie.globals.translate].suffix || '';\r\n return Croppie.globals.translate + '(' + this.x + 'px, ' + this.y + 'px' + suffix + ') scale(' + this.scale + ')';\r\n };\r\n\r\n var TransformOrigin = function (el) {\r\n if (!el || !el.style[CSS_TRANS_ORG]) {\r\n this.x = 0;\r\n this.y = 0;\r\n return;\r\n }\r\n var css = el.style[CSS_TRANS_ORG].split(' ');\r\n this.x = parseFloat(css[0]);\r\n this.y = parseFloat(css[1]);\r\n };\r\n\r\n TransformOrigin.prototype.toString = function () {\r\n return this.x + 'px ' + this.y + 'px';\r\n };\r\n\r\n function getExifOrientation (img) {\r\n return img.exifdata && img.exifdata.Orientation ? num(img.exifdata.Orientation) : 1;\r\n }\r\n\r\n function drawCanvas(canvas, img, orientation) {\r\n var width = img.width,\r\n height = img.height,\r\n ctx = canvas.getContext('2d');\r\n\r\n canvas.width = img.width;\r\n canvas.height = img.height;\r\n\r\n ctx.save();\r\n switch (orientation) {\r\n case 2:\r\n ctx.translate(width, 0);\r\n ctx.scale(-1, 1);\r\n break;\r\n\r\n case 3:\r\n ctx.translate(width, height);\r\n ctx.rotate(180*Math.PI/180);\r\n break;\r\n\r\n case 4:\r\n ctx.translate(0, height);\r\n ctx.scale(1, -1);\r\n break;\r\n\r\n case 5:\r\n canvas.width = height;\r\n canvas.height = width;\r\n ctx.rotate(90*Math.PI/180);\r\n ctx.scale(1, -1);\r\n break;\r\n\r\n case 6:\r\n canvas.width = height;\r\n canvas.height = width;\r\n ctx.rotate(90*Math.PI/180);\r\n ctx.translate(0, -height);\r\n break;\r\n\r\n case 7:\r\n canvas.width = height;\r\n canvas.height = width;\r\n ctx.rotate(-90*Math.PI/180);\r\n ctx.translate(-width, height);\r\n ctx.scale(1, -1);\r\n break;\r\n\r\n case 8:\r\n canvas.width = height;\r\n canvas.height = width;\r\n ctx.translate(0, width);\r\n ctx.rotate(-90*Math.PI/180);\r\n break;\r\n }\r\n ctx.drawImage(img, 0,0, width, height);\r\n ctx.restore();\r\n }\r\n\r\n /* Private Methods */\r\n function _create() {\r\n var self = this,\r\n contClass = 'croppie-container',\r\n customViewportClass = self.options.viewport.type ? 'cr-vp-' + self.options.viewport.type : null,\r\n boundary, img, viewport, overlay, bw, bh;\r\n\r\n self.options.useCanvas = self.options.enableOrientation || _hasExif.call(self);\r\n // Properties on class\r\n self.data = {};\r\n self.elements = {};\r\n\r\n boundary = self.elements.boundary = document.createElement('div');\r\n viewport = self.elements.viewport = document.createElement('div');\r\n img = self.elements.img = document.createElement('img');\r\n overlay = self.elements.overlay = document.createElement('div');\r\n\r\n if (self.options.useCanvas) {\r\n self.elements.canvas = document.createElement('canvas');\r\n self.elements.preview = self.elements.canvas;\r\n }\r\n else {\r\n self.elements.preview = img;\r\n }\r\n\r\n addClass(boundary, 'cr-boundary');\r\n boundary.setAttribute('aria-dropeffect', 'none');\r\n bw = self.options.boundary.width;\r\n bh = self.options.boundary.height;\r\n css(boundary, {\r\n width: (bw + (isNaN(bw) ? '' : 'px')),\r\n height: (bh + (isNaN(bh) ? '' : 'px'))\r\n });\r\n\r\n addClass(viewport, 'cr-viewport');\r\n if (customViewportClass) {\r\n addClass(viewport, customViewportClass);\r\n }\r\n css(viewport, {\r\n width: self.options.viewport.width + 'px',\r\n height: self.options.viewport.height + 'px'\r\n });\r\n viewport.setAttribute('tabindex', 0);\r\n\r\n addClass(self.elements.preview, 'cr-image');\r\n setAttributes(self.elements.preview, { 'alt': 'preview', 'aria-grabbed': 'false' });\r\n addClass(overlay, 'cr-overlay');\r\n\r\n self.element.appendChild(boundary);\r\n boundary.appendChild(self.elements.preview);\r\n boundary.appendChild(viewport);\r\n boundary.appendChild(overlay);\r\n\r\n addClass(self.element, contClass);\r\n if (self.options.customClass) {\r\n addClass(self.element, self.options.customClass);\r\n }\r\n\r\n _initDraggable.call(this);\r\n\r\n if (self.options.enableZoom) {\r\n _initializeZoom.call(self);\r\n }\r\n\r\n // if (self.options.enableOrientation) {\r\n // _initRotationControls.call(self);\r\n // }\r\n\r\n if (self.options.enableResize) {\r\n _initializeResize.call(self);\r\n }\r\n }\r\n\r\n // function _initRotationControls () {\r\n // var self = this,\r\n // wrap, btnLeft, btnRight, iLeft, iRight;\r\n\r\n // wrap = document.createElement('div');\r\n // self.elements.orientationBtnLeft = btnLeft = document.createElement('button');\r\n // self.elements.orientationBtnRight = btnRight = document.createElement('button');\r\n\r\n // wrap.appendChild(btnLeft);\r\n // wrap.appendChild(btnRight);\r\n\r\n // iLeft = document.createElement('i');\r\n // iRight = document.createElement('i');\r\n // btnLeft.appendChild(iLeft);\r\n // btnRight.appendChild(iRight);\r\n\r\n // addClass(wrap, 'cr-rotate-controls');\r\n // addClass(btnLeft, 'cr-rotate-l');\r\n // addClass(btnRight, 'cr-rotate-r');\r\n\r\n // self.elements.boundary.appendChild(wrap);\r\n\r\n // btnLeft.addEventListener('click', function () {\r\n // self.rotate(-90);\r\n // });\r\n // btnRight.addEventListener('click', function () {\r\n // self.rotate(90);\r\n // });\r\n // }\r\n\r\n function _hasExif() {\r\n return this.options.enableExif && window.EXIF;\r\n }\r\n\r\n function _initializeResize () {\r\n var self = this;\r\n var wrap = document.createElement('div');\r\n var isDragging = false;\r\n var direction;\r\n var originalX;\r\n var originalY;\r\n var minSize = 50;\r\n var maxWidth;\r\n var maxHeight;\r\n var vr;\r\n var hr;\r\n\r\n addClass(wrap, 'cr-resizer');\r\n css(wrap, {\r\n width: this.options.viewport.width + 'px',\r\n height: this.options.viewport.height + 'px'\r\n });\r\n\r\n if (this.options.resizeControls.height) {\r\n vr = document.createElement('div');\r\n addClass(vr, 'cr-resizer-vertical');\r\n wrap.appendChild(vr);\r\n }\r\n\r\n if (this.options.resizeControls.width) {\r\n hr = document.createElement('div');\r\n addClass(hr, 'cr-resizer-horisontal');\r\n wrap.appendChild(hr);\r\n }\r\n\r\n function mouseDown(ev) {\r\n if (ev.button !== undefined && ev.button !== 0) return;\r\n\r\n ev.preventDefault();\r\n if (isDragging) {\r\n return;\r\n }\r\n\r\n var overlayRect = self.elements.overlay.getBoundingClientRect();\r\n\r\n isDragging = true;\r\n originalX = ev.pageX;\r\n originalY = ev.pageY;\r\n direction = ev.currentTarget.className.indexOf('vertical') !== -1 ? 'v' : 'h';\r\n maxWidth = overlayRect.width;\r\n maxHeight = overlayRect.height;\r\n\r\n if (ev.touches) {\r\n var touches = ev.touches[0];\r\n originalX = touches.pageX;\r\n originalY = touches.pageY;\r\n }\r\n\r\n window.addEventListener('mousemove', mouseMove);\r\n window.addEventListener('touchmove', mouseMove);\r\n window.addEventListener('mouseup', mouseUp);\r\n window.addEventListener('touchend', mouseUp);\r\n document.body.style[CSS_USERSELECT] = 'none';\r\n }\r\n\r\n function mouseMove(ev) {\r\n var pageX = ev.pageX;\r\n var pageY = ev.pageY;\r\n\r\n ev.preventDefault();\r\n\r\n if (ev.touches) {\r\n var touches = ev.touches[0];\r\n pageX = touches.pageX;\r\n pageY = touches.pageY;\r\n }\r\n\r\n var deltaX = pageX - originalX;\r\n var deltaY = pageY - originalY;\r\n var newHeight = self.options.viewport.height + deltaY;\r\n var newWidth = self.options.viewport.width + deltaX;\r\n\r\n if (direction === 'v' && newHeight >= minSize && newHeight <= maxHeight) {\r\n css(wrap, {\r\n height: newHeight + 'px'\r\n });\r\n\r\n self.options.boundary.height += deltaY;\r\n css(self.elements.boundary, {\r\n height: self.options.boundary.height + 'px'\r\n });\r\n\r\n self.options.viewport.height += deltaY;\r\n css(self.elements.viewport, {\r\n height: self.options.viewport.height + 'px'\r\n });\r\n }\r\n else if (direction === 'h' && newWidth >= minSize && newWidth <= maxWidth) {\r\n css(wrap, {\r\n width: newWidth + 'px'\r\n });\r\n\r\n self.options.boundary.width += deltaX;\r\n css(self.elements.boundary, {\r\n width: self.options.boundary.width + 'px'\r\n });\r\n\r\n self.options.viewport.width += deltaX;\r\n css(self.elements.viewport, {\r\n width: self.options.viewport.width + 'px'\r\n });\r\n }\r\n\r\n _updateOverlay.call(self);\r\n _updateZoomLimits.call(self);\r\n _updateCenterPoint.call(self);\r\n _triggerUpdate.call(self);\r\n originalY = pageY;\r\n originalX = pageX;\r\n }\r\n\r\n function mouseUp() {\r\n isDragging = false;\r\n window.removeEventListener('mousemove', mouseMove);\r\n window.removeEventListener('touchmove', mouseMove);\r\n window.removeEventListener('mouseup', mouseUp);\r\n window.removeEventListener('touchend', mouseUp);\r\n document.body.style[CSS_USERSELECT] = '';\r\n }\r\n\r\n if (vr) {\r\n vr.addEventListener('mousedown', mouseDown);\r\n vr.addEventListener('touchstart', mouseDown);\r\n }\r\n\r\n if (hr) {\r\n hr.addEventListener('mousedown', mouseDown);\r\n hr.addEventListener('touchstart', mouseDown);\r\n }\r\n\r\n this.elements.boundary.appendChild(wrap);\r\n }\r\n\r\n function _setZoomerVal(v) {\r\n if (this.options.enableZoom) {\r\n var z = this.elements.zoomer,\r\n val = fix(v, 4);\r\n\r\n z.value = Math.max(parseFloat(z.min), Math.min(parseFloat(z.max), val)).toString();\r\n }\r\n }\r\n\r\n function _initializeZoom() {\r\n var self = this,\r\n wrap = self.elements.zoomerWrap = document.createElement('div'),\r\n zoomer = self.elements.zoomer = document.createElement('input');\r\n\r\n addClass(wrap, 'cr-slider-wrap');\r\n addClass(zoomer, 'cr-slider');\r\n zoomer.type = 'range';\r\n zoomer.step = '0.0001';\r\n zoomer.value = '1';\r\n zoomer.style.display = self.options.showZoomer ? '' : 'none';\r\n zoomer.setAttribute('aria-label', 'zoom');\r\n\r\n self.element.appendChild(wrap);\r\n wrap.appendChild(zoomer);\r\n\r\n self._currentZoom = 1;\r\n\r\n function change() {\r\n _onZoom.call(self, {\r\n value: parseFloat(zoomer.value),\r\n origin: new TransformOrigin(self.elements.preview),\r\n viewportRect: self.elements.viewport.getBoundingClientRect(),\r\n transform: Transform.parse(self.elements.preview)\r\n });\r\n }\r\n\r\n function scroll(ev) {\r\n var delta, targetZoom;\r\n\r\n if(self.options.mouseWheelZoom === 'ctrl' && ev.ctrlKey !== true){\r\n return 0;\r\n } else if (ev.wheelDelta) {\r\n delta = ev.wheelDelta / 1200; //wheelDelta min: -120 max: 120 // max x 10 x 2\r\n } else if (ev.deltaY) {\r\n delta = ev.deltaY / 1060; //deltaY min: -53 max: 53 // max x 10 x 2\r\n } else if (ev.detail) {\r\n delta = ev.detail / -60; //delta min: -3 max: 3 // max x 10 x 2\r\n } else {\r\n delta = 0;\r\n }\r\n\r\n targetZoom = self._currentZoom + (delta * self._currentZoom);\r\n\r\n ev.preventDefault();\r\n _setZoomerVal.call(self, targetZoom);\r\n change.call(self);\r\n }\r\n\r\n self.elements.zoomer.addEventListener('input', change);// this is being fired twice on keypress\r\n self.elements.zoomer.addEventListener('change', change);\r\n\r\n if (self.options.mouseWheelZoom) {\r\n self.elements.boundary.addEventListener('mousewheel', scroll);\r\n self.elements.boundary.addEventListener('DOMMouseScroll', scroll);\r\n }\r\n }\r\n\r\n function _onZoom(ui) {\r\n var self = this,\r\n transform = ui ? ui.transform : Transform.parse(self.elements.preview),\r\n vpRect = ui ? ui.viewportRect : self.elements.viewport.getBoundingClientRect(),\r\n origin = ui ? ui.origin : new TransformOrigin(self.elements.preview);\r\n\r\n function applyCss() {\r\n var transCss = {};\r\n transCss[CSS_TRANSFORM] = transform.toString();\r\n transCss[CSS_TRANS_ORG] = origin.toString();\r\n css(self.elements.preview, transCss);\r\n }\r\n\r\n self._currentZoom = ui ? ui.value : self._currentZoom;\r\n transform.scale = self._currentZoom;\r\n self.elements.zoomer.setAttribute('aria-valuenow', self._currentZoom);\r\n applyCss();\r\n\r\n if (self.options.enforceBoundary) {\r\n var boundaries = _getVirtualBoundaries.call(self, vpRect),\r\n transBoundaries = boundaries.translate,\r\n oBoundaries = boundaries.origin;\r\n\r\n if (transform.x >= transBoundaries.maxX) {\r\n origin.x = oBoundaries.minX;\r\n transform.x = transBoundaries.maxX;\r\n }\r\n\r\n if (transform.x <= transBoundaries.minX) {\r\n origin.x = oBoundaries.maxX;\r\n transform.x = transBoundaries.minX;\r\n }\r\n\r\n if (transform.y >= transBoundaries.maxY) {\r\n origin.y = oBoundaries.minY;\r\n transform.y = transBoundaries.maxY;\r\n }\r\n\r\n if (transform.y <= transBoundaries.minY) {\r\n origin.y = oBoundaries.maxY;\r\n transform.y = transBoundaries.minY;\r\n }\r\n }\r\n applyCss();\r\n _debouncedOverlay.call(self);\r\n _triggerUpdate.call(self);\r\n }\r\n\r\n function _getVirtualBoundaries(viewport) {\r\n var self = this,\r\n scale = self._currentZoom,\r\n vpWidth = viewport.width,\r\n vpHeight = viewport.height,\r\n centerFromBoundaryX = self.elements.boundary.clientWidth / 2,\r\n centerFromBoundaryY = self.elements.boundary.clientHeight / 2,\r\n imgRect = self.elements.preview.getBoundingClientRect(),\r\n curImgWidth = imgRect.width,\r\n curImgHeight = imgRect.height,\r\n halfWidth = vpWidth / 2,\r\n halfHeight = vpHeight / 2;\r\n\r\n var maxX = ((halfWidth / scale) - centerFromBoundaryX) * -1;\r\n var minX = maxX - ((curImgWidth * (1 / scale)) - (vpWidth * (1 / scale)));\r\n\r\n var maxY = ((halfHeight / scale) - centerFromBoundaryY) * -1;\r\n var minY = maxY - ((curImgHeight * (1 / scale)) - (vpHeight * (1 / scale)));\r\n\r\n var originMinX = (1 / scale) * halfWidth;\r\n var originMaxX = (curImgWidth * (1 / scale)) - originMinX;\r\n\r\n var originMinY = (1 / scale) * halfHeight;\r\n var originMaxY = (curImgHeight * (1 / scale)) - originMinY;\r\n\r\n return {\r\n translate: {\r\n maxX: maxX,\r\n minX: minX,\r\n maxY: maxY,\r\n minY: minY\r\n },\r\n origin: {\r\n maxX: originMaxX,\r\n minX: originMinX,\r\n maxY: originMaxY,\r\n minY: originMinY\r\n }\r\n };\r\n }\r\n\r\n function _updateCenterPoint(rotate) {\r\n var self = this,\r\n scale = self._currentZoom,\r\n data = self.elements.preview.getBoundingClientRect(),\r\n vpData = self.elements.viewport.getBoundingClientRect(),\r\n transform = Transform.parse(self.elements.preview.style[CSS_TRANSFORM]),\r\n pc = new TransformOrigin(self.elements.preview),\r\n top = (vpData.top - data.top) + (vpData.height / 2),\r\n left = (vpData.left - data.left) + (vpData.width / 2),\r\n center = {},\r\n adj = {};\r\n\r\n if (rotate) {\r\n var cx = pc.x;\r\n var cy = pc.y;\r\n var tx = transform.x;\r\n var ty = transform.y;\r\n\r\n center.y = cx;\r\n center.x = cy;\r\n transform.y = tx;\r\n transform.x = ty;\r\n }\r\n else {\r\n center.y = top / scale;\r\n center.x = left / scale;\r\n\r\n adj.y = (center.y - pc.y) * (1 - scale);\r\n adj.x = (center.x - pc.x) * (1 - scale);\r\n\r\n transform.x -= adj.x;\r\n transform.y -= adj.y;\r\n }\r\n\r\n var newCss = {};\r\n newCss[CSS_TRANS_ORG] = center.x + 'px ' + center.y + 'px';\r\n newCss[CSS_TRANSFORM] = transform.toString();\r\n css(self.elements.preview, newCss);\r\n }\r\n\r\n function _initDraggable() {\r\n var self = this,\r\n isDragging = false,\r\n originalX,\r\n originalY,\r\n originalDistance,\r\n vpRect,\r\n transform;\r\n\r\n function assignTransformCoordinates(deltaX, deltaY) {\r\n var imgRect = self.elements.preview.getBoundingClientRect(),\r\n top = transform.y + deltaY,\r\n left = transform.x + deltaX;\r\n\r\n if (self.options.enforceBoundary) {\r\n if (vpRect.top > imgRect.top + deltaY && vpRect.bottom < imgRect.bottom + deltaY) {\r\n transform.y = top;\r\n }\r\n\r\n if (vpRect.left > imgRect.left + deltaX && vpRect.right < imgRect.right + deltaX) {\r\n transform.x = left;\r\n }\r\n }\r\n else {\r\n transform.y = top;\r\n transform.x = left;\r\n }\r\n }\r\n\r\n function toggleGrabState(isDragging) {\r\n self.elements.preview.setAttribute('aria-grabbed', isDragging);\r\n self.elements.boundary.setAttribute('aria-dropeffect', isDragging? 'move': 'none');\r\n }\r\n\r\n function keyDown(ev) {\r\n var LEFT_ARROW = 37,\r\n UP_ARROW = 38,\r\n RIGHT_ARROW = 39,\r\n DOWN_ARROW = 40;\r\n\r\n if (ev.shiftKey && (ev.keyCode === UP_ARROW || ev.keyCode === DOWN_ARROW)) {\r\n var zoom;\r\n if (ev.keyCode === UP_ARROW) {\r\n zoom = parseFloat(self.elements.zoomer.value) + parseFloat(self.elements.zoomer.step)\r\n }\r\n else {\r\n zoom = parseFloat(self.elements.zoomer.value) - parseFloat(self.elements.zoomer.step)\r\n }\r\n self.setZoom(zoom);\r\n }\r\n else if (self.options.enableKeyMovement && (ev.keyCode >= 37 && ev.keyCode <= 40)) {\r\n ev.preventDefault();\r\n var movement = parseKeyDown(ev.keyCode);\r\n\r\n transform = Transform.parse(self.elements.preview);\r\n document.body.style[CSS_USERSELECT] = 'none';\r\n vpRect = self.elements.viewport.getBoundingClientRect();\r\n keyMove(movement);\r\n }\r\n\r\n function parseKeyDown(key) {\r\n switch (key) {\r\n case LEFT_ARROW:\r\n return [1, 0];\r\n case UP_ARROW:\r\n return [0, 1];\r\n case RIGHT_ARROW:\r\n return [-1, 0];\r\n case DOWN_ARROW:\r\n return [0, -1];\r\n }\r\n }\r\n }\r\n\r\n function keyMove(movement) {\r\n var deltaX = movement[0],\r\n deltaY = movement[1],\r\n newCss = {};\r\n\r\n assignTransformCoordinates(deltaX, deltaY);\r\n\r\n newCss[CSS_TRANSFORM] = transform.toString();\r\n css(self.elements.preview, newCss);\r\n _updateOverlay.call(self);\r\n document.body.style[CSS_USERSELECT] = '';\r\n _updateCenterPoint.call(self);\r\n _triggerUpdate.call(self);\r\n originalDistance = 0;\r\n }\r\n\r\n function mouseDown(ev) {\r\n if (ev.button !== undefined && ev.button !== 0) return;\r\n\r\n ev.preventDefault();\r\n if (isDragging) return;\r\n isDragging = true;\r\n originalX = ev.pageX;\r\n originalY = ev.pageY;\r\n\r\n if (ev.touches) {\r\n var touches = ev.touches[0];\r\n originalX = touches.pageX;\r\n originalY = touches.pageY;\r\n }\r\n toggleGrabState(isDragging);\r\n transform = Transform.parse(self.elements.preview);\r\n window.addEventListener('mousemove', mouseMove);\r\n window.addEventListener('touchmove', mouseMove);\r\n window.addEventListener('mouseup', mouseUp);\r\n window.addEventListener('touchend', mouseUp);\r\n document.body.style[CSS_USERSELECT] = 'none';\r\n vpRect = self.elements.viewport.getBoundingClientRect();\r\n }\r\n\r\n function mouseMove(ev) {\r\n ev.preventDefault();\r\n var pageX = ev.pageX,\r\n pageY = ev.pageY;\r\n\r\n if (ev.touches) {\r\n var touches = ev.touches[0];\r\n pageX = touches.pageX;\r\n pageY = touches.pageY;\r\n }\r\n\r\n var deltaX = pageX - originalX,\r\n deltaY = pageY - originalY,\r\n newCss = {};\r\n\r\n if (ev.type === 'touchmove') {\r\n if (ev.touches.length > 1) {\r\n var touch1 = ev.touches[0];\r\n var touch2 = ev.touches[1];\r\n var dist = Math.sqrt((touch1.pageX - touch2.pageX) * (touch1.pageX - touch2.pageX) + (touch1.pageY - touch2.pageY) * (touch1.pageY - touch2.pageY));\r\n\r\n if (!originalDistance) {\r\n originalDistance = dist / self._currentZoom;\r\n }\r\n\r\n var scale = dist / originalDistance;\r\n\r\n _setZoomerVal.call(self, scale);\r\n dispatchChange(self.elements.zoomer);\r\n return;\r\n }\r\n }\r\n\r\n assignTransformCoordinates(deltaX, deltaY);\r\n\r\n newCss[CSS_TRANSFORM] = transform.toString();\r\n css(self.elements.preview, newCss);\r\n _updateOverlay.call(self);\r\n originalY = pageY;\r\n originalX = pageX;\r\n }\r\n\r\n function mouseUp() {\r\n isDragging = false;\r\n toggleGrabState(isDragging);\r\n window.removeEventListener('mousemove', mouseMove);\r\n window.removeEventListener('touchmove', mouseMove);\r\n window.removeEventListener('mouseup', mouseUp);\r\n window.removeEventListener('touchend', mouseUp);\r\n document.body.style[CSS_USERSELECT] = '';\r\n _updateCenterPoint.call(self);\r\n _triggerUpdate.call(self);\r\n originalDistance = 0;\r\n }\r\n\r\n self.elements.overlay.addEventListener('mousedown', mouseDown);\r\n self.elements.viewport.addEventListener('keydown', keyDown);\r\n self.elements.overlay.addEventListener('touchstart', mouseDown);\r\n }\r\n\r\n function _updateOverlay() {\r\n if (!this.elements) return; // since this is debounced, it can be fired after destroy\r\n var self = this,\r\n boundRect = self.elements.boundary.getBoundingClientRect(),\r\n imgData = self.elements.preview.getBoundingClientRect();\r\n\r\n css(self.elements.overlay, {\r\n width: imgData.width + 'px',\r\n height: imgData.height + 'px',\r\n top: (imgData.top - boundRect.top) + 'px',\r\n left: (imgData.left - boundRect.left) + 'px'\r\n });\r\n }\r\n var _debouncedOverlay = debounce(_updateOverlay, 500);\r\n\r\n function _triggerUpdate() {\r\n var self = this,\r\n data = self.get();\r\n\r\n if (!_isVisible.call(self)) {\r\n return;\r\n }\r\n\r\n self.options.update.call(self, data);\r\n if (self.$ && typeof Prototype === 'undefined') {\r\n self.$(self.element).trigger('update.croppie', data);\r\n }\r\n else {\r\n var ev;\r\n if (window.CustomEvent) {\r\n ev = new CustomEvent('update', { detail: data });\r\n } else {\r\n ev = document.createEvent('CustomEvent');\r\n ev.initCustomEvent('update', true, true, data);\r\n }\r\n\r\n self.element.dispatchEvent(ev);\r\n }\r\n }\r\n\r\n function _isVisible() {\r\n return this.elements.preview.offsetHeight > 0 && this.elements.preview.offsetWidth > 0;\r\n }\r\n\r\n function _updatePropertiesFromImage() {\r\n var self = this,\r\n initialZoom = 1,\r\n cssReset = {},\r\n img = self.elements.preview,\r\n imgData,\r\n transformReset = new Transform(0, 0, initialZoom),\r\n originReset = new TransformOrigin(),\r\n isVisible = _isVisible.call(self);\r\n\r\n if (!isVisible || self.data.bound) {// if the croppie isn't visible or it doesn't need binding\r\n return;\r\n }\r\n\r\n self.data.bound = true;\r\n cssReset[CSS_TRANSFORM] = transformReset.toString();\r\n cssReset[CSS_TRANS_ORG] = originReset.toString();\r\n cssReset['opacity'] = 1;\r\n css(img, cssReset);\r\n\r\n imgData = self.elements.preview.getBoundingClientRect();\r\n\r\n self._originalImageWidth = imgData.width;\r\n self._originalImageHeight = imgData.height;\r\n self.data.orientation = _hasExif.call(self) ? getExifOrientation(self.elements.img) : self.data.orientation;\r\n\r\n if (self.options.enableZoom) {\r\n _updateZoomLimits.call(self, true);\r\n }\r\n else {\r\n self._currentZoom = initialZoom;\r\n }\r\n\r\n transformReset.scale = self._currentZoom;\r\n cssReset[CSS_TRANSFORM] = transformReset.toString();\r\n css(img, cssReset);\r\n\r\n if (self.data.points.length) {\r\n _bindPoints.call(self, self.data.points);\r\n }\r\n else {\r\n _centerImage.call(self);\r\n }\r\n\r\n _updateCenterPoint.call(self);\r\n _updateOverlay.call(self);\r\n }\r\n\r\n function _updateZoomLimits (initial) {\r\n var self = this,\r\n minZoom = Math.max(self.options.minZoom, 0) || 0,\r\n maxZoom = self.options.maxZoom || 1.5,\r\n initialZoom,\r\n defaultInitialZoom,\r\n zoomer = self.elements.zoomer,\r\n scale = parseFloat(zoomer.value),\r\n boundaryData = self.elements.boundary.getBoundingClientRect(),\r\n imgData = naturalImageDimensions(self.elements.img, self.data.orientation),\r\n vpData = self.elements.viewport.getBoundingClientRect(),\r\n minW,\r\n minH;\r\n if (self.options.enforceBoundary) {\r\n minW = vpData.width / imgData.width;\r\n minH = vpData.height / imgData.height;\r\n minZoom = Math.max(minW, minH);\r\n }\r\n\r\n if (minZoom >= maxZoom) {\r\n maxZoom = minZoom + 1;\r\n }\r\n\r\n zoomer.min = fix(minZoom, 4);\r\n zoomer.max = fix(maxZoom, 4);\r\n\r\n if (!initial && (scale < zoomer.min || scale > zoomer.max)) {\r\n _setZoomerVal.call(self, scale < zoomer.min ? zoomer.min : zoomer.max);\r\n }\r\n else if (initial) {\r\n defaultInitialZoom = Math.max((boundaryData.width / imgData.width), (boundaryData.height / imgData.height));\r\n initialZoom = self.data.boundZoom !== null ? self.data.boundZoom : defaultInitialZoom;\r\n _setZoomerVal.call(self, initialZoom);\r\n }\r\n\r\n dispatchChange(zoomer);\r\n }\r\n\r\n function _bindPoints(points) {\r\n if (points.length !== 4) {\r\n throw \"Croppie - Invalid number of points supplied: \" + points;\r\n }\r\n var self = this,\r\n pointsWidth = points[2] - points[0],\r\n // pointsHeight = points[3] - points[1],\r\n vpData = self.elements.viewport.getBoundingClientRect(),\r\n boundRect = self.elements.boundary.getBoundingClientRect(),\r\n vpOffset = {\r\n left: vpData.left - boundRect.left,\r\n top: vpData.top - boundRect.top\r\n },\r\n scale = vpData.width / pointsWidth,\r\n originTop = points[1],\r\n originLeft = points[0],\r\n transformTop = (-1 * points[1]) + vpOffset.top,\r\n transformLeft = (-1 * points[0]) + vpOffset.left,\r\n newCss = {};\r\n\r\n newCss[CSS_TRANS_ORG] = originLeft + 'px ' + originTop + 'px';\r\n newCss[CSS_TRANSFORM] = new Transform(transformLeft, transformTop, scale).toString();\r\n css(self.elements.preview, newCss);\r\n\r\n _setZoomerVal.call(self, scale);\r\n self._currentZoom = scale;\r\n }\r\n\r\n function _centerImage() {\r\n var self = this,\r\n imgDim = self.elements.preview.getBoundingClientRect(),\r\n vpDim = self.elements.viewport.getBoundingClientRect(),\r\n boundDim = self.elements.boundary.getBoundingClientRect(),\r\n vpLeft = vpDim.left - boundDim.left,\r\n vpTop = vpDim.top - boundDim.top,\r\n w = vpLeft - ((imgDim.width - vpDim.width) / 2),\r\n h = vpTop - ((imgDim.height - vpDim.height) / 2),\r\n transform = new Transform(w, h, self._currentZoom);\r\n\r\n css(self.elements.preview, CSS_TRANSFORM, transform.toString());\r\n }\r\n\r\n function _transferImageToCanvas(customOrientation) {\r\n var self = this,\r\n canvas = self.elements.canvas,\r\n img = self.elements.img,\r\n ctx = canvas.getContext('2d');\r\n\r\n ctx.clearRect(0, 0, canvas.width, canvas.height);\r\n canvas.width = img.width;\r\n canvas.height = img.height;\r\n\r\n var orientation = self.options.enableOrientation && customOrientation || getExifOrientation(img);\r\n drawCanvas(canvas, img, orientation);\r\n }\r\n\r\n function _getCanvas(data) {\r\n var self = this,\r\n points = data.points,\r\n left = num(points[0]),\r\n top = num(points[1]),\r\n right = num(points[2]),\r\n bottom = num(points[3]),\r\n width = right-left,\r\n height = bottom-top,\r\n circle = data.circle,\r\n canvas = document.createElement('canvas'),\r\n ctx = canvas.getContext('2d'),\r\n startX = 0,\r\n startY = 0,\r\n canvasWidth = data.outputWidth || width,\r\n canvasHeight = data.outputHeight || height;\r\n\r\n canvas.width = canvasWidth;\r\n canvas.height = canvasHeight;\r\n\r\n if (data.backgroundColor) {\r\n ctx.fillStyle = data.backgroundColor;\r\n ctx.fillRect(0, 0, canvasWidth, canvasHeight);\r\n }\r\n\r\n // By default assume we're going to draw the entire\r\n // source image onto the destination canvas.\r\n var sx = left,\r\n sy = top,\r\n sWidth = width,\r\n sHeight = height,\r\n dx = 0,\r\n dy = 0,\r\n dWidth = canvasWidth,\r\n dHeight = canvasHeight;\r\n\r\n //\r\n // Do not go outside of the original image's bounds along the x-axis.\r\n // Handle translations when projecting onto the destination canvas.\r\n //\r\n\r\n // The smallest possible source x-position is 0.\r\n if (left < 0) {\r\n sx = 0;\r\n dx = (Math.abs(left) / width) * canvasWidth;\r\n }\r\n\r\n // The largest possible source width is the original image's width.\r\n if (sWidth + sx > self._originalImageWidth) {\r\n sWidth = self._originalImageWidth - sx;\r\n dWidth = (sWidth / width) * canvasWidth;\r\n }\r\n\r\n //\r\n // Do not go outside of the original image's bounds along the y-axis.\r\n //\r\n\r\n // The smallest possible source y-position is 0.\r\n if (top < 0) {\r\n sy = 0;\r\n dy = (Math.abs(top) / height) * canvasHeight;\r\n }\r\n\r\n // The largest possible source height is the original image's height.\r\n if (sHeight + sy > self._originalImageHeight) {\r\n sHeight = self._originalImageHeight - sy;\r\n dHeight = (sHeight / height) * canvasHeight;\r\n }\r\n\r\n // console.table({ left, right, top, bottom, canvasWidth, canvasHeight, width, height, startX, startY, circle, sx, sy, dx, dy, sWidth, sHeight, dWidth, dHeight });\r\n\r\n ctx.drawImage(this.elements.preview, sx, sy, sWidth, sHeight, dx, dy, dWidth, dHeight);\r\n if (circle) {\r\n ctx.fillStyle = '#fff';\r\n ctx.globalCompositeOperation = 'destination-in';\r\n ctx.beginPath();\r\n ctx.arc(canvas.width / 2, canvas.height / 2, canvas.width / 2, 0, Math.PI * 2, true);\r\n ctx.closePath();\r\n ctx.fill();\r\n }\r\n return canvas;\r\n }\r\n\r\n function _getHtmlResult(data) {\r\n var points = data.points,\r\n div = document.createElement('div'),\r\n img = document.createElement('img'),\r\n width = points[2] - points[0],\r\n height = points[3] - points[1];\r\n\r\n addClass(div, 'croppie-result');\r\n div.appendChild(img);\r\n css(img, {\r\n left: (-1 * points[0]) + 'px',\r\n top: (-1 * points[1]) + 'px'\r\n });\r\n img.src = data.url;\r\n css(div, {\r\n width: width + 'px',\r\n height: height + 'px'\r\n });\r\n\r\n return div;\r\n }\r\n\r\n function _getBase64Result(data) {\r\n return _getCanvas.call(this, data).toDataURL(data.format, data.quality);\r\n }\r\n\r\n function _getBlobResult(data) {\r\n var self = this;\r\n return new Promise(function (resolve) {\r\n _getCanvas.call(self, data).toBlob(function (blob) {\r\n resolve(blob);\r\n }, data.format, data.quality);\r\n });\r\n }\r\n\r\n function _replaceImage(img) {\r\n if (this.elements.img.parentNode) {\r\n Array.prototype.forEach.call(this.elements.img.classList, function(c) { img.classList.add(c); });\r\n this.elements.img.parentNode.replaceChild(img, this.elements.img);\r\n this.elements.preview = img; // if the img is attached to the DOM, they're not using the canvas\r\n }\r\n this.elements.img = img;\r\n }\r\n\r\n function _bind(options, cb) {\r\n var self = this,\r\n url,\r\n points = [],\r\n zoom = null,\r\n hasExif = _hasExif.call(self);\r\n\r\n if (typeof (options) === 'string') {\r\n url = options;\r\n options = {};\r\n }\r\n else if (Array.isArray(options)) {\r\n points = options.slice();\r\n }\r\n else if (typeof (options) === 'undefined' && self.data.url) { //refreshing\r\n _updatePropertiesFromImage.call(self);\r\n _triggerUpdate.call(self);\r\n return null;\r\n }\r\n else {\r\n url = options.url;\r\n points = options.points || [];\r\n zoom = typeof(options.zoom) === 'undefined' ? null : options.zoom;\r\n }\r\n\r\n self.data.bound = false;\r\n self.data.url = url || self.data.url;\r\n self.data.boundZoom = zoom;\r\n\r\n return loadImage(url, hasExif).then(function (img) {\r\n _replaceImage.call(self, img);\r\n if (!points.length) {\r\n var natDim = naturalImageDimensions(img);\r\n var rect = self.elements.viewport.getBoundingClientRect();\r\n var aspectRatio = rect.width / rect.height;\r\n var imgAspectRatio = natDim.width / natDim.height;\r\n var width, height;\r\n\r\n if (imgAspectRatio > aspectRatio) {\r\n height = natDim.height;\r\n width = height * aspectRatio;\r\n }\r\n else {\r\n width = natDim.width;\r\n height = natDim.height / aspectRatio;\r\n }\r\n\r\n var x0 = (natDim.width - width) / 2;\r\n var y0 = (natDim.height - height) / 2;\r\n var x1 = x0 + width;\r\n var y1 = y0 + height;\r\n self.data.points = [x0, y0, x1, y1];\r\n }\r\n else if (self.options.relative) {\r\n points = [\r\n points[0] * img.naturalWidth / 100,\r\n points[1] * img.naturalHeight / 100,\r\n points[2] * img.naturalWidth / 100,\r\n points[3] * img.naturalHeight / 100\r\n ];\r\n }\r\n\r\n self.data.orientation = options.orientation || 1;\r\n self.data.points = points.map(function (p) {\r\n return parseFloat(p);\r\n });\r\n if (self.options.useCanvas) {\r\n _transferImageToCanvas.call(self, self.data.orientation);\r\n }\r\n _updatePropertiesFromImage.call(self);\r\n _triggerUpdate.call(self);\r\n cb && cb();\r\n });\r\n }\r\n\r\n function fix(v, decimalPoints) {\r\n return parseFloat(v).toFixed(decimalPoints || 0);\r\n }\r\n\r\n function _get() {\r\n var self = this,\r\n imgData = self.elements.preview.getBoundingClientRect(),\r\n vpData = self.elements.viewport.getBoundingClientRect(),\r\n x1 = vpData.left - imgData.left,\r\n y1 = vpData.top - imgData.top,\r\n widthDiff = (vpData.width - self.elements.viewport.offsetWidth) / 2, //border\r\n heightDiff = (vpData.height - self.elements.viewport.offsetHeight) / 2,\r\n x2 = x1 + self.elements.viewport.offsetWidth + widthDiff,\r\n y2 = y1 + self.elements.viewport.offsetHeight + heightDiff,\r\n scale = self._currentZoom;\r\n\r\n if (scale === Infinity || isNaN(scale)) {\r\n scale = 1;\r\n }\r\n\r\n var max = self.options.enforceBoundary ? 0 : Number.NEGATIVE_INFINITY;\r\n x1 = Math.max(max, x1 / scale);\r\n y1 = Math.max(max, y1 / scale);\r\n x2 = Math.max(max, x2 / scale);\r\n y2 = Math.max(max, y2 / scale);\r\n\r\n return {\r\n points: [fix(x1), fix(y1), fix(x2), fix(y2)],\r\n zoom: scale,\r\n orientation: self.data.orientation\r\n };\r\n }\r\n\r\n var RESULT_DEFAULTS = {\r\n type: 'canvas',\r\n format: 'png',\r\n quality: 1\r\n },\r\n RESULT_FORMATS = ['jpeg', 'webp', 'png'];\r\n\r\n function _result(options) {\r\n var self = this,\r\n data = _get.call(self),\r\n opts = deepExtend(clone(RESULT_DEFAULTS), clone(options)),\r\n resultType = (typeof (options) === 'string' ? options : (opts.type || 'base64')),\r\n size = opts.size || 'viewport',\r\n format = opts.format,\r\n quality = opts.quality,\r\n backgroundColor = opts.backgroundColor,\r\n circle = typeof opts.circle === 'boolean' ? opts.circle : (self.options.viewport.type === 'circle'),\r\n vpRect = self.elements.viewport.getBoundingClientRect(),\r\n ratio = vpRect.width / vpRect.height,\r\n prom;\r\n\r\n if (size === 'viewport') {\r\n data.outputWidth = vpRect.width;\r\n data.outputHeight = vpRect.height;\r\n } else if (typeof size === 'object') {\r\n if (size.width && size.height) {\r\n data.outputWidth = size.width;\r\n data.outputHeight = size.height;\r\n } else if (size.width) {\r\n data.outputWidth = size.width;\r\n data.outputHeight = size.width / ratio;\r\n } else if (size.height) {\r\n data.outputWidth = size.height * ratio;\r\n data.outputHeight = size.height;\r\n }\r\n }\r\n\r\n if (RESULT_FORMATS.indexOf(format) > -1) {\r\n data.format = 'image/' + format;\r\n data.quality = quality;\r\n }\r\n\r\n data.circle = circle;\r\n data.url = self.data.url;\r\n data.backgroundColor = backgroundColor;\r\n\r\n prom = new Promise(function (resolve) {\r\n switch(resultType.toLowerCase())\r\n {\r\n case 'rawcanvas':\r\n resolve(_getCanvas.call(self, data));\r\n break;\r\n case 'canvas':\r\n case 'base64':\r\n resolve(_getBase64Result.call(self, data));\r\n break;\r\n case 'blob':\r\n _getBlobResult.call(self, data).then(resolve);\r\n break;\r\n default:\r\n resolve(_getHtmlResult.call(self, data));\r\n break;\r\n }\r\n });\r\n return prom;\r\n }\r\n\r\n function _refresh() {\r\n _updatePropertiesFromImage.call(this);\r\n }\r\n\r\n function _rotate(deg) {\r\n if (!this.options.useCanvas || !this.options.enableOrientation) {\r\n throw 'Croppie: Cannot rotate without enableOrientation && EXIF.js included';\r\n }\r\n\r\n var self = this,\r\n canvas = self.elements.canvas;\r\n\r\n self.data.orientation = getExifOffset(self.data.orientation, deg);\r\n drawCanvas(canvas, self.elements.img, self.data.orientation);\r\n _updateCenterPoint.call(self, true);\r\n _updateZoomLimits.call(self);\r\n\r\n // Reverses image dimensions if the degrees of rotation is not divisible by 180.\r\n if ((Math.abs(deg) / 90) % 2 === 1) {\r\n var oldHeight = self._originalImageHeight;\r\n var oldWidth = self._originalImageWidth;\r\n self._originalImageWidth = oldHeight;\r\n self._originalImageHeight = oldWidth;\r\n }\r\n }\r\n\r\n function _destroy() {\r\n var self = this;\r\n self.element.removeChild(self.elements.boundary);\r\n removeClass(self.element, 'croppie-container');\r\n if (self.options.enableZoom) {\r\n self.element.removeChild(self.elements.zoomerWrap);\r\n }\r\n delete self.elements;\r\n }\r\n\r\n if (typeof window !== 'undefined' && window.jQuery) {\r\n var $ = window.jQuery;\r\n $.fn.croppie = function (opts) {\r\n var ot = typeof opts;\r\n\r\n if (ot === 'string') {\r\n var args = Array.prototype.slice.call(arguments, 1);\r\n var singleInst = $(this).data('croppie');\r\n\r\n if (opts === 'get') {\r\n return singleInst.get();\r\n }\r\n else if (opts === 'result') {\r\n return singleInst.result.apply(singleInst, args);\r\n }\r\n else if (opts === 'bind') {\r\n return singleInst.bind.apply(singleInst, args);\r\n }\r\n\r\n return this.each(function () {\r\n var i = $(this).data('croppie');\r\n if (!i) return;\r\n\r\n var method = i[opts];\r\n if ($.isFunction(method)) {\r\n method.apply(i, args);\r\n if (opts === 'destroy') {\r\n $(this).removeData('croppie');\r\n }\r\n }\r\n else {\r\n throw 'Croppie ' + opts + ' method not found';\r\n }\r\n });\r\n }\r\n else {\r\n return this.each(function () {\r\n var i = new Croppie(this, opts);\r\n i.$ = $;\r\n $(this).data('croppie', i);\r\n });\r\n }\r\n };\r\n }\r\n\r\n function Croppie(element, opts) {\r\n if (element.className.indexOf('croppie-container') > -1) {\r\n throw new Error(\"Croppie: Can't initialize croppie more than once\");\r\n }\r\n this.element = element;\r\n this.options = deepExtend(clone(Croppie.defaults), opts);\r\n\r\n if (this.element.tagName.toLowerCase() === 'img') {\r\n var origImage = this.element;\r\n addClass(origImage, 'cr-original-image');\r\n setAttributes(origImage, {'aria-hidden' : 'true', 'alt' : '' });\r\n var replacementDiv = document.createElement('div');\r\n this.element.parentNode.appendChild(replacementDiv);\r\n replacementDiv.appendChild(origImage);\r\n this.element = replacementDiv;\r\n this.options.url = this.options.url || origImage.src;\r\n }\r\n\r\n _create.call(this);\r\n if (this.options.url) {\r\n var bindOpts = {\r\n url: this.options.url,\r\n points: this.options.points\r\n };\r\n delete this.options['url'];\r\n delete this.options['points'];\r\n _bind.call(this, bindOpts);\r\n }\r\n }\r\n\r\n Croppie.defaults = {\r\n viewport: {\r\n width: 100,\r\n height: 100,\r\n type: 'square'\r\n },\r\n boundary: { },\r\n orientationControls: {\r\n enabled: true,\r\n leftClass: '',\r\n rightClass: ''\r\n },\r\n resizeControls: {\r\n width: true,\r\n height: true\r\n },\r\n customClass: '',\r\n showZoomer: true,\r\n enableZoom: true,\r\n enableResize: false,\r\n mouseWheelZoom: true,\r\n enableExif: false,\r\n enforceBoundary: true,\r\n enableOrientation: false,\r\n enableKeyMovement: true,\r\n update: function () { }\r\n };\r\n\r\n Croppie.globals = {\r\n translate: 'translate3d'\r\n };\r\n\r\n deepExtend(Croppie.prototype, {\r\n bind: function (options, cb) {\r\n return _bind.call(this, options, cb);\r\n },\r\n get: function () {\r\n var data = _get.call(this);\r\n var points = data.points;\r\n if (this.options.relative) {\r\n points[0] /= this.elements.img.naturalWidth / 100;\r\n points[1] /= this.elements.img.naturalHeight / 100;\r\n points[2] /= this.elements.img.naturalWidth / 100;\r\n points[3] /= this.elements.img.naturalHeight / 100;\r\n }\r\n return data;\r\n },\r\n result: function (type) {\r\n return _result.call(this, type);\r\n },\r\n refresh: function () {\r\n return _refresh.call(this);\r\n },\r\n setZoom: function (v) {\r\n _setZoomerVal.call(this, v);\r\n dispatchChange(this.elements.zoomer);\r\n },\r\n rotate: function (deg) {\r\n _rotate.call(this, deg);\r\n },\r\n destroy: function () {\r\n return _destroy.call(this);\r\n }\r\n });\r\n return Croppie;\r\n}));\r\n","// Imports\nimport ___CSS_LOADER_API_SOURCEMAP_IMPORT___ from \"../css-loader/dist/runtime/sourceMaps.js\";\nimport ___CSS_LOADER_API_IMPORT___ from \"../css-loader/dist/runtime/api.js\";\nvar ___CSS_LOADER_EXPORT___ = ___CSS_LOADER_API_IMPORT___(___CSS_LOADER_API_SOURCEMAP_IMPORT___);\n// Module\n___CSS_LOADER_EXPORT___.push([module.id, \".croppie-container{height:100%;width:100%}.croppie-container .cr-image{left:0;max-height:none;max-width:none;position:absolute;top:0;transform-origin:0 0;z-index:-1}.croppie-container .cr-boundary{height:100%;margin:0 auto;overflow:hidden;position:relative;width:100%;z-index:1}.croppie-container .cr-resizer,.croppie-container .cr-viewport{border:2px solid #fff;bottom:0;box-shadow:0 0 2000px 2000px rgba(0,0,0,.5);left:0;margin:auto;position:absolute;right:0;top:0;z-index:0}.croppie-container .cr-resizer{box-shadow:none;pointer-events:none;z-index:2}.croppie-container .cr-resizer-horisontal,.croppie-container .cr-resizer-vertical{pointer-events:all;position:absolute}.croppie-container .cr-resizer-horisontal:after,.croppie-container .cr-resizer-vertical:after{background:#fff;border:1px solid #000;box-sizing:border-box;content:\\\"\\\";display:block;height:10px;position:absolute;width:10px}.croppie-container .cr-resizer-vertical{bottom:-5px;cursor:row-resize;height:10px;width:100%}.croppie-container .cr-resizer-vertical:after{left:50%;margin-left:-5px}.croppie-container .cr-resizer-horisontal{cursor:col-resize;height:100%;right:-5px;width:10px}.croppie-container .cr-resizer-horisontal:after{margin-top:-5px;top:50%}.croppie-container .cr-original-image{display:none}.croppie-container .cr-vp-circle{border-radius:50%}.croppie-container .cr-overlay{cursor:move;position:absolute;touch-action:none;z-index:1}.croppie-container .cr-slider-wrap{margin:15px auto;text-align:center;width:75%}.croppie-result{overflow:hidden;position:relative}.croppie-result img{position:absolute}.croppie-container .cr-image,.croppie-container .cr-overlay,.croppie-container .cr-viewport{transform:translateZ(0)}.cr-slider{-webkit-appearance:none;background-color:transparent;max-width:100%;padding-bottom:8px;padding-top:8px;width:300px}.cr-slider::-webkit-slider-runnable-track{background:rgba(0,0,0,.5);border:0;border-radius:3px;height:3px;width:100%}.cr-slider::-webkit-slider-thumb{-webkit-appearance:none;background:#ddd;border:none;border-radius:50%;height:16px;margin-top:-6px;width:16px}.cr-slider:focus{outline:none}.cr-slider::-moz-range-track{background:rgba(0,0,0,.5);border:0;border-radius:3px;height:3px;width:100%}.cr-slider::-moz-range-thumb{background:#ddd;border:none;border-radius:50%;height:16px;margin-top:-6px;width:16px}.cr-slider:-moz-focusring{outline:1px solid #fff;outline-offset:-1px}.cr-slider::-ms-track{background:transparent;border-color:transparent;border-width:6px 0;color:transparent;height:5px;width:100%}.cr-slider::-ms-fill-lower,.cr-slider::-ms-fill-upper{background:rgba(0,0,0,.5);border-radius:10px}.cr-slider::-ms-thumb{background:#ddd;border:none;border-radius:50%;height:16px;margin-top:1px;width:16px}.cr-slider:focus::-ms-fill-lower,.cr-slider:focus::-ms-fill-upper{background:rgba(0,0,0,.5)}.cr-rotate-controls{bottom:5px;left:5px;position:absolute;z-index:1}.cr-rotate-controls button{background:none;border:0}.cr-rotate-controls i:before{display:inline-block;font-size:22px;font-style:normal;font-weight:900}.cr-rotate-l i:before{content:\\\"↺\\\"}.cr-rotate-r i:before{content:\\\"↻\\\"}\", \"\",{\"version\":3,\"sources\":[\"webpack://./node_modules/croppie/croppie.css\"],\"names\":[],\"mappings\":\"AAAA,mBAEI,WAAY,CADZ,UAEJ,CAEA,6BAII,MAAO,CAEP,eAAgB,CAChB,cAAe,CALf,iBAAkB,CAClB,KAAM,CAEN,oBAAqB,CAJrB,UAOJ,CAEA,gCAMI,WAAY,CAHZ,aAAc,CADd,eAAgB,CADhB,iBAAkB,CAIlB,UAAW,CADX,SAGJ,CAEA,+DAGI,qBAAsB,CAGtB,QAAS,CAGT,2CAAgD,CADhD,MAAO,CAJP,WAAY,CAFZ,iBAAkB,CAKlB,OAAQ,CAFR,KAAM,CAKN,SACJ,CAEA,+BAEE,eAAgB,CAChB,mBAAoB,CAFpB,SAGF,CAEA,kFAGE,kBAAmB,CADnB,iBAEF,CAEA,8FAMI,eAAgB,CADhB,qBAAuB,CADvB,qBAAsB,CAKtB,UAAW,CAPX,aAAc,CAMd,WAAY,CALZ,iBAAkB,CAIlB,UAGJ,CAEA,wCACE,WAAY,CACZ,iBAAkB,CAElB,WAAY,CADZ,UAEF,CAEA,8CACI,QAAS,CACT,gBACJ,CAEA,0CAEE,iBAAkB,CAElB,WAAY,CAHZ,UAAW,CAEX,UAEF,CAEA,gDAEI,eAAgB,CADhB,OAEJ,CAEA,sCACI,YACJ,CAEA,iCACI,iBACJ,CAEA,+BAGI,WAAY,CADZ,iBAAkB,CAElB,iBAAkB,CAHlB,SAIJ,CAEA,mCAEI,gBAAiB,CACjB,iBAAkB,CAFlB,SAGJ,CAEA,gBAEI,eAAgB,CADhB,iBAEJ,CAEA,oBACI,iBACJ,CAEA,4FAMI,uBACJ,CAQA,WACI,uBAAwB,CAQxB,4BAA6B,CAH7B,cAAe,CAEf,kBAAmB,CADnB,eAAgB,CAHhB,WAMJ,CAEA,0CAGI,yBAA8B,CAC9B,QAAS,CACT,iBAAkB,CAHlB,UAAW,CADX,UAKJ,CAEA,iCACI,uBAAwB,CAKxB,eAAgB,CAJhB,WAAY,CAGZ,iBAAkB,CAFlB,WAAY,CAIZ,eAAgB,CAHhB,UAIJ,CAEA,iBACI,YACJ,CAOA,6BAGI,yBAA8B,CAC9B,QAAS,CACT,iBAAkB,CAHlB,UAAW,CADX,UAKJ,CAEA,6BAKI,eAAgB,CAJhB,WAAY,CAGZ,iBAAkB,CAFlB,WAAY,CAIZ,eAAgB,CAHhB,UAIJ,CAGA,0BACI,sBAAwB,CACxB,mBACJ,CAEA,sBAGI,sBAAuB,CAE1B,wBAAyB,CACzB,kBAAmB,CACnB,iBAAkB,CALf,UAAW,CADX,UAOJ,CAKA,sDACC,yBAA8B,CAC9B,kBACD,CACA,sBAKC,eAAgB,CAJhB,WAAY,CAGZ,iBAAkB,CAFlB,WAAY,CAIZ,cAAc,CAHd,UAID,CAIA,kEACC,yBACD,CAMA,oBAEC,UAAW,CACX,QAAS,CAFT,iBAAkB,CAGlB,SACD,CACA,2BAEC,eAAgB,CADhB,QAED,CACA,6BACC,oBAAqB,CAGrB,cAAe,CAFf,iBAAkB,CAClB,eAED,CACA,sBACC,WACD,CACA,sBACC,WACD\",\"sourcesContent\":[\".croppie-container {\\n width: 100%;\\n height: 100%;\\n}\\n\\n.croppie-container .cr-image {\\n z-index: -1;\\n position: absolute;\\n top: 0;\\n left: 0;\\n transform-origin: 0 0;\\n max-height: none;\\n max-width: none;\\n}\\n\\n.croppie-container .cr-boundary {\\n position: relative;\\n overflow: hidden;\\n margin: 0 auto;\\n z-index: 1;\\n width: 100%;\\n height: 100%;\\n}\\n\\n.croppie-container .cr-viewport,\\n.croppie-container .cr-resizer {\\n position: absolute;\\n border: 2px solid #fff;\\n margin: auto;\\n top: 0;\\n bottom: 0;\\n right: 0;\\n left: 0;\\n box-shadow: 0 0 2000px 2000px rgba(0, 0, 0, 0.5);\\n z-index: 0;\\n}\\n\\n.croppie-container .cr-resizer {\\n z-index: 2;\\n box-shadow: none;\\n pointer-events: none;\\n}\\n\\n.croppie-container .cr-resizer-vertical,\\n.croppie-container .cr-resizer-horisontal {\\n position: absolute;\\n pointer-events: all;\\n}\\n\\n.croppie-container .cr-resizer-vertical::after,\\n.croppie-container .cr-resizer-horisontal::after {\\n display: block;\\n position: absolute;\\n box-sizing: border-box;\\n border: 1px solid black;\\n background: #fff;\\n width: 10px;\\n height: 10px;\\n content: '';\\n}\\n\\n.croppie-container .cr-resizer-vertical {\\n bottom: -5px;\\n cursor: row-resize;\\n width: 100%;\\n height: 10px;\\n}\\n\\n.croppie-container .cr-resizer-vertical::after {\\n left: 50%;\\n margin-left: -5px;\\n}\\n\\n.croppie-container .cr-resizer-horisontal {\\n right: -5px;\\n cursor: col-resize;\\n width: 10px;\\n height: 100%;\\n}\\n\\n.croppie-container .cr-resizer-horisontal::after {\\n top: 50%;\\n margin-top: -5px;\\n}\\n\\n.croppie-container .cr-original-image {\\n display: none;\\n}\\n\\n.croppie-container .cr-vp-circle {\\n border-radius: 50%;\\n}\\n\\n.croppie-container .cr-overlay {\\n z-index: 1;\\n position: absolute;\\n cursor: move;\\n touch-action: none;\\n}\\n\\n.croppie-container .cr-slider-wrap {\\n width: 75%;\\n margin: 15px auto;\\n text-align: center;\\n}\\n\\n.croppie-result {\\n position: relative;\\n overflow: hidden;\\n}\\n\\n.croppie-result img {\\n position: absolute;\\n}\\n\\n.croppie-container .cr-image,\\n.croppie-container .cr-overlay,\\n.croppie-container .cr-viewport {\\n -webkit-transform: translateZ(0);\\n -moz-transform: translateZ(0);\\n -ms-transform: translateZ(0);\\n transform: translateZ(0);\\n}\\n\\n/*************************************/\\n/***** STYLING RANGE INPUT ***********/\\n/*************************************/\\n/*http://brennaobrien.com/blog/2014/05/style-input-type-range-in-every-browser.html */\\n/*************************************/\\n\\n.cr-slider {\\n -webkit-appearance: none;\\n/*removes default webkit styles*/\\n\\t/*border: 1px solid white; *//*fix for FF unable to apply focus style bug */\\n width: 300px;\\n/*required for proper track sizing in FF*/\\n max-width: 100%;\\n padding-top: 8px;\\n padding-bottom: 8px;\\n background-color: transparent;\\n}\\n\\n.cr-slider::-webkit-slider-runnable-track {\\n width: 100%;\\n height: 3px;\\n background: rgba(0, 0, 0, 0.5);\\n border: 0;\\n border-radius: 3px;\\n}\\n\\n.cr-slider::-webkit-slider-thumb {\\n -webkit-appearance: none;\\n border: none;\\n height: 16px;\\n width: 16px;\\n border-radius: 50%;\\n background: #ddd;\\n margin-top: -6px;\\n}\\n\\n.cr-slider:focus {\\n outline: none;\\n}\\n/*\\n.cr-slider:focus::-webkit-slider-runnable-track {\\nbackground: #ccc;\\n}\\n*/\\n\\n.cr-slider::-moz-range-track {\\n width: 100%;\\n height: 3px;\\n background: rgba(0, 0, 0, 0.5);\\n border: 0;\\n border-radius: 3px;\\n}\\n\\n.cr-slider::-moz-range-thumb {\\n border: none;\\n height: 16px;\\n width: 16px;\\n border-radius: 50%;\\n background: #ddd;\\n margin-top: -6px;\\n}\\n\\n/*hide the outline behind the border*/\\n.cr-slider:-moz-focusring {\\n outline: 1px solid white;\\n outline-offset: -1px;\\n}\\n\\n.cr-slider::-ms-track {\\n width: 100%;\\n height: 5px;\\n background: transparent;\\n/*remove bg colour from the track, we'll use ms-fill-lower and ms-fill-upper instead */\\n\\tborder-color: transparent;/*leave room for the larger thumb to overflow with a transparent border */\\n\\tborder-width: 6px 0;\\n\\tcolor: transparent;/*remove default tick marks*/\\n}\\n.cr-slider::-ms-fill-lower {\\n\\tbackground: rgba(0, 0, 0, 0.5);\\n\\tborder-radius: 10px;\\n}\\n.cr-slider::-ms-fill-upper {\\n\\tbackground: rgba(0, 0, 0, 0.5);\\n\\tborder-radius: 10px;\\n}\\n.cr-slider::-ms-thumb {\\n\\tborder: none;\\n\\theight: 16px;\\n\\twidth: 16px;\\n\\tborder-radius: 50%;\\n\\tbackground: #ddd;\\n\\tmargin-top:1px;\\n}\\n.cr-slider:focus::-ms-fill-lower {\\n\\tbackground: rgba(0, 0, 0, 0.5);\\n}\\n.cr-slider:focus::-ms-fill-upper {\\n\\tbackground: rgba(0, 0, 0, 0.5);\\n}\\n/*******************************************/\\n\\n/***********************************/\\n/* Rotation Tools */\\n/***********************************/\\n.cr-rotate-controls {\\n\\tposition: absolute;\\n\\tbottom: 5px;\\n\\tleft: 5px;\\n\\tz-index: 1;\\n}\\n.cr-rotate-controls button {\\n\\tborder: 0;\\n\\tbackground: none;\\n}\\n.cr-rotate-controls i:before {\\n\\tdisplay: inline-block;\\n\\tfont-style: normal;\\n\\tfont-weight: 900;\\n\\tfont-size: 22px;\\n}\\n.cr-rotate-l i:before {\\n\\tcontent: '↺';\\n}\\n.cr-rotate-r i:before {\\n\\tcontent: '↻';\\n}\\n\"],\"sourceRoot\":\"\"}]);\n// Exports\nexport default ___CSS_LOADER_EXPORT___;\n","\"use strict\";\n\n/*\n MIT License http://www.opensource.org/licenses/mit-license.php\n Author Tobias Koppers @sokra\n*/\nmodule.exports = function (cssWithMappingToString) {\n var list = [];\n\n // return the list of modules as css string\n list.toString = function toString() {\n return this.map(function (item) {\n var content = \"\";\n var needLayer = typeof item[5] !== \"undefined\";\n if (item[4]) {\n content += \"@supports (\".concat(item[4], \") {\");\n }\n if (item[2]) {\n content += \"@media \".concat(item[2], \" {\");\n }\n if (needLayer) {\n content += \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\");\n }\n content += cssWithMappingToString(item);\n if (needLayer) {\n content += \"}\";\n }\n if (item[2]) {\n content += \"}\";\n }\n if (item[4]) {\n content += \"}\";\n }\n return content;\n }).join(\"\");\n };\n\n // import a list of modules into the list\n list.i = function i(modules, media, dedupe, supports, layer) {\n if (typeof modules === \"string\") {\n modules = [[null, modules, undefined]];\n }\n var alreadyImportedModules = {};\n if (dedupe) {\n for (var k = 0; k < this.length; k++) {\n var id = this[k][0];\n if (id != null) {\n alreadyImportedModules[id] = true;\n }\n }\n }\n for (var _k = 0; _k < modules.length; _k++) {\n var item = [].concat(modules[_k]);\n if (dedupe && alreadyImportedModules[item[0]]) {\n continue;\n }\n if (typeof layer !== \"undefined\") {\n if (typeof item[5] === \"undefined\") {\n item[5] = layer;\n } else {\n item[1] = \"@layer\".concat(item[5].length > 0 ? \" \".concat(item[5]) : \"\", \" {\").concat(item[1], \"}\");\n item[5] = layer;\n }\n }\n if (media) {\n if (!item[2]) {\n item[2] = media;\n } else {\n item[1] = \"@media \".concat(item[2], \" {\").concat(item[1], \"}\");\n item[2] = media;\n }\n }\n if (supports) {\n if (!item[4]) {\n item[4] = \"\".concat(supports);\n } else {\n item[1] = \"@supports (\".concat(item[4], \") {\").concat(item[1], \"}\");\n item[4] = supports;\n }\n }\n list.push(item);\n }\n };\n return list;\n};","\"use strict\";\n\nmodule.exports = function (url, options) {\n if (!options) {\n options = {};\n }\n if (!url) {\n return url;\n }\n url = String(url.__esModule ? url.default : url);\n\n // If url is already wrapped in quotes, remove them\n if (/^['\"].*['\"]$/.test(url)) {\n url = url.slice(1, -1);\n }\n if (options.hash) {\n url += options.hash;\n }\n\n // Should url be wrapped?\n // See https://drafts.csswg.org/css-values-3/#urls\n if (/[\"'() \\t\\n]|(%20)/.test(url) || options.needQuotes) {\n return \"\\\"\".concat(url.replace(/\"/g, '\\\\\"').replace(/\\n/g, \"\\\\n\"), \"\\\"\");\n }\n return url;\n};","\"use strict\";\n\nmodule.exports = function (item) {\n var content = item[1];\n var cssMapping = item[3];\n if (!cssMapping) {\n return content;\n }\n if (typeof btoa === \"function\") {\n var base64 = btoa(unescape(encodeURIComponent(JSON.stringify(cssMapping))));\n var data = \"sourceMappingURL=data:application/json;charset=utf-8;base64,\".concat(base64);\n var sourceMapping = \"/*# \".concat(data, \" */\");\n return [content].concat([sourceMapping]).join(\"\\n\");\n }\n return [content].join(\"\\n\");\n};"],"names":[],"sourceRoot":""}