$(function(){"use strict";var p,c=window.console||{log:function(){}},i=window.URL||window.webkitURL,n=$("#image"),l=$("#download"),t=$("#dataX"),a=$("#dataY"),o=$("#dataHeight"),r=$("#dataWidth"),d=$("#dataRotate"),s=$("#dataScaleX"),g=$("#dataScaleY"),v={aspectRatio:16/9,preview:".img-preview",crop:function(e){t.val(Math.round(e.detail.x)),a.val(Math.round(e.detail.y)),o.val(Math.round(e.detail.height)),r.val(Math.round(e.detail.width)),d.val(e.detail.rotate),s.val(e.detail.scaleX),g.val(e.detail.scaleY)}},h=n.attr("src"),m="cropped.jpg",u="image/jpeg",f=($('[data-toggle="tooltip"]').tooltip(),n.on({ready:function(e){c.log(e.type)},cropstart:function(e){c.log(e.type,e.detail.action)},cropmove:function(e){c.log(e.type,e.detail.action)},cropend:function(e){c.log(e.type,e.detail.action)},crop:function(e){c.log(e.type)},zoom:function(e){c.log(e.type,e.detail.ratio)}}).cropper(v),$.isFunction(document.createElement("canvas").getContext)||$('button[data-method="getCroppedCanvas"]').prop("disabled",!0),void 0===document.createElement("cropper").style.transition&&($('button[data-method="rotate"]').prop("disabled",!0),$('button[data-method="scale"]').prop("disabled",!0)),void 0===l[0].download&&l.addClass("disabled"),$(".docs-toggles").on("change","input",function(){var e,t,a=$(this),o=a.attr("name"),r=a.prop("type");n.data("cropper")&&("checkbox"===r?(v[o]=a.prop("checked"),e=n.cropper("getCropBoxData"),t=n.cropper("getCanvasData"),v.ready=function(){n.cropper("setCropBoxData",e),n.cropper("setCanvasData",t)}):"radio"===r&&(v[o]=a.val()),n.cropper("destroy").cropper(v))}),$(".docs-buttons").on("click","[data-method]",function(){var e,t,a,o=$(this),r=o.data(),d=n.data("cropper");if(!o.prop("disabled")&&!o.hasClass("disabled")&&d&&r.method){if(void 0!==(r=$.extend({},r)).target&&(t=$(r.target),void 0===r.option))try{r.option=JSON.parse(t.val())}catch(e){c.log(e.message)}switch(e=d.cropped,r.method){case"rotate":e&&0