1(self.webpackChunkapp=self.webpackChunkapp||[]).push([[4903],{4903:(Ft,nt,B)=>{"use strict";B.r(nt),B.d(nt,{CropperModalPage:()=>Et});var lt=B(467),et=B(177),dt=B(4341),xt=B(1054),Dt=B.n(xt),l=B(4438);const kt=["image"];function Ct(x,O){1&x&&(l.j41(0,"div",6),l.nrm(1,"div",7),l.k0s())}function Rt(x,O){if(1&x&&(l.j41(0,"div",8),l.EFF(1),l.k0s()),2&x){const w=l.XpG();l.R7$(),l.JRh(w.loadImageErrorText)}}let _t=(()=>{class x{constructor(){this.cropperOptions={},this.export=new l.bkB,this.ready=new l.bkB,this.isLoading=!0}ngOnInit(){}ngOnDestroy(){this.cropper&&(this.cropper.destroy(),this.cropper=null)}imageLoaded(w){this.loadError=!1;const g=w.target;this.imageElement=g,this.cropperOptions.checkCrossOrigin&&(g.crossOrigin="anonymous"),g.addEventListener("ready",()=>{this.ready.emit(!0),this.isLoading=!1,this.cropbox&&this.cropper.setCropBoxData(this.cropbox)});let m=NaN;if(this.settings){const{width:M,height:L}=this.settings;m=M/L}this.cropperOptions={aspectRatio:m,checkCrossOrigin:!0,...this.cropperOptions},this.cropper&&(this.cropper.destroy(),this.cropper=void 0),this.cropper=new xt(g,this.cropperOptions)}imageLoadError(w){this.loadError=!0,this.isLoading=!1}exportCanvas(w){const g=this.cropper.getImageData(),m=this.cropper.getCropBoxData(),M=this.cropper.getCroppedCanvas(),L={imageData:g,cropData:m};new Promise(G=>{if(w)return G({dataUrl:M.toDataURL("image/png")});M.toBlob(vt=>G({blob:vt}))}).then(G=>{this.export.emit({...L,...G})})}}return x.\u0275fac=function(w){return new(w||x)},x.\u0275cmp=l.VBU({type:x,selectors:[["angular-cropper"]],viewQuery:function(w,g){if(1&w&&l.GBs(kt,7),2&w){let m;l.mGM(m=l.lsd())&&(g.image=m.first)}},inputs:{imageUrl:"imageUrl",settings:"settings",cropbox:"cropbox",loadImageErrorText:"loadImageErrorText",cropperOptions:"cropperOptions"},outputs:{export:"export",ready:"ready"},decls:6,vars:3,consts:[["image",""],[1,"cropper-wrapper"],["class","loading-block",4,"ngIf"],["class","alert alert-warning",4,"ngIf"],[1,"cropper"],["alt","image",3,"load","error","src"],[1,"loading-block"],[1,"spinner"],[1,"alert","alert-warning"]],template:function(w,g){if(1&w){const m=l.RV6();l.j41(0,"div",1),l.DNE(1,Ct,2,0,"div",2)(2,Rt,2,1,"div",3),l.j41(3,"div",4)(4,"img",5,0),l.bIt("load",function(L){return l.eBV(m),l.Njj(g.imageLoaded(L))})("error",function(L){return l.eBV(m),l.Njj(g.imageLoadError(L))}),l.k0s()()()}2&w&&(l.R7$(),l.Y8G("ngIf",g.isLoading),l.R7$(),l.Y8G("ngIf",g.loadError),l.R7$(2),l.Y8G("src",g.imageUrl,l.B4B))},dependencies:[et.bT],styles:[':host{display:block}.cropper img{max-width:100%;max-height:100%;height:auto}.cropper-wrapper{position:relative;min-height:80px}.cropper-wrapper .loading-block{position:absolute;top:0;left:0;width:100%;height:100%}.cropper-wrapper .loading-block .spinner{width:31px;height:31px;margin:0 auto;border:2px solid rgba(97,100,193,.98);border-radius:50%;border-left-color:transparent;border-right-color:transparent;-webkit-animation:cssload-spin 425ms infinite linear;position:absolute;top:calc(50% - 15px);left:calc(50% - 15px);animation:cssload-spin 425ms infinite linear}@keyframes cssload-spin{to{transform:rotate(360deg)}}/*!\n * Cropper.js v1.4.1\n * https://fengyuanchen.github.io/cropperjs\n *\n * Copyright 2015-present Chen Fengyuan\n * Released under the MIT license\n *\n * Date: 2018-07-15T09:54:43.167Z\n */.cropper-container{direction:ltr;font-size:0;line-height:0;position:relative;touch-action:none;-webkit-user-select:none;-moz-user-select:none;user-select:none}.cropper-container img{display:block;height:100%;image-orientation:0deg;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;width:100%}.cropper-wrap-box,.cropper-canvas,.cropper-drag-box,.cropper-crop-box,.cropper-modal{inset:0;position:absolute}.cropper-wrap-box,.cropper-canvas{overflow:hidden}.cropper-drag-box{background-color:#fff;opacity:0}.cropper-modal{background-color:#000;opacity:.5}.cropper-view-box{display:block;height:100%;outline-color:#3399ffbf;outline:1px solid #39f;overflow:hidden;width:100%}.cropper-dashed{border:0 dashed #eee;display:block;opacity:.5;position:absolute}.cropper-dashed.dashed-h{border-bottom-width:1px;border-top-width:1px;height:calc(100% / 3);left:0;top:calc(100% / 3);width:100%}.cropper-dashed.dashed-v{border-left-width:1px;border-right-width:1px;height:100%;left:calc(100% / 3);top:0;width:calc(100% / 3)}.cropper-center{display:block;height:0;left:50%;opacity:.75;position:absolute;top:50%;width:0}.cropper-center:before,.cropper-center:after{background-color:#eee;content:" ";display:block;position:absolute}.cropper-center:before{height:1px;left:-3px;top:0;width:7px}.cropper-center:after{height:7px;left:0;top:-3px;width:1px}.cropper-face,.cropper-line,.cropper-point{display:block;height:100%;opacity:.1;position:absolute;width:100%}.cropper-face{background-color:#fff;left:0;top:0}.cropper-line{background-color:#39f}.cropper-line.line-e{cursor:ew-resize;right:-3px;top:0;width:5px}.cropper-line.line-n{cursor:ns-resize;height:5px;left:0;top:-3px}.cropper-line.line-w{cursor:ew-resize;left:-3px;top:0;width:5px}.cropper-line.line-s{bottom:-3px;
1cursor:ns-resize;height:5px;left:0}.cropper-point{background-color:#39f;height:5px;opacity:.75;width:5px}.cropper-point.point-e{cursor:ew-resize;margin-top:-3px;right:-3px;top:50%}.cropper-point.point-n{cursor:ns-resize;left:50%;margin-left:-3px;top:-3px}.cropper-point.point-w{cursor:ew-resize;left:-3px;margin-top:-3px;top:50%}.cropper-point.point-s{bottom:-3px;cursor:s-resize;left:50%;margin-left:-3px}.cropper-point.point-ne{cursor:nesw-resize;right:-3px;top:-3px}.cropper-point.point-nw{cursor:nwse-resize;left:-3px;top:-3px}.cropper-point.point-sw{bottom:-3px;cursor:nesw-resize;left:-3px}.cropper-point.point-se{bottom:-3px;cursor:nwse-resize;height:20px;opacity:1;right:-3px;width:20px}@media (min-width: 768px){.cropper-point.point-se{height:15px;width:15px}}@media (min-width: 992px){.cropper-point.point-se{height:10px;width:10px}}@media (min-width: 1200px){.cropper-point.point-se{height:5px;opacity:.75;width:5px}}.cropper-point.point-se:before{background-color:#39f;bottom:-50%;content:" ";display:block;height:200%;opacity:0;position:absolute;right:-50%;width:200%}.cropper-invisible{opacity:0}.cropper-bg{background-image:url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQAQMAAAAlPW0iAAAAA3NCSVQICAjb4U/gAAAABlBMVEXMzMz////TjRV2AAAACXBIWXMAAArrAAAK6wGCiw1aAAAAHHRFWHRTb2Z0d2FyZQBBZG9iZSBGaXJld29ya3MgQ1M26LyyjAAAABFJREFUCJlj+M/AgBVhF/0PAH6/D/HkDxOGAAAAAElFTkSuQmCC)}.cropper-hide{display:block;height:0;position:absolute;width:0}.cropper-hidden{display:none!important}.cropper-move{cursor:move}.cropper-crop{cursor:crosshair}.cropper-disabled .cropper-drag-box,.cropper-disabled .cropper-face,.cropper-disabled .cropper-line,.cropper-disabled .cropper-point{cursor:not-allowed}\n'],encapsulation:2}),x})(),ft=(()=>{class x{}return x.\u0275fac=function(w){return new(w||x)},x.\u0275mod=l.$C({type:x}),x.\u0275inj=l.G2t({imports:[et.MD]}),x})();var St=B(3901),Y=B(6462),H=B(8321),ut=B(8397);const gt=["imageElement"],E=["angularCropper"];function mt(x,O){if(1&x&&l.nrm(0,"angular-cropper",11,0),2&x){const w=l.XpG();l.Y8G("cropperOptions",w.cropperOptions)("imageUrl",w.imageData)}}function Mt(x,O){if(1&x){const w=l.RV6();l.j41(0,"ion-button",12),l.bIt("click",function(){l.eBV(w);const m=l.XpG();return l.Njj(m.getCroppedImage())}),l.EFF(1,"Recortar imagen"),l.k0s()}}let Et=(()=>{var x;class O{constructor(g,m,M){this.modalController=g,this.main=m,this.toastService=M,this.imageData=null,this.scaleValX=1,this.scaleValY=1,this.cropperOptions={dragMode:"crop",aspectRatio:1,autoCrop:!0,movable:!0,zoomable:!0,scalable:!0,autoCropArea:.8}}ngOnInit(){this.imageData=this.data}cancel(){var g=this;return(0,lt.A)(function*(){yield g.modalController.dismiss("cancel")})()}onImageLoad(){this.cropper=new(Dt())(this.imageElement.nativeElement,this.cropperOptions)}getCroppedImage(){var g=this;return(0,lt.A)(function*(){if(g.angularCropper.cropper){const M=g.angularCropper.cropper.getCroppedCanvas().toDataURL("image/png");console.log("Imagen recortada en Base64:",M),yield g.main.Login.updatePhotoDocumento(M).then(function(){var L=(0,lt.A)(function*(K){g.toastService.showToast("Se ha subido la imagen correctamente"),yield g.cancel()});return function(K){return L.apply(this,arguments)}}())}return null})()}reset(){this.angularCropper.cropper.reset()}clear(){this.angularCropper.cropper.clear()}rotate(){this.angularCropper.cropper.rotate(90)}zoom(g){this.angularCropper.cropper.zoom(g?.1:-.1)}scaleX(){this.scaleValX=-1*this.scaleValX,this.angularCropper.cropper.scaleX(this.scaleValX)}scaleY(){this.scaleValY=-1*this.scaleValY,this.angularCropper.cropper.scaleY(this.scaleValY)}move(g,m){this.angularCropper.cropper.move(g,m)}}return(x=O).\u0275fac=function(g){return new(g||x)(l.rXU(Y.W3),l.rXU(H.t),l.rXU(ut.f))},x.\u0275cmp=l.VBU({type:x,selectors:[["app-cropper-modal"]],viewQuery:function(g,m){if(1&g&&(l.GBs(gt,5),l.GBs(E,5)),2&g){let M;l.mGM(M=l.lsd())&&(m.imageElement=M.first),l.mGM(M=l.lsd())&&(m.angularCropper=M.first)}},standalone:!0,features:[l.aNF],decls:24,vars:2,consts:[["angularCropper",""],[1,"headerCustomizado","ion-no-border"],["slot","end"],[1,"fal","fa-times",3,"click"],[3,"cropperOptions","imageUrl",4,"ngIf"],[1,"btn","btn-primary","fal","fa-plus",3,"click"],["ion-button","","outline","","icon-left","","color","primary",1,"btn","btn-primary","fal","fa-minus",3,"click"],[1,"btn","btn-primary","fal","fa-repeat",3,"click"],[1,"btn","btn-primary","fal","fa-arrows-h",3,"click"],[1,"btn","btn-primary","fal","fa-arrows-v",3,"click"],[3,"click",4,"ngIf"],[3,"cropperOptions","imageUrl"],[3,"click"]],template:function(g,m){1&g&&(l.j41(0,"ion-header",1)(1,"ion-toolbar")(2,"ion-title"),l.EFF(3,"Recortar foto"),l.k0s(),l.j41(4,"ion-buttons",2)(5,"ion-icon",3),l.bIt("click",function(){return m.cancel()}),l.k0s()()()(),l.j41(6,"ion-content"),l.DNE(7,mt,2,2,"angular-cropper",4),l.j41(8,"button",5),l.bIt("click",function(){return m.zoom(!0)}),l.nrm(9,"ion-icon"),l.EFF(10," Zoom "),l.k0s(),l.j41(11,"button",6),l.bIt("click",function(){return m.zoom(!1)}),l.nrm(12,"ion-icon"),l.EFF(13," Zoom "),l.k0s(),l.j41(14,"button",7),l.bIt("click",function(){return m.rotate()}),l.nrm(15,"ion-icon"),l.EFF(16," Rotar "),l.k0s(),l.j41(17,"button",8),l.bIt("click",function(){return m.scaleX()}),l.nrm(18,"ion-icon"),l.EFF(19," Invertir eje X "),l.k0s(),l.j41(20,"button",9),l.bIt("click",function(){return m.scaleY()}),l.nrm(21,"ion-icon"),l.EFF(22," Invertir eje Y "),l.k0s()(),l.DNE(23,Mt,2,0,"ion-button",10)),2&g&&(l.R7$(7),l.Y8G("ngIf",m.imageData),l.R7$(16),l.Y8G("ngIf",m.imageData))},dependencies:[et.MD,et.bT,dt.YN,ft,_t,St.j,Y.W9,Y.iq,Y.eU,Y.ai,Y.BC,Y.Jm,Y.QW]}),O})()},1054:function(Ft){Ft.exports=function(){"use strict";function nt(a,t){var i=Object.keys(a);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(a);t&&(e=e.filter(function(n){return Object.getOwnPropertyDescriptor(a,n).enumerable})),i.push.apply(i,e)}return i}function B(a){for(var t=1;t<arguments.length;t++){var i=null!=arguments[t]?arguments[t]:{};
1t%2?nt(Object(i),!0).forEach(function(e){kt(a,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(i)):nt(Object(i)).forEach(function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(i,e))})}return a}function et(a){var t=function lt(a,t){if("object"!=typeof a||!a)return a;var i=a[Symbol.toPrimitive];if(void 0!==i){var e=i.call(a,t||"default");if("object"!=typeof e)return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(a)}(a,"string");return"symbol"==typeof t?t:t+""}function dt(a){return(dt="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(a)}function Dt(a,t){for(var i=0;i<t.length;i++){var e=t[i];e.enumerable=e.enumerable||!1,e.configurable=!0,"value"in e&&(e.writable=!0),Object.defineProperty(a,et(e.key),e)}}function kt(a,t,i){return(t=et(t))in a?Object.defineProperty(a,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[t]=i,a}function Ct(a){return function Rt(a){if(Array.isArray(a))return ft(a)}(a)||function $t(a){if(typeof Symbol<"u"&&null!=a[Symbol.iterator]||null!=a["@@iterator"])return Array.from(a)}(a)||function _t(a,t){if(a){if("string"==typeof a)return ft(a,t);var i=Object.prototype.toString.call(a).slice(8,-1);if("Object"===i&&a.constructor&&(i=a.constructor.name),"Map"===i||"Set"===i)return Array.from(a);if("Arguments"===i||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return ft(a,t)}}(a)||function St(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function ft(a,t){(null==t||t>a.length)&&(t=a.length);for(var i=0,e=new Array(t);i<t;i++)e[i]=a[i];return e}var Y=typeof window<"u"&&typeof window.document<"u",H=Y?window:{},ut=!(!Y||!H.document.documentElement)&&"ontouchstart"in H.document.documentElement,gt=!!Y&&"PointerEvent"in H,E="cropper",x="zoom",O="e",w="w",g="s",m="n",M="ne",L="nw",K="se",G="sw",vt="".concat(E,"-crop"),Qt="".concat(E,"-disabled"),P="".concat(E,"-hidden"),Zt="".concat(E,"-hide"),Ce="".concat(E,"-invisible"),At="".concat(E,"-modal"),It="".concat(E,"-move"),bt="".concat(E,"Action"),Tt="".concat(E,"Preview"),Bt="crop",Lt="crop",Pt="cropend",zt="cropmove",Xt="cropstart",qt="dblclick",te=gt?"pointerdown":ut?"touchstart":"mousedown",ee=gt?"pointermove":ut?"touchmove":"mousemove",ie=gt?"pointerup pointercancel":ut?"touchend touchcancel":"mouseup",Yt="zoom",ne="image/jpeg",Te=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,Oe=/^data:/,Ne=/^data:image\/jpeg;base64,/,ke=/^img|canvas$/i,ce={viewMode:0,dragMode:Bt,initialAspectRatio:NaN,aspectRatio:NaN,data:null,preview:"",responsive:!0,restore:!0,checkCrossOrigin:!0,checkOrientation:!0,modal:!0,guides:!0,center:!0,highlight:!0,background:!0,autoCrop:!0,autoCropArea:.8,movable:!0,rotatable:!0,scalable:!0,zoomable:!0,zoomOnTouch:!0,zoomOnWheel:!0,wheelZoomRatio:.1,cropBoxMovable:!0,cropBoxResizable:!0,toggleDragModeOnDblclick:!0,minCanvasWidth:0,minCanvasHeight:0,minCropBoxWidth:0,minCropBoxHeight:0,minContainerWidth:200,minContainerHeight:100,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},_e=Number.isNaN||H.isNaN;function v(a){return"number"==typeof a&&!_e(a)}var pe=function(t){return t>0&&t<1/0};function jt(a){return typeof a>"u"}function it(a){return"object"===dt(a)&&null!==a}var Se=Object.prototype.hasOwnProperty;function st(a){if(!it(a))return!1;try{var t=a.constructor,i=t.prototype;return t&&i&&Se.call(i,"isPrototypeOf")}catch{return!1}}function z(a){return"function"==typeof a}var Ie=Array.prototype.slice;function le(a){return Array.from?Array.from(a):Ie.call(a)}function N(a,t){return a&&z(t)&&(Array.isArray(a)||v(a.length)?le(a).forEach(function(i,e){t.call(a,i,e,a)}):it(a)&&Object.keys(a).forEach(function(i){t.call(a,a[i],i,a)})),a}var A=Object.assign||function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),n=1;n<i;n++)e[n-1]=arguments[n];return it(t)&&e.length>0&&e.forEach(function(r){it(r)&&Object.keys(r).forEach(function(o){t[o]=r[o]})}),t},Be=/\.\d*(?:0|9){12}\d*$/;function ht(a){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:1e11;return Be.test(a)?Math.round(a*t)/t:a}var Le=/^width|height|left|top|marginLeft|marginTop$/;function J(a,t){var i=a.style;N(t,function(e,n){Le.test(n)&&v(e)&&(e="".concat(e,"px")),i[n]=e})}function S(a,t){if(t){if(v(a.length))return void N(a,function(e){
vendor: 8,724 bytes, line 1
1S(e,t)});if(a.classList)return void a.classList.add(t);var i=a.className.trim();i?i.indexOf(t)<0&&(a.className="".concat(i," ").concat(t)):a.className=t}}function F(a,t){if(t){if(v(a.length))return void N(a,function(i){F(i,t)});if(a.classList)return void a.classList.remove(t);a.className.indexOf(t)>=0&&(a.className=a.className.replace(t,""))}}function ct(a,t,i){if(t){if(v(a.length))return void N(a,function(e){ct(e,t,i)});i?S(a,t):F(a,t)}}var ze=/([a-z\d])([A-Z])/g;function Ht(a){return a.replace(ze,"$1-$2").toLowerCase()}function Wt(a,t){return it(a[t])?a[t]:a.dataset?a.dataset[t]:a.getAttribute("data-".concat(Ht(t)))}function wt(a,t,i){it(i)?a[t]=i:a.dataset?a.dataset[t]=i:a.setAttribute("data-".concat(Ht(t)),i)}var de=/\s\s*/,fe=function(){var a=!1;if(Y){var t=!1,i=function(){},e=Object.defineProperty({},"once",{get:function(){return a=!0,t},set:function(r){t=r}});H.addEventListener("test",i,e),H.removeEventListener("test",i,e)}return a}();function V(a,t,i){var e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=i;t.trim().split(de).forEach(function(r){if(!fe){var o=a.listeners;o&&o[r]&&o[r][i]&&(n=o[r][i],delete o[r][i],0===Object.keys(o[r]).length&&delete o[r],0===Object.keys(o).length&&delete a.listeners)}a.removeEventListener(r,n,e)})}function W(a,t,i){var e=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{},n=i;t.trim().split(de).forEach(function(r){if(e.once&&!fe){var o=a.listeners,s=void 0===o?{}:o;n=function(){delete s[r][i],a.removeEventListener(r,n,e);for(var p=arguments.length,h=new Array(p),c=0;c<p;c++)h[c]=arguments[c];i.apply(a,h)},s[r]||(s[r]={}),s[r][i]&&a.removeEventListener(r,s[r][i],e),s[r][i]=n,a.listeners=s}a.addEventListener(r,n,e)})}function pt(a,t,i){var e;return z(Event)&&z(CustomEvent)?e=new CustomEvent(t,{detail:i,bubbles:!0,cancelable:!0}):(e=document.createEvent("CustomEvent")).initCustomEvent(t,!0,!0,i),a.dispatchEvent(e)}function ue(a){var t=a.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var Ut=H.location,Ye=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function ge(a){var t=a.match(Ye);return null!==t&&(t[1]!==Ut.protocol||t[2]!==Ut.hostname||t[3]!==Ut.port)}function me(a){var t="timestamp=".concat((new Date).getTime());return a+(-1===a.indexOf("?")?"?":"&")+t}function yt(a){var t=a.rotate,i=a.scaleX,e=a.scaleY,n=a.translateX,r=a.translateY,o=[];v(n)&&0!==n&&o.push("translateX(".concat(n,"px)")),v(r)&&0!==r&&o.push("translateY(".concat(r,"px)")),v(t)&&0!==t&&o.push("rotate(".concat(t,"deg)")),v(i)&&1!==i&&o.push("scaleX(".concat(i,")")),v(e)&&1!==e&&o.push("scaleY(".concat(e,")"));var s=o.length?o.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function Ot(a,t){var i=a.pageX,e=a.pageY,n={endX:i,endY:e};return t?n:B({startX:i,startY:e},n)}function q(a){var t=a.aspectRatio,i=a.height,e=a.width,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"contain",r=pe(e),o=pe(i);if(r&&o){var s=i*t;"contain"===n&&s>e||"cover"===n&&s<e?i=e/t:e=i*t}else r?i=e/t:o&&(e=i*t);return{width:e,height:i}}var ve=String.fromCharCode;var Ge=/^data:.*,/;function Qe(a){var i,t=new DataView(a);try{var e,n,r;if(255===t.getUint8(0)&&216===t.getUint8(1))for(var o=t.byteLength,s=2;s+1<o;){if(255===t.getUint8(s)&&225===t.getUint8(s+1)){n=s;break}s+=1}if(n){var p=n+10;if("Exif"===function Ve(a,t,i){var e="";i+=t;for(var n=t;n<i;n+=1)e+=ve(a.getUint8(n));return e}(t,n+4,4)){var h=t.getUint16(p);if(((e=18761===h)||19789===h)&&42===t.getUint16(p+2,e)){var c=t.getUint32(p+4,e);c>=8&&(r=p+c)}}}if(r){var y,b,d=t.getUint16(r,e);for(b=0;b<d;b+=1)if(274===t.getUint16(y=r+12*b+2,e)){i=t.getUint16(y+=8,e),t.setUint16(y,1,e);break}}}catch{i=1}return i}var Ke={render:function(){this.initContainer(),this.initCanvas(),this.initCropBox(),this.renderCanvas(),this.cropped&&this.renderCropBox()},initContainer:function(){var t=this.element,i=this.options,e=this.container,n=this.cropper,r=Number(i.minContainerWidth),o=Number(i.minContainerHeight);S(n,P),F(t,P);var s={width:Math.max(e.offsetWidth,r>=0?r:200),height:Math.max(e.offsetHeight,o>=0?o:100)};this.containerData=s,J(n,{width:s.width,height:s.height}),S(t,P),F(n,P)},initCanvas:function(){var t=this.containerData,i=this.imageData,e=this.options.viewMode,n=Math.abs(i.rotate)%180==90,r=n?i.naturalHeight:i.naturalWidth,o=n?i.naturalWidth:i.naturalHeight,s=r/o,f=t.width,p=t.height;t.height*s>t.width?3===e?f=t.height*s:p=t.width/s:3===e?p=t.width/s:f=t.height*s;var h={aspectRatio:s,naturalWidth:r,naturalHeight:o,width:f,height:p};this.canvasData=h,this.limited=1===e||2===e,this.limitCanvas(!0,!0),h.width=Math.min(Math.max(h.width,h.minWidth),h.maxWidth),h.height=Math.min(Math.max(h.height,h.minHeight),h.maxHeight),h.left=(t.width-h.width)/2,h.top=(t.height-h.height)/2,h.oldLeft=h.left,h.oldTop=h.top,this.initialCanvasData=A({},h)},limitCanvas:function(t,i){var e=this.options,n=this.containerData,r=this.canvasData,o=this.cropBoxData,s=e.viewMode,f=r.aspectRatio,p=this.cropped&&o;if(t){var h=Number(e.minCanvasWidth)||0,c=Number(e.minCanvasHeight)||0;s>1?(h=Math.max(h,n.width),c=Math.max(c,n.height),3===s&&(c*f>h?h=c*f:c=h/f)):s>0&&(h?h=Math.max(h,p?o.width:0):c?c=Math.max(c,p?o.height:0):p&&((c=o.height)*f>(h=o.width)?h=c*f:c=h/f));var d=q({aspectRatio:f,width:h,height:c});c=d.height,r.minWidth=h=d.width,r.minHeight=c,r.maxWidth=1/0,r.maxHeight=1/0}if(i)if(s>(p?0:1)){var y=n.width-r.width,b=n.height-r.height;r.minLeft=Math.min(0,y),r.minTop=Math.min(0,b),r.maxLeft=Math.max(0,y),r.maxTop=Math.max(0,b),p&&this.limited&&(r.minLeft=Math.min(o.left,o.left+(o.width-r.width)),r.minTop=Math.min(o.top,o.top+(o.height-r.height)),r.maxLeft=o.left,r.maxTop=o.top,2===s&&(r.width>=n.width&&(r.minLeft=Math.min(0,y),r.maxLeft=Math.max(0,y)),r.height>=n.height&&(r.minTop=Math.min(0,b),r.maxTop=Math.max(0,b))))}else r.minLeft=-r.width,r.minTop=-r.height,r.maxLeft=n.width,r.maxTop=n.height},renderCanvas:function(t,i){var e=this.canvasData,n=this.imageData;if(i){var r=function We(a){var t=a.width,i=a.height,e=a.degree;if(90==(e=Math.abs(e)%180))return{width:i,height:t};var n=e%90*Math.PI/180,r=Math.sin(n),o=Math.cos(n),s=t*o+i*r,f=t*r+i*o;return e>90?{width:f,height:s}:{width:s,height:f}}({width:n.naturalWidth*Math.abs(n.scaleX||1),height:n.naturalHeight*Math.abs(n.scaleY||1),degree:n.rotate||0}),o=r.width,s=r.height,f=e.width*(o/e.naturalWidth),p=e.height*(s/e.naturalHeight);e.left-=(f-e.width)/2,e.top-=(p-e.height)/2,e.width=f,e.height=p,e.aspectRatio=o/s,e.naturalWidth=o,e.naturalHeight=s,this.limitCanvas(!0,!1)}(e.width>e.maxWidth||e.width<e.minWidth)&&(e.left=e.oldLeft),(e.height>e.maxHeight||e.height<e.minHeight)&&(e.top=e.oldTop),e.width=Math.min(Math.max(e.width,e.minWidth),e.maxWidth),e.height=Math.min(Math.max(e.height,e.minHeight),e.maxHeight),this.limitCanvas(!1,!0),e.left=Math.min(Math.max(e.left,e.minLeft),e.maxLeft),e.top=Math.min(Math.max(e.top,e.minTop),e.maxTop),e.oldLeft=e.left,e.oldTop=e.top,J(this.canvas,A({width:e.width,height:e.height},yt({translateX:e.left,translateY:e.top}))),this.renderImage(t),this.cropped&&this.limited&&this.limitCropBox(!0,!0)},renderImage:function(t){var i=this.canvasData,e=this.imageData,n=e.naturalWidth*(i.width/i.naturalWidth),r=e.naturalHeight*(i.height/i.naturalHeight);A(e,{width:n,height:r,left:(i.width-n)/2,top:(i.height-r)/2}),J(this.image,A({width:e.width,height:e.height},yt(A({translateX:e.left,translateY:e.top},e)))),t&&this.output()},initCropBox:function(){var t=this.options,i=this.canvasData,e=t.aspectRatio||t.initialAspectRatio,n=Number(t.autoCropArea)||.8,r={width:i.width,height:i.height};e&&(i.height*e>i.width?r.height=r.width/e:r.width=r.height*e),this.cropBoxData=r,this.limitCropBox(!0,!0),r.width=Math.min(Math.max(r.width,r.minWidth),r.maxWidth),r.height=Math.min(Math.max(r.height,r.minHeight),r.maxHeight),r.width=Math.max(r.minWidth,r.width*n),r.height=Math.max(r.minHeight,r.height*n),r.left=i.left+(i.width-r.width)/2,r.top=i.top+(i.height-r.height)/2,r.oldLeft=r.left,r.oldTop=r.top,this.initialCropBoxData=A({},r)},limitCropBox:function(t,i){var e=this.options,n=this.containerData,r=this.canvasData,o=this.cropBoxData,s=this.limited,f=e.aspectRatio;if(t){var p=Number(e.minCropBoxWidth)||0,h=Number(e.minCropBoxHeight)||0,c=s?Math.min(n.width,r.width,r.width+r.left,n.width-r.left):n.width,d=s?Math.min(n.height,r.height,r.height+r.top,n.height-r.top):n.height;p=Math.min(p,n.width),h=Math.min(h,n.height),f&&(p&&h?h*f>p?h=p/f:p=h*f:p?h=p/f:h&&(p=h*f),d*f>c?d=c/f:c=d*f),o.minWidth=Math.min(p,c),o.minHeight=Math.min(h,d),o.maxWidth=c,o.maxHeight=d}i&&(s?(o.minLeft=Math.max(0,r.left),o.minTop=Math.max(0,r.top),o.maxLeft=Math.min(n.width,r.left+r.
1width)-o.width,o.maxTop=Math.min(n.height,r.top+r.height)-o.height):(o.minLeft=0,o.minTop=0,o.maxLeft=n.width-o.width,o.maxTop=n.height-o.height))},renderCropBox:function(){var t=this.options,i=this.containerData,e=this.cropBoxData;(e.width>e.maxWidth||e.width<e.minWidth)&&(e.left=e.oldLeft),(e.height>e.maxHeight||e.height<e.minHeight)&&(e.top=e.oldTop),e.width=Math.min(Math.max(e.width,e.minWidth),e.maxWidth),e.height=Math.min(Math.max(e.height,e.minHeight),e.maxHeight),this.limitCropBox(!1,!0),e.left=Math.min(Math.max(e.left,e.minLeft),e.maxLeft),e.top=Math.min(Math.max(e.top,e.minTop),e.maxTop),e.oldLeft=e.left,e.oldTop=e.top,t.movable&&t.cropBoxMovable&&wt(this.face,bt,e.width>=i.width&&e.height>=i.height?"move":"all"),J(this.cropBox,A({width:e.width,height:e.height},yt({translateX:e.left,translateY:e.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),pt(this.element,Lt,this.getData())}},Je={initPreview:function(){var t=this.element,i=this.crossOrigin,e=this.options.preview,n=i?this.crossOriginUrl:this.url,r=t.alt||"The image to preview",o=document.createElement("img");if(i&&(o.crossOrigin=i),o.src=n,o.alt=r,this.viewBox.appendChild(o),this.viewBoxImage=o,e){var s=e;"string"==typeof e?s=t.ownerDocument.querySelectorAll(e):e.querySelector&&(s=[e]),this.previews=s,N(s,function(f){var p=document.createElement("img");wt(f,Tt,{width:f.offsetWidth,height:f.offsetHeight,html:f.innerHTML}),i&&(p.crossOrigin=i),p.src=n,p.alt=r,p.style.cssText='display:block;width:100%;height:auto;min-width:0!important;min-height:0!important;max-width:none!important;max-height:none!important;image-orientation:0deg!important;"',f.innerHTML="",f.appendChild(p)})}},resetPreview:function(){N(this.previews,function(t){var i=Wt(t,Tt);J(t,{width:i.width,height:i.height}),t.innerHTML=i.html,function Xe(a,t){if(it(a[t]))try{delete a[t]}catch{a[t]=void 0}else if(a.dataset)try{delete a.dataset[t]}catch{a.dataset[t]=void 0}else a.removeAttribute("data-".concat(Ht(t)))}(t,Tt)})},preview:function(){var t=this.imageData,i=this.canvasData,e=this.cropBoxData,n=e.width,r=e.height,o=t.width,s=t.height,f=e.left-i.left-t.left,p=e.top-i.top-t.top;!this.cropped||this.disabled||(J(this.viewBoxImage,A({width:o,height:s},yt(A({translateX:-f,translateY:-p},t)))),N(this.previews,function(h){var c=Wt(h,Tt),d=c.width,y=c.height,b=d,T=y,D=1;n&&(T=r*(D=d/n)),r&&T>y&&(b=n*(D=y/r),T=y),J(h,{width:b,height:T}),J(h.getElementsByTagName("img")[0],A({width:o*D,height:s*D},yt(A({translateX:-f*D,translateY:-p*D},t))))}))}},qe={bind:function(){var t=this.element,i=this.options,e=this.cropper;z(i.cropstart)&&W(t,Xt,i.cropstart),z(i.cropmove)&&W(t,zt,i.cropmove),z(i.cropend)&&W(t,Pt,i.cropend),z(i.crop)&&W(t,Lt,i.crop),z(i.zoom)&&W(t,Yt,i.zoom),W(e,te,this.onCropStart=this.cropStart.bind(this)),i.zoomable&&i.zoomOnWheel&&W(e,"wheel",this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),i.toggleDragModeOnDblclick&&W(e,qt,this.onDblclick=this.dblclick.bind(this)),W(t.ownerDocument,ee,this.onCropMove=this.cropMove.bind(this)),W(t.ownerDocument,ie,this.onCropEnd=this.cropEnd.bind(this)),i.responsive&&W(window,"resize",this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,i=this.options,e=this.cropper;z(i.cropstart)&&V(t,Xt,i.cropstart),z(i.cropmove)&&V(t,zt,i.cropmove),z(i.cropend)&&V(t,Pt,i.cropend),z(i.crop)&&V(t,Lt,i.crop),z(i.zoom)&&V(t,Yt,i.zoom),V(e,te,this.onCropStart),i.zoomable&&i.zoomOnWheel&&V(e,"wheel",this.onWheel,{passive:!1,capture:!0}),i.toggleDragModeOnDblclick&&V(e,qt,this.onDblclick),V(t.ownerDocument,ee,this.onCropMove),V(t.ownerDocument,ie,this.onCropEnd),i.responsive&&V(window,"resize",this.onResize)}},ti={resize:function(){if(!this.disabled){var s,f,t=this.options,i=this.container,e=this.containerData,n=i.offsetWidth/e.width,r=i.offsetHeight/e.height,o=Math.abs(n-1)>Math.abs(r-1)?n:r;1!==o&&(t.restore&&(s=this.getCanvasData(),f=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(N(s,function(p,h){s[h]=p*o})),this.setCropBoxData(N(f,function(p,h){f[h]=p*o}))))}},dblclick:function(){this.disabled||"none"===this.options.dragMode||this.setDragMode(function Pe(a,t){return a.classList?a.classList.contains(t):a.className.indexOf(t)>-1}(this.dragBox,vt)?"move":Bt)},wheel:function(t){var i=this,e=Number(this.options.wheelZoomRatio)||.1,n=1;this.disabled||(t.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){i.wheeling=!1},50),t.deltaY?n=t.deltaY>0?1:-1:t.wheelDelta?n=-t.wheelDelta/120:t.detail&&(n=t.detail>0?1:-1),this.zoom(-n*e,t)))},cropStart:function(t){var i=t.buttons,e=t.button;if(!(this.disabled||("mousedown"===t.type||"pointerdown"===t.type&&"mouse"===t.pointerType)&&(v(i)&&1!==i||v(e)&&0!==e||t.ctrlKey))){var o,n=this.options,r=this.pointers;t.changedTouches?N(t.changedTouches,function(s){r[s.identifier]=Ot(s)}):r[t.pointerId||0]=Ot(t),o=Object.keys(r).length>1&&n.zoomable&&n.zoomOnTouch?x:Wt(t.target,bt),Te.test(o)&&!1!==pt(this.element,Xt,{originalEvent:t,action:o})&&(t.preventDefault(),this.action=o,this.cropping=!1,"crop"===o&&(this.cropping=!0,S(this.dragBox,At)))}},cropMove:function(t){var i=this.action;if(!this.disabled&&i){var e=this.pointers;t.preventDefault(),!1!==pt(this.element,zt,{originalEvent:t,action:i})&&(t.changedTouches?N(t.changedTouches,function(n){A(e[n.identifier]||{},Ot(n,!0))}):A(e[t.pointerId||0]||{},Ot(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var i=this.action,e=this.pointers;t.changedTouches?N(t.changedTouches,function(n){delete e[n.identifier]}):delete e[t.pointerId||0],i&&(t.preventDefault(),Object.keys(e).length||(this.action=""),this.cropping&&(this.cropping=!1,ct(this.dragBox,At,this.cropped&&this.options.modal)),pt(this.element,Pt,{originalEvent:t,action:i}))}}},ei={change:function(t){var Q,e=this.canvasData,n=this.containerData,r=this.cropBoxData,o=this.pointers,s=this.action,f=this.options.aspectRatio,p=r.left,h=r.top,c=r.width,d=r.height,y=p+c,b=h+d,T=0,D=0,R=n.width,I=n.height,k=!0;
vendor: 6,948 bytes, line 1
1!f&&t.shiftKey&&(f=c&&d?c/d:1),this.limited&&(D=r.minTop,R=(T=r.minLeft)+Math.min(n.width,e.width,e.left+e.width),I=D+Math.min(n.height,e.height,e.top+e.height));var j=o[Object.keys(o)[0]],u={x:j.endX-j.startX,y:j.endY-j.startY},C=function(U){switch(U){case O:y+u.x>R&&(u.x=R-y);break;case w:p+u.x<T&&(u.x=T-p);break;case m:h+u.y<D&&(u.y=D-h);break;case g:b+u.y>I&&(u.y=I-b)}};switch(s){case"all":p+=u.x,h+=u.y;break;case O:if(u.x>=0&&(y>=R||f&&(h<=D||b>=I))){k=!1;break}C(O),(c+=u.x)<0&&(s=w,p-=c=-c),f&&(h+=(r.height-(d=c/f))/2);break;case m:if(u.y<=0&&(h<=D||f&&(p<=T||y>=R))){k=!1;break}C(m),h+=u.y,(d-=u.y)<0&&(s=g,h-=d=-d),f&&(p+=(r.width-(c=d*f))/2);break;case w:if(u.x<=0&&(p<=T||f&&(h<=D||b>=I))){k=!1;break}C(w),p+=u.x,(c-=u.x)<0&&(s=O,p-=c=-c),f&&(h+=(r.height-(d=c/f))/2);break;case g:if(u.y>=0&&(b>=I||f&&(p<=T||y>=R))){k=!1;break}C(g),(d+=u.y)<0&&(s=m,h-=d=-d),f&&(p+=(r.width-(c=d*f))/2);break;case M:if(f){if(u.y<=0&&(h<=D||y>=R)){k=!1;break}C(m),h+=u.y,c=(d-=u.y)*f}else C(m),C(O),u.x>=0?y<R?c+=u.x:u.y<=0&&h<=D&&(k=!1):c+=u.x,u.y<=0?h>D&&(d-=u.y,h+=u.y):(d-=u.y,h+=u.y);c<0&&d<0?(s=G,h-=d=-d,p-=c=-c):c<0?(s=L,p-=c=-c):d<0&&(s=K,h-=d=-d);break;case L:if(f){if(u.y<=0&&(h<=D||p<=T)){k=!1;break}C(m),h+=u.y,p+=r.width-(c=(d-=u.y)*f)}else C(m),C(w),u.x<=0?p>T?(c-=u.x,p+=u.x):u.y<=0&&h<=D&&(k=!1):(c-=u.x,p+=u.x),u.y<=0?h>D&&(d-=u.y,h+=u.y):(d-=u.y,h+=u.y);c<0&&d<0?(s=K,h-=d=-d,p-=c=-c):c<0?(s=M,p-=c=-c):d<0&&(s=G,h-=d=-d);break;case G:if(f){if(u.x<=0&&(p<=T||b>=I)){k=!1;break}C(w),p+=u.x,d=(c-=u.x)/f}else C(g),C(w),u.x<=0?p>T?(c-=u.x,p+=u.x):u.y>=0&&b>=I&&(k=!1):(c-=u.x,p+=u.x),u.y>=0?b<I&&(d+=u.y):d+=u.y;c<0&&d<0?(s=M,h-=d=-d,p-=c=-c):c<0?(s=K,p-=c=-c):d<0&&(s=L,h-=d=-d);break;case K:if(f){if(u.x>=0&&(y>=R||b>=I)){k=!1;break}C(O),d=(c+=u.x)/f}else C(g),C(O),u.x>=0?y<R?c+=u.x:u.y>=0&&b>=I&&(k=!1):c+=u.x,u.y>=0?b<I&&(d+=u.y):d+=u.y;c<0&&d<0?(s=L,h-=d=-d,p-=c=-c):c<0?(s=G,p-=c=-c):d<0&&(s=M,h-=d=-d);break;case"move":this.move(u.x,u.y),k=!1;break;case x:this.zoom(function je(a){var t=B({},a),i=0;return N(a,function(e,n){delete t[n],N(t,function(r){var o=Math.abs(e.startX-r.startX),s=Math.abs(e.startY-r.startY),f=Math.abs(e.endX-r.endX),p=Math.abs(e.endY-r.endY),h=Math.sqrt(o*o+s*s),d=(Math.sqrt(f*f+p*p)-h)/h;Math.abs(d)>Math.abs(i)&&(i=d)})}),i}(o),t),k=!1;break;case"crop":if(!u.x||!u.y){k=!1;break}Q=ue(this.cropper),p=j.startX-Q.left,h=j.startY-Q.top,c=r.minWidth,d=r.minHeight,u.x>0?s=u.y>0?K:M:u.x<0&&(p-=c,s=u.y>0?G:L),u.y<0&&(h-=d),this.cropped||(F(this.cropBox,P),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0))}k&&(r.width=c,r.height=d,r.left=p,r.top=h,this.action=s,this.renderCropBox()),N(o,function(_){_.startX=_.endX,_.startY=_.endY})}},ii={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&S(this.dragBox,At),F(this.cropBox,P),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=A({},this.initialImageData),this.canvasData=A({},this.initialCanvasData),this.cropBoxData=A({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(A(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),F(this.dragBox,At),S(this.cropBox,P)),this},replace:function(t){var i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];return!this.disabled&&t&&(this.isImg&&(this.element.src=t),i?(this.url=t,this.image.src=t,this.ready&&(this.viewBoxImage.src=t,N(this.previews,function(e){e.getElementsByTagName("img")[0].src=t}))):(this.isImg&&(this.replaced=!0),this.options.data=null,this.uncreate(),this.load(t))),this},enable:function(){return this.ready&&this.disabled&&(this.disabled=!1,F(this.cropper,Qt)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,S(this.cropper,Qt)),this},destroy:function(){var t=this.element;return t[E]?(t[E]=void 0,this.isImg&&this.replaced&&(t.src=this.originalUrl),this.uncreate(),this):this},move:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,e=this.canvasData,n=e.left,r=e.top;return this.moveTo(jt(t)?t:n+Number(t),jt(i)?i:r+Number(i))},moveTo:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,e=this.canvasData,n=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.movable&&(v(t)&&(e.left=t,n=!0),v(i)&&(e.top=i,n=!0),n&&this.renderCanvas(!0)),this},zoom:function(t,i){var e=this.canvasData;return t=Number(t),this.zoomTo(e.width*(t=t<0?1/(1-t):1+t)/e.naturalWidth,null,i)},zoomTo:function(t,i,e){var n=this.options,r=this.canvasData,o=r.width,s=r.height,f=r.naturalWidth,p=r.naturalHeight;if((t=Number(t))>=0&&this.ready&&!this.disabled&&n.zoomable){var h=f*t,c=p*t;if(!1===pt(this.element,Yt,{ratio:t,oldRatio:o/f,originalEvent:e}))return this;if(e){var d=this.pointers,y=ue(this.cropper),b=d&&Object.keys(d).length?function He(a){var t=0,i=0,e=0;return N(a,function(n){t+=n.startX,i+=n.startY,e+=1}),{pageX:t/=e,pageY:i/=e}}(d):{pageX:e.pageX,pageY:e.pageY};r.left-=(b.pageX-y.left-r.left)/o*(h-o),r.top-=(b.pageY-y.top-r.top)/s*(c-s)}else st(i)&&v(i.x)&&v(i.y)?(r.left-=(i.x-r.left)/o*(h-o),r.top-=(i.y-r.top)/s*(c-s)):(r.left-=(h-o)/2,r.top-=(c-s)/2);r.width=h,r.height=c,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return v(t=Number(t))&&this.ready&&!this.disabled&&this.options.rotatable&&(this.imageData.rotate=t%360,this.renderCanvas(!0,!0)),this},scaleX:function(t){var i=this.imageData.scaleY;return this.scale(t,v(i)?i:1)},scaleY:function(t){var i=this.imageData.scaleX;return this.scale(v(i)?i:1,t)},scale:function(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:t,e=this.imageData,n=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.scalable&&(v(t)&&(e.scaleX=t,n=!0),v(i)&&(e.scaleY=i,n=!0),n&&this.renderCanvas(!0,!0)),this},getData:function(){var o,t=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=this.options,e=this.imageData,n=this.canvasData,r=this.cropBoxData;if(this.ready&&this.cropped){var s=e.width/e.naturalWidth;if(N(o={x:r.left-n.left,y:r.top-n.top,width:r.width,height:r.height},function(h,c){o[c]=h/s}),t){var f=Math.round(o.y+o.height),p=Math.round(o.x+o.width);o.x=Math.round(o.x),o.y=Math.round(o.y),o.width=p-o.x,o.height=f-o.y}}else o={x:0,y:0,width:0,height:0};return i.rotatable&&(o.rotate=e.rotate||0),i.scalable&&(o.scaleX=e.scaleX||1,o.scaleY=e.scaleY||1),o},setData:function(t){var i=this.options,e=this.imageData,n=this.canvasData,r={};if(this.ready&&!this.disabled&&st(t)){var o=!1;i.rotatable&&v(t.rotate)&&t.rotate!==e.rotate&&(e.rotate=t.rotate,o=!0),i.scalable&&(v(t.scaleX)&&t.scaleX!==e.scaleX&&(e.scaleX=t.scaleX,o=!0),v(t.scaleY)&&t.scaleY!==e.scaleY&&(e.scaleY=t.
vendor: 1,129 bytes, line 1
1scaleY,o=!0)),o&&this.renderCanvas(!0,!0);var s=e.width/e.naturalWidth;v(t.x)&&(r.left=t.x*s+n.left),v(t.y)&&(r.top=t.y*s+n.top),v(t.width)&&(r.width=t.width*s),v(t.height)&&(r.height=t.height*s),this.setCropBoxData(r)}return this},getContainerData:function(){return this.ready?A({},this.containerData):{}},getImageData:function(){return this.sized?A({},this.imageData):{}},getCanvasData:function(){var t=this.canvasData,i={};return this.ready&&N(["left","top","width","height","naturalWidth","naturalHeight"],function(e){i[e]=t[e]}),i},setCanvasData:function(t){var i=this.canvasData,e=i.aspectRatio;return this.ready&&!this.disabled&&st(t)&&(v(t.left)&&(i.left=t.left),v(t.top)&&(i.top=t.top),v(t.width)?(i.width=t.width,i.height=t.width/e):v(t.height)&&(i.height=t.height,i.width=t.height*e),this.renderCanvas(!0)),this},getCropBoxData:function(){var i,t=this.cropBoxData;return this.ready&&this.cropped&&(i={left:t.left,top:t.top,width:t.width,height:t.height}),i||{}},setCropBoxData:function(t){var n,r,i=this.cropBoxData,e=this.options.aspectRatio;return this.ready&&this.cropped&&!this.disabled&&st(t)&&(v(t.left)&&(i.left
vendor: 1,299 bytes, line 1
1=t.left),v(t.top)&&(i.top=t.top),v(t.width)&&t.width!==i.width&&(n=!0,i.width=t.width),v(t.height)&&t.height!==i.height&&(r=!0,i.height=t.height),e&&(n?i.height=i.width/e:r&&(i.width=i.height*e)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var i=this.canvasData,e=function Ue(a,t,i,e){var n=t.aspectRatio,r=t.naturalWidth,o=t.naturalHeight,s=t.rotate,f=void 0===s?0:s,p=t.scaleX,h=void 0===p?1:p,c=t.scaleY,d=void 0===c?1:c,y=i.aspectRatio,b=i.naturalWidth,T=i.naturalHeight,D=e.fillColor,R=void 0===D?"transparent":D,I=e.imageSmoothingEnabled,k=void 0===I||I,Q=e.imageSmoothingQuality,j=void 0===Q?"low":Q,u=e.maxWidth,C=void 0===u?1/0:u,_=e.maxHeight,U=void 0===_?1/0:_,Z=e.minWidth,at=void 0===Z?0:Z,rt=e.minHeight,tt=void 0===rt?0:rt,$=document.createElement("canvas"),X=$.getContext("2d"),ot=q({aspectRatio:y,width:C,height:U}),Nt=q({aspectRatio:y,width:at,height:tt},"cover"),Vt=Math.min(ot.width,Math.max(Nt.width,b)),Gt=Math.min(ot.height,Math.max(Nt.height,T)),we=q({aspectRatio:n,width:C,height:U}),ye=q({aspectRatio:n,width:at,height:tt},"cover"),xe=Math.min(we.width,Math.max(ye.width,r)),De=Math.min(we.height,Math.max(ye.height,o)),ri=[-xe/2,-De/2,xe,De];
1return $.width=ht(Vt),$.height=ht(Gt),X.fillStyle=R,X.fillRect(0,0,Vt,Gt),X.save(),X.translate(Vt/2,Gt/2),X.rotate(f*Math.PI/180),X.scale(h,d),X.imageSmoothingEnabled=k,X.imageSmoothingQuality=j,X.drawImage.apply(X,[a].concat(Ct(ri.map(function(oi){return Math.floor(ht(oi))})))),X.restore(),$}(this.image,this.imageData,i,t);if(!this.cropped)return e;var n=this.getData(t.rounded),r=n.x,o=n.y,s=n.width,f=n.height,p=e.width/Math.floor(i.naturalWidth);1!==p&&(r*=p,o*=p,s*=p,f*=p);var h=s/f,c=q({aspectRatio:h,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),d=q({aspectRatio:h,width:t.minWidth||0,height:t.minHeight||0},"cover"),y=q({aspectRatio:h,width:t.width||(1!==p?e.width:s),height:t.height||(1!==p?e.height:f)}),b=y.width,T=y.height;b=Math.min(c.width,Math.max(d.width,b)),T=Math.min(c.height,Math.max(d.height,T));var D=document.createElement("canvas"),R=D.getContext("2d");D.width=ht(b),D.height=ht(T),R.fillStyle=t.fillColor||"transparent",R.fillRect(0,0,b,T);var I=t.imageSmoothingEnabled,Q=t.imageSmoothingQuality;R.imageSmoothingEnabled=void 0===I||I,Q&&(R.imageSmoothingQuality=Q);var U,Z,at,rt,tt,$,j=e.width,u=e.height,C=r,_=o;C<=-s||C>j?(C=0,U=0,at=0,tt=0):C<=0?(at=-C,C=0,tt=U=Math.min(j,s+C)):C<=j&&(at=0,tt=U=Math.min(s,j-C)),U<=0||_<=-f||_>u?(_=0,Z=0,rt=0,$=0):_<=0?(rt=-_,_=0,$=Z=Math.min(u,f+_)):_<=u&&(rt=0,$=Z=Math.min(f,u-_));var X=[C,_,U,Z];if(tt>0&&$>0){var ot=b/s;X.push(at*ot,rt*ot,tt*ot,$*ot)}return R.drawImage.apply(R,[e].concat(Ct(X.map(function(Nt){return Math.floor(ht(Nt))})))),D},setAspectRatio:function(t){var i=this.options;return!this.disabled&&!jt(t)&&(i.aspectRatio=Math.max(0,t)||NaN,this.ready&&(this.initCropBox(),this.cropped&&this.renderCropBox())),this},setDragMode:function(t){var i=this.options,e=this.dragBox,n=this.face;if(this.ready&&!this.disabled){var r=t===Bt,o=i.movable&&"move"===t;i.dragMode=t=r||o?t:"none",wt(e,bt,t),ct(e,vt,r),ct(e,It,o),i.cropBoxMovable||(wt(n,bt,t),ct(n,vt,r),ct(n,It,o))}return this}},ai=H.Cropper,be=function(){function a(t){var i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function xt(a,t){if(!(a instanceof t))throw new TypeError("Cannot call a class as a function")}(this,a),!t||!ke.test(t.tagName))throw new Error("The first argument is required and must be an <img> or <canvas> element.");this.element=t,this.options=A({},ce,st(i)&&i),this.cropped=!1,this.disabled=!1,this.pointers={},this.ready=!1,this.reloading=!1,this.replaced=!1,this.sized=!1,this.sizing=!1,this.init()}return function l(a,t,i){return t&&Dt(a.prototype,t),i&&Dt(a,i),Object.defineProperty(a,"prototype",{writable:!1}),a}(a,[{key:"init",value:function(){var n,i=this.element,e=i.tagName.toLowerCase();if(!i[E]){if(i[E]=this,"img"===e){if(this.isImg=!0,n=i.getAttribute("src")||"",this.originalUrl=n,!n)return;n=i.src}else"canvas"===e&&window.HTMLCanvasElement&&(n=i.toDataURL());this.load(n)}}},{key:"load",value:function(i){var e=this;if(i){this.url=i,this.imageData={};var n=this.element,r=this.options;if(!r.rotatable&&!r.scalable&&(r.checkOrientation=!1),!r.checkOrientation||!window.ArrayBuffer)return void this.clone();if(Oe.test(i))return void(Ne.test(i)?this.read(function Fe(a){var t=a.replace(Ge,""),i=atob(t),e=new ArrayBuffer(i.length),n=new Uint8Array(e);return N(n,function(r,o){n[o]=i.charCodeAt(o)}),e}(i)):this.clone());var o=new XMLHttpRequest,s=this.clone.bind(this);this.reloading=!0,this.xhr=o,o.onabort=s,o.onerror=s,o.ontimeout=s,o.onprogress=function(){o.getResponseHeader("content-type")!==ne&&o.abort()},o.onload=function(){e.read(o.response)},o.onloadend=function(){e.reloading=!1,e.xhr=null},r.checkCrossOrigin&&ge(i)&&n.crossOrigin&&(i=me(i)),o.open("GET",i,!0),o.responseType="arraybuffer",o.withCredentials="use-credentials"===n.crossOrigin,o.send()}}},{key:"read",value:function(i){var e=this.options,n=this.imageData,r=Qe(i),o=0,s=1,f=1;if(r>1){this.url=function $e(a,t){for(var i=[],n=new Uint8Array(a);n.length>0;)i.push(ve.apply(null,le(n.subarray(0,8192)))),n=n.subarray(8192);return"data:".concat(t,";base64,").concat(btoa(i.join("")))}(i,ne);var p=function Ze(a){var t=0,i=1,e=1;switch(a){case 2:i=-1;break;case 3:t=-180;break;case 4:e=-1;break;case 5:t=90,e=-1;break;case 6:t=90;break;case 7:t=90,i=-1;break;case 8:t=-90}return{rotate:t,scaleX:i,scaleY:e}}(r);o=p.rotate,s=p.scaleX,f=p.scaleY}e.rotatable&&(n.rotate=o),e.scalable&&(n.scaleX=s,n.scaleY=f),this.clone()}},{key:"clone",value:function(){var i=this.element,e=this.url,n=i.crossOrigin,r=e;this.options.checkCrossOrigin&&ge(e)&&(n||(n="anonymous"),r=me(e)),this.crossOrigin=n,this.crossOriginUrl=r;var o=document.createElement("img");n&&(o.crossOrigin=n),o.src=r||e,o.alt=i.alt||"The image to crop",this.image=o,o.onload=this.start.bind(this),o.onerror=this.stop.bind(this),S(o,Zt),i.parentNode.insertBefore(o,i.nextSibling)}},{key:"start",value:function(){var i=this,e=this.image;e.onload=null,e.onerror=null,this.sizing=!0;var n=H.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(H.navigator.userAgent),r=function(p,h){A(i.imageData,{naturalWi
vendor: 3,775 bytes, line 1
1dth:p,naturalHeight:h,aspectRatio:p/h}),i.initialImageData=A({},i.imageData),i.sizing=!1,i.sized=!0,i.build()};if(!e.naturalWidth||n){var o=document.createElement("img"),s=document.body||document.documentElement;this.sizingImage=o,o.onload=function(){r(o.width,o.height),n||s.removeChild(o)},o.src=e.src,n||(o.style.cssText="left:0;max-height:none!important;max-width:none!important;min-height:0!important;min-width:0!important;opacity:0;position:absolute;top:0;z-index:-1;",s.appendChild(o))}else r(e.naturalWidth,e.naturalHeight)}},{key:"stop",value:function(){var i=this.image;i.onload=null,i.onerror=null,i.parentNode.removeChild(i),this.image=null}},{key:"build",value:function(){if(this.sized&&!this.ready){var i=this.element,e=this.options,n=this.image,r=i.parentNode,o=document.createElement("div");o.innerHTML='<div class="cropper-container" touch-action="none"><div class="cropper-wrap-box"><div class="cropper-canvas"></div></div><div class="cropper-drag-box"></div><div class="cropper-crop-box"><span class="cropper-view-box"></span><span class="cropper-dashed dashed-h"></span><span class="cropper-dashed dashed-v"></span><span class="cropper-center"></span><span class="cropper-face"></span><span class="cropper-line line-e" data-cropper-action="e"></span><span class="cropper-line line-n" data-cropper-action="n"></span><span class="cropper-line line-w" data-cropper-action="w"></span><span class="cropper-line line-s" data-cropper-action="s"></span><span class="cropper-point point-e" data-cropper-action="e"></span><span class="cropper-point point-n" data-cropper-action="n"></span><span class="cropper-point point-w" data-cropper-action="w"></span><span class="cropper-point point-s" data-cropper-action="s"></span><span class="cropper-point point-ne" data-cropper-action="ne"></span><span class="cropper-point point-nw" data-cropper-action="nw"></span><span class="cropper-point point-sw" data-cropper-action="sw"></span><span class="cropper-point point-se" data-cropper-action="se"></span></div></div>';var s=o.querySelector(".".concat(E,"-container")),f=s.querySelector(".".concat(E,"-canvas")),p=s.querySelector(".".concat(E,"-drag-box")),h=s.querySelector(".".concat(E,"-crop-box")),c=h.querySelector(".".concat(E,"-face"));this.container=r,this.cropper=s,this.canvas=f,this.dragBox=p,this.cropBox=h,this.viewBox=s.querySelector(".".concat(E,"-view-box")),this.face=c,f.appendChild(n),S(i,P),r.insertBefore(s,i.nextSibling),F(n,Zt),this.initPreview(),this.bind(),e.initialAspectRatio=Math.max(0,e.initialAspectRatio)||NaN,e.aspectRatio=Math.max(0,e.aspectRatio)||NaN,e.viewMode=Math.max(0,Math.min(3,Math.round(e.viewMode)))||0,S(h,P),e.guides||S(h.getElementsByClassName("".concat(E,"-dashed")),P),e.center||S(h.getElementsByClassName("".concat(E,"-center")),P),e.background&&S(s,"".concat(E,"-bg")),e.highlight||S(c,Ce),e.cropBoxMovable&&(S(c,It),wt(c,bt,"all")),e.cropBoxResizable||(S(h.getElementsByClassName("".concat(E,"-line")),P),S(h.getElementsByClassName("".concat(E,"-point")),P)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),z(e.ready)&&W(i,"ready",e.ready,{once:!0}),pt(i,"ready")}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var i=this.cropper.parentNode;i&&i.removeChild(this.cropper),F(this.element,P)}}},{key:"uncreate",value:function(){this.ready?(this.unbuild(),this.ready=!1,this.cropped=!1):this.sizing?(this.sizingImage.onload=null,this.sizing=!1,this.sized=!1):this.reloading?(this.xhr.onabort=null,this.xhr.abort()):this.image&&this.stop()}}],[{key:"noConflict",value:function(){return window.Cropper=ai,a}},{key:"setDefaults",value:function(i){A(ce,st(i)&&i)}}])}();return A(be.prototype,Ke,Je,qe,ti,ei,ii),be}()}}]);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.