vendor: 29,791 bytes, lines 1-10
1import{saveResultFile as ye}from"./ctResultAccessAd-k2-xEPO1.js";import{a as xe,c as kt}from"./fileDropzone-CA_uaFcV.js";import"./FileSaver.min-BR20wtAe.js";import"./_commonjsHelpers-BosuxZz1.js";import"./ctFullscreenAd-wL9Ec5Hb.js";import"./app-Dsk0FNLH.js";import"./transientNotice-Ds_di7lD.js";/*! 2 * Cropper.js v1.6.2 3 * https://fengyuanchen.github.io/cropperjs 4 * 5 * Copyright 2015-present Chen Fengyuan 6 * Released under the MIT license 7 * 8 * Date: 2024-04-21T07:43:05.335Z 9 */function Xt(a,t){var i=Object.keys(a);if(Object.getOwnPropertySymbols){var e=Object.getOwnPropertySymbols(a);t&&(e=e.filter(function(o){return Object.getOwnPropertyDescriptor(a,o).enumerable})),i.push.apply(i,e)}return i}function ie(a){for(var t=1;t<arguments.length;t++){var i=arguments[t]!=null?arguments[t]:{};t%2?Xt(Object(i),!0).forEach(function(e){Ce(a,e,i[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(a,Object.getOwnPropertyDescriptors(i)):Xt(Object(i)).forEach(function(e){Object.defineProperty(a,e,Object.getOwnPropertyDescriptor(i,e))})}return a}function De(a,t){if(typeof a!="object"||!a)return a;var i=a[Symbol.toPrimitive];if(i!==void 0){var e=i.call(a,t);if(typeof e!="object")return e;throw new TypeError("@@toPrimitive must return a primitive value.")}return String(a)}function ae(a){var t=De(a,"string");return typeof t=="symbol"?t:t+""}function wt(a){"@babel/helpers - typeof";return wt=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},wt(a)}function Ee(a,t){if(!(a instanceof t))throw new TypeError("Cannot call a class as a function")}function zt(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,ae(e.key),e)}}function Me(a,t,i){return t&&zt(a.prototype,t),i&&zt(a,i),Object.defineProperty(a,"prototype",{writable:!1}),a}function Ce(a,t,i){return t=ae(t),t in a?Object.defineProperty(a,t,{value:i,enumerable:!0,configurable:!0,writable:!0}):a[t]=i,a}function re(a){return Te(a)||Oe(a)||Ne(a)||Ie()}function Te(a){if(Array.isArray(a))return bt(a)}function Oe(a){if(typeof Symbol<"u"&&a[Symbol.iterator]!=null||a["@@iterator"]!=null)return Array.from(a)}function Ne(a,t){if(a){if(typeof a=="string")return bt(a,t);var i=Object.prototype.toString.call(a).slice(8,-1);if(i==="Object"&&a.constructor&&(i=a.constructor.name),i==="Map"||i==="Set")return Array.from(a);if(i==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(i))return bt(a,t)}}function bt(a,t){(t==null||t>a.length)&&(t=a.length);for(var i=0,e=new Array(t);i<t;i++)e[i]=a[i];return e}function Ie(){throw new TypeError(`Invalid attempt to spread non-iterable instance. 10In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var ut=typeof window<"u"&&typeof window.document<"u",Y=ut?window:{},Nt=ut&&Y.document.documentElement?"ontouchstart"in Y.document.documentElement:!1,It=ut?"PointerEvent"in Y:!1,E="cropper",At="all",ne="crop",oe="move",se="zoom",$="e",F="w",Q="s",U="n",et="ne",it="nw",at="se",rt="sw",yt="".concat(E,"-crop"),Ht="".concat(E,"-disabled"),B="".concat(E,"-hidden"),Yt="".concat(E,"-hide"),Ae="".concat(E,"-invisible"),ft="".concat(E,"-modal"),xt="".concat(E,"-move"),st="".concat(E,"Action"),lt="".concat(E,"Preview"),St="crop",he="move",ce="none",Dt="crop",Et="cropend",Mt="cropmove",Ct="cropstart",Wt="dblclick",Se=Nt?"touchstart":"mousedown",Re=Nt?"touchmove":"mousemove",Be=Nt?"touchend touchcancel":"mouseup",Ut=It?"pointerdown":Se,jt=It?"pointermove":Re,Vt=It?"pointerup pointercancel":Be,Gt="ready",$t="resize",Ft="wheel",Tt="zoom",qt="image/jpeg",Le=/^e|w|s|n|se|sw|ne|nw|all|crop|move|zoom$/,_e=/^data:/,Pe=/^data:image\/jpeg;base64,/,ke=/^img|canvas$/i,le=200,de=100,Qt={viewMode:0,dragMode:St,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:le,minContainerHeight:de,ready:null,cropstart:null,cropmove:null,cropend:null,crop:null,zoom:null},Xe='<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>',ze=Number.isNaN||Y.isNaN;function v(a){return typeof a=="number"&&!ze(a)}var Kt=function(t){return t>0&&t<1/0};function mt(a){return typeof a>"u"}function q(a){return wt(a)==="object"&&a!==null}var He=Object.prototype.hasOwnProperty;function K(a){if(!q(a))return!1;try{var t=a.constructor,i=t.prototype;return t&&i&&He.call(i,"isPrototypeOf")}catch{return!1}}function R(a){return typeof a=="function"}var Ye=Array.prototype.slice;function fe(a){return Array.from?Array.from(a):Ye.call(a)}function N(a,t){return a&&R(t)&&(Array.isArray(a)||v(a.length)?fe(a).forEach(function(i,e){t.call(a,i,e,a)}):q(a)&&Object.keys(a).forEach(function(i){t.call(a,a[i],i,a)})),a}var M=Object.assign||function(t){for(var i=arguments.length,e=new Array(i>1?i-1:0),o=1;o<i;o++)e[o-1]=arguments[o];return q(t)&&e.length>0&&e.forEach(function(r){q(r)&&Object.keys(r).forEach(function(n){t[n]=r[n]})}),t},We=/\.\d*(?:0|9){12}\d*$/;function J(a){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1e11;return We.test(a)?Math.round(a*t)/t:a}var Ue=/^width|height|left|top|marginLeft|marginTop$/;function j(a,t){var i=a.style;N(t,function(e,o){Ue.test(o)&&v(e)&&(e="".concat(e,"px")),i[o]=e})}function je(a,t){return a.classList?a.classList.contains(t):a.className.indexOf(t)>-1}function I(a,t){if(t){if(v(a.length)){N(a,function(e){I(e,t)});return}if(a.classList){a.classList.add(t);return}var i=a.className.trim();i?i.indexOf(t)<0&&(a.className="".concat(i," ").concat(t)):a.className=t}}function H(a,t){if(t){if(v(a.length)){N(a,function(i){H(i,t)});return}if(a.classList){a.classList.remove(t);return}a.className.indexOf(t)>=0&&(a.className=a.className.replace(t,""))}}function Z(a,t,i){if(t){if(v(a.length)){N(a,function(e){Z(e,t,i)});return}i?I(a,t):H(a,t)}}var Ve=/([a-z\d])([A-Z])/g;function Rt(a){return a.replace(Ve,"$1-$2").toLowerCase()}function Ot(a,t){return q(a[t])?a[t]:a.dataset?a.dataset[t]:a.getAttribute("data-".concat(Rt(t)))}function ht(a,t,i){q(i)?a[t]=i:a.dataset?a.dataset[t]=i:a.setAttribute("data-".concat(Rt(t)),i)}function Ge(a,t){if(q(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(Rt(t)))}var ue=/\s\s*/,pe=function(){var a=!1;if(ut){var t=!1,i=function(){},e=Object.defineProperty({},"once",{get:function(){return a=!0,t},set:function(r){t=r}});Y.addEventListener("test",i,e),Y.removeEventListener("test",i,e)}return a}();function k(a,t,i){var e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=i;t.trim().split(ue).forEach(function(r){if(!pe){var n=a.listeners;n&&n[r]&&n[r][i]&&(o=n[r][i],delete n[r][i],Object.keys(n[r]).length===0&&delete n[r],Object.keys(n).length===0&&delete a.listeners)}a.removeEventListener(r,o,e)})}function _(a,t,i){var e=arguments.length>3&&arguments[3]!==void 0?arguments[3]:{},o=i;t.trim().split(ue).forEach(function(r){if(e.once&&!pe){var n=a.listeners,s=n===void 0?{}:n;o=function(){delete s[r][i],a.removeEventListener(r,o,e);for(var l=arguments.length,c=new Array(l),h=0;h<l;h++)c[h]=arguments[h];i.apply(a,c)},s[r]||(s[r]={}),s[r][i]&&a.removeEventListener(r,s[r][i],e),s[r][i]=o,a.listeners=s}a.addEventListener(r,o,e)})}function tt(a,t,i){var e;return R(Event)&&R(CustomEvent)?e=new CustomEvent(t,{detail:i,bubbles:!0,cancelable:!0}):(e=document.createEvent("CustomEvent"),e.initCustomEvent(t,!0,!0,i)),a.dispatchEvent(e)}function ge(a){var t=a.getBoundingClientRect();return{left:t.left+(window.pageXOffset-document.documentElement.clientLeft),top:t.top+(window.pageYOffset-document.documentElement.clientTop)}}var vt=Y.location,$e=/^(\w+:)\/\/([^:/?#]*):?(\d*)/i;function Zt(a){var t=a.match($e);return t!==null&&(t[1]!==vt.protocol||t[2]!==vt.hostname||t[3]!==vt.port)}function Jt(a){var t="timestamp=".concat(new Date().getTime());return a+(a.indexOf("?")===-1?"?":"&")+t}function ot(a){var t=a.rotate,i=a.scaleX,e=a.scaleY,o=a.translateX,r=a.translateY,n=[];v(o)&&o!==0&&n.push("translateX(".concat(o,"px)")),v(r)&&r!==0&&n.push("translateY(".concat(r,"px)")),v(t)&&t!==0&&n.push("rotate(".concat(t,"deg)")),v(i)&&i!==1&&n.push("scaleX(".concat(i,")")),v(e)&&e!==1&&n.push("scaleY(".concat(e,")"));var s=n.length?n.join(" "):"none";return{WebkitTransform:s,msTransform:s,transform:s}}function Fe(a){var t=ie({},a),i=0;return N(a,function(e,o){delete t[o],N(t,function(r){var n=Math.abs(e.startX-r.startX),s=Math.abs(e.startY-r.startY),d=Math.abs(e.endX-r.endX),l=Math.abs(e.endY-r.endY),c=Math.sqrt(n*n+s*s),h=Math.sqrt(d*d+l*l),f=(h-c)/c;Math.abs(f)>Math.abs(i)&&(i=f)})}),i}function dt(a,t){var i=a.pageX,e=a.pageY,o={endX:i,endY:e};return t?o:ie({startX:i,startY:e},o)}function qe(a){var t=0,i=0,e=0;return N(a,function(o){var r=o.startX,n=o.startY;t+=r,i+=n,e+=1}),t/=e,i/=e,{pageX:t,pageY:i}}function V(a){var t=a.aspectRatio,i=a.height,e=a.width,o=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"contain",r=Kt(e),n=Kt(i);if(r&&n){var s=i*t;o==="contain"&&s>e||o==="cover"&&s<e?i=e/t:e=i*t}else r?i=e/t:n&&(e=i*t);return{width:e,height:i}}function Qe(a){var t=a.width,i=a.height,e=a.degree;if(e=Math.abs(e)%180,e===90)return{width:i,height:t};var o=e%90*Math.PI/180,r=Math.sin(o),n=Math.cos(o),s=t*n+i*r,d=t*r+i*n;return e>90?{width:d,height:s}:{width:s,height:d}}function Ke(a,t,i,e){var o=t.aspectRatio,r=t.naturalWidth,n=t.naturalHeight,s=t.rotate,d=s===void 0?0:s,l=t.scaleX,c=l===void 0?1:l,h=t.scaleY,f=h===void 0?1:h,m=i.aspectRatio,g=i.naturalWidth,y=i.naturalHeight,w=e.fillColor,C=w===void 0?"transparent":w,O=e.imageSmoothingEnabled,T=O===void 0?!0:O,L=e.imageSmoothingQuality,A=L===void 0?"low":L,u=e.maxWidth,b=u===void 0?1/0:u,p=e.maxHeight,x=p===void 0?1/0:p,D=e.minWidth,X=D===void 0?0:D,W=e.minHeight,P=W===void 0?0:W,z=document.createElement("canvas"),S=z.getContext("2d"),G=V({aspectRatio:m,width:b,height:x}),ct=V({aspectRatio:m,width:X,height:P},"cover"),pt=Math.min(G.width,Math.max(ct.width,g)),gt=Math.min(G.height,Math.max(ct.height,y)),Bt=V({aspectRatio:o,width:b,height:x}),Lt=V({aspectRatio:o,width:X,height:P},"cover"),_t=Math.min(Bt.width,Math.max(Lt.width,r)),Pt=Math.min(Bt.height,Math.max(Lt.height,n)),we=[-_t/2,-Pt/2,_t,Pt];return z.width=J(pt),z.height=J(gt),S.fillStyle=C,S.fillRect(0,0,pt,gt),S.save(),S.translate(pt/2,gt/2),S.rotate(d*Math.PI/180),S.scale(c,f),S.imageSmoothingEnabled=T,S.imageSmoothingQuality=A,S.drawImage.apply(S,[a].concat(re(we.map(function(be){return Math.floor(J(be))})))),S.restore(),z}var me=String.fromCharCode;function Ze(a,t,i){var e="";i+=t;for(var o=t;o<i;o+=1)e+=me(a.getUint8(o));return e}var Je=/^data:.*,/;function ti(a){var t=a.replace(Je,""),i=atob(t),e=new ArrayBuffer(i.length),o=new Uint8Array(e);return N(o,function(r,n){o[n]=i.charCodeAt(n)}),e}function ei(a,t){for(var i=[],e=8192,o=new Uint8Array(a);o.length>0;)i.push(me.apply(null,fe(o.subarray(0,e)))),o=o.subarray(e);return"data:".concat(t,";base64,").concat(btoa(i.join("")))}function ii(a){var t=new DataView(a),i;try{var e,o,r;if(t.getUint8(0)===255&&t.getUint8(1)===216)for(var n=t.byteLength,s=2;s+1<n;){if(t.getUint8(s)===255&&t.getUint8(s+1)===225){o=s;break}s+=1}if(o){var d=o+4,l=o+10;if(Ze(t,d,4)==="Exif"){var c=t.getUint16(l);if(e=c===18761,(e||c===19789)&&t.getUint16(l+2,e)===42){var h=t.getUint32(l+4,e);h>=8&&(r=l+h)}}}if(r){var f=t.getUint16(r,e),m,g;for(g=0;g<f;g+=1)if(m=r+g*12+2,t.getUint16(m,e)===274){m+=8,i=t.getUint16(m,e),t.setUint16(m,1,e);break}}}catch{i=1}return i}function ai(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;break}return{rotate:t,scaleX:i,scaleY:e}}var ri={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,o=this.cropper,r=Number(i.minContainerWidth),n=Number(i.minContainerHeight);I(o,B),H(t,B);var s={width:Math.max(e.offsetWidth,r>=0?r:le),height:Math.max(e.offsetHeight,n>=0?n:de)};this.containerData=s,j(o,{width:s.width,height:s.height}),I(t,B),H(o,B)},initCanvas:function(){var t=this.containerData,i=this.imageData,e=this.options.viewMode,o=Math.abs(i.rotate)%180===90,r=o?i.naturalHeight:i.naturalWidth,n=o?i.naturalWidth:i.naturalHeight,s=r/n,d=t.width,l=t.height;t.height*s>t.width?e===3?d=t.height*s:l=t.width/s:e===3?l=t.width/s:d=t.height*s;var c={aspectRatio:s,naturalWidth:r,naturalHeight:n,width:d,height:l};this.canvasData=c,this.limited=e===1||e===2,this.limitCanvas(!0,!0),c.width=Math.min(Math.max(c.width,c.minWidth),c.maxWidth),c.height=Math.min(Math.max(c.height,c.minHeight),c.maxHeight),c.left=(t.width-c.width)/2,c.top=(t.height-c.height)/2,c.oldLeft=c.left,c.oldTop=c.top,this.initialCanvasData=M({},c)},limitCanvas:function(t,i){var e=this.options,o=this.containerData,r=this.canvasData,n=this.cropBoxData,s=e.viewMode,d=r.aspectRatio,l=this.cropped&&n;if(t){var c=Number(e.minCanvasWidth)||0,h=Number(e.minCanvasHeight)||0;s>1?(c=Math.max(c,o.width),h=Math.max(h,o.height),s===3&&(h*d>c?c=h*d:h=c/d)):s>0&&(c?c=Math.max(c,l?n.width:0):h?h=Math.max(h,l?n.height:0):l&&(c=n.width,h=n.height,h*d>c?c=h*d:h=c/d));var f=V({aspectRatio:d,width:c,height:h});c=f.width,h=f.height,r.minWidth=c,r.minHeight=h,r.maxWidth=1/0,r.maxHeight=1/0}if(i)if(s>(l?0:1)){var m=o.width-r.width,g=o.height-r.height;r.minLeft=Math.min(0,m),r.minTop=Math.min(0,g),r.maxLeft=Math.max(0,m),r.maxTop=Math.max(0,g),l&&this.limited&&(r.minLeft=Math.min(n.left,n.left+(n.width-r.width)),r.minTop=Math.min(n.top,n.top+(n.height-r.height)),r.maxLeft=n.left,r.maxTop=n.top,s===2&&(r.width>=o.width&&(r.minLeft=Math.min(0,m),r.maxLeft=Math.max(0,m)),r.height>=o.height&&(r.minTop=Math.min(0,g),r.maxTop=Math.max(0,g))))}else r.minLeft=-r.width,r.minTop=-r.height,r.maxLeft=o.width,r.maxTop=o.height},renderCanvas:function(t,i){var e=this.canvasData,o=this.imageData;if(i){var r=Qe({width:o.naturalWidth*Math.abs(o.scaleX||1),height:o.naturalHeight*Math.abs(o.scaleY||1),degree:o.rotate||0}),n=r.width,s=r.height,d=e.width*(n/e.naturalWidth),l=e.height*(s/e.naturalHeight);e.left-=(d-e.width)/2,e.top-=(l-e.height)/2,e.width=d,e.height=l,e.aspectRatio=n/s,e.naturalWidth=n,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,M({width:e.width,height:e.height},ot({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,o=e.naturalWidth*(i.width/i.naturalWidth),r=e.naturalHeight*(i.height/i.naturalHeight);M(e,{width:o,height:r,left:(i.width-o)/2,top:(i.height-r)/2}),j(this.image,M({width:e.width,height:e.height},ot(M({translateX:e.left,translateY:e.top},e)))),t&&this.output()},initCropBox:function(){var t=this.options,i=this.canvasData,e=t.aspectRatio||t.initialAspectRatio,o=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*o),r.height=Math.max(r.minHeight,r.height*o),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=M({},r)},limitCropBox:function(t,i){var e=this.options,o=this.containerData,r=this.canvasData,n=this.cropBoxData,s=this.limited,d=e.aspectRatio;if(t){var l=Number(e.minCropBoxWidth)||0,c=Number(e.minCropBoxHeight)||0,h=s?Math.min(o.width,r.width,r.width+r.left,o.width-r.left):o.width,f=s?Math.min(o.height,r.height,r.height+r.top,o.height-r.top):o.height;l=Math.min(l,o.width),c=Math.min(c,o.height),d&&(l&&c?c*d>l?c=l/d:l=c*d:l?c=l/d:c&&(l=c*d),f*d>h?f=h/d:h=f*d),n.minWidth=Math.min(l,h),n.minHeight=Math.min(c,f),n.maxWidth=h,n.maxHeight=f}i&&(s?(n.minLeft=Math.max(0,r.left),n.minTop=Math.max(0,r.top),n.maxLeft=Math.min(o.width,r.left+r.width)-n.width,n.maxTop=Math.min(o.height,r.top+r.height)-n.height):(n.minLeft=0,n.minTop=0,n.maxLeft=o.width-n.width,n.maxTop=o.height-n.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&&ht(this.face,st,e.width>=i.width&&e.height>=i.height?oe:At),j(this.cropBox,M({width:e.width,height:e.height},ot({translateX:e.left,translateY:e.top}))),this.cropped&&this.limited&&this.limitCanvas(!0,!0),this.disabled||this.output()},output:function(){this.preview(),tt(this.element,Dt,this.getData())}},ni={initPreview:function(){var t=this.element,i=this.crossOrigin,e=this.options.preview,o=i?this.crossOriginUrl:this.url,r=t.alt||"The image to preview",n=document.createElement("img");if(i&&(n.crossOrigin=i),n.src=o,n.alt=r,this.viewBox.appendChild(n),this.viewBoxImage=n,!!e){var s=e;typeof e=="string"?s=t.ownerDocument.querySelectorAll(e):e.querySelector&&(s=[e]),this.previews=s,N(s,function(d){var l=document.createElement("img");ht(d,lt,{width:d.offsetWidth,height:d.offsetHeight,html:d.innerHTML}),i&&(l.crossOrigin=i),l.src=o,l.alt=r,l.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;"',d.innerHTML="",d.appendChild(l)})}},resetPreview:function(){N(this.previews,function(t){var i=Ot(t,lt);j(t,{width:i.width,height:i.height}),t.innerHTML=i.html,Ge(t,lt)})},preview:function(){var t=this.imageData,i=this.canvasData,e=this.cropBoxData,o=e.width,r=e.height,n=t.width,s=t.height,d=e.left-i.left-t.left,l=e.top-i.top-t.top;!this.cropped||this.disabled||(j(this.viewBoxImage,M({width:n,height:s},ot(M({translateX:-d,translateY:-l},t)))),N(this.previews,function(c){var h=Ot(c,lt),f=h.width,m=h.height,g=f,y=m,w=1;o&&(w=f/o,y=r*w),r&&y>m&&(w=m/r,g=o*w,y=m),j(c,{width:g,height:y}),j(c.getElementsByTagName("img")[0],M({width:n*w,height:s*w},ot(M({translateX:-d*w,translateY:-l*w},t))))}))}},oi={bind:function(){var t=this.element,i=this.options,e=this.cropper;R(i.cropstart)&&_(t,Ct,i.cropstart),R(i.cropmove)&&_(t,Mt,i.cropmove),R(i.cropend)&&_(t,Et,i.cropend),R(i.crop)&&_(t,Dt,i.crop),R(i.zoom)&&_(t,Tt,i.zoom),_(e,Ut,this.onCropStart=this.cropStart.bind(this)),i.zoomable&&i.zoomOnWheel&&_(e,Ft,this.onWheel=this.wheel.bind(this),{passive:!1,capture:!0}),i.toggleDragModeOnDblclick&&_(e,Wt,this.onDblclick=this.dblclick.bind(this)),_(t.ownerDocument,jt,this.onCropMove=this.cropMove.bind(this)),_(t.ownerDocument,Vt,this.onCropEnd=this.cropEnd.bind(this)),i.responsive&&_(window,$t,this.onResize=this.resize.bind(this))},unbind:function(){var t=this.element,i=this.options,e=this.cropper;R(i.cropstart)&&k(t,Ct,i.cropstart),R(i.cropmove)&&k(t,Mt,i.cropmove),R(i.cropend)&&k(t,Et,i.cropend),R(i.crop)&&k(t,Dt,i.crop),R(i.zoom)&&k(t,Tt,i.zoom),k(e,Ut,this.onCropStart),i.zoomable&&i.zoomOnWheel&&k(e,Ft,this.onWheel,{passive:!1,capture:!0}),i.toggleDragModeOnDblclick&&k(e,Wt,this.onDblclick),k(t.ownerDocument,jt,this.onCropMove),k(t.ownerDocument,Vt,this.onCropEnd),i.responsive&&k(window,$t,this.onResize)}},si={resize:function(){if(!this.disabled){var t=this.options,i=this.container,e=this.containerData,o=i.offsetWidth/e.width,r=i.offsetHeight/e.height,n=Math.abs(o-1)>Math.abs(r-1)?o:r;if(n!==1){var s,d;t.restore&&(s=this.getCanvasData(),d=this.getCropBoxData()),this.render(),t.restore&&(this.setCanvasData(N(s,function(l,c){s[c]=l*n})),this.setCropBoxData(N(d,function(l,c){d[c]=l*n})))}}},dblclick:function(){this.disabled||this.options.dragMode===ce||this.setDragMode(je(this.dragBox,yt)?he:St)},wheel:function(t){var i=this,e=Number(this.options.wheelZoomRatio)||.1,o=1;this.disabled||(t.preventDefault(),!this.wheeling&&(this.wheeling=!0,setTimeout(function(){i.wheeling=!1},50),t.deltaY?o=t.deltaY>0?1:-1:t.wheelDelta?o=-t.wheelDelta/120:t.detail&&(o=t.detail>0?1:-1),this.zoom(-o*e,t)))},cropStart:function(t){var i=t.buttons,e=t.button;if(!(this.disabled||(t.type==="mousedown"||t.type==="pointerdown"&&t.pointerType==="mouse")&&(v(i)&&i!==1||v(e)&&e!==0||t.ctrlKey))){var o=this.options,r=this.pointers,n;t.changedTouches?N(t.changedTouches,function(s){r[s.identifier]=dt(s)}):r[t.pointerId||0]=dt(t),Object.keys(r).length>1&&o.zoomable&&o.zoomOnTouch?n=se:n=Ot(t.target,st),Le.test(n)&&tt(this.element,Ct,{originalEvent:t,action:n})!==!1&&(t.preventDefault(),this.action=n,this.cropping=!1,n===ne&&(this.cropping=!0,I(this.dragBox,ft)))}},cropMove:function(t){var i=this.action;if(!(this.disabled||!i)){var e=this.pointers;t.preventDefault(),tt(this.element,Mt,{originalEvent:t,action:i})!==!1&&(t.changedTouches?N(t.changedTouches,function(o){M(e[o.identifier]||{},dt(o,!0))}):M(e[t.pointerId||0]||{},dt(t,!0)),this.change(t))}},cropEnd:function(t){if(!this.disabled){var i=this.action,e=this.pointers;t.changedTouches?N(t.changedTouches,function(o){delete e[o.identifier]}):delete e[t.pointerId||0],i&&(t.preventDefault(),Object.keys(e).length||(this.action=""),this.cropping&&(this.cropping=!1,Z(this.dragBox,ft,this.cropped&&this.options.modal)),tt(this.element,Et,{originalEvent:t,action:i}))}}},hi={change:function(t){var i=this.options,e=this.canvasData,o=this.containerData,r=this.cropBoxData,n=this.pointers,s=this.action,d=i.aspectRatio,l=r.left,c=r.top,h=r.width,f=r.height,m=l+h,g=c+f,y=0,w=0,C=o.width,O=o.height,T=!0,L;!d&&t.shiftKey&&(d=h&&f?h/f:1),this.limited&&(y=r.minLeft,w=r.minTop,C=y+Math.min(o.width,e.width,e.left+e.width),O=w+Math.min(o.height,e.height,e.top+e.height));var A=n[Object.keys(n)[0]],u={x:A.endX-A.startX,y:A.endY-A.startY},b=function(x){switch(x){case $:m+u.x>C&&(u.x=C-m);break;case F:l+u.x<y&&(u.x=y-l);break;case U:c+u.y<w&&(u.y=w-c);break;case Q:g+u.y>O&&(u.y=O-g);break}};switch(s){case At:l+=u.x,c+=u.y;break;case $:if(u.x>=0&&(m>=C||d&&(c<=w||g>=O))){T=!1;break}b($),h+=u.x,h<0&&(s=F,h=-h,l-=h),d&&(f=h/d,c+=(r.height-f)/2);break;case U:if(u.y<=0&&(c<=w||d&&(l<=y||m>=C))){T=!1;break}b(U),f-=u.y,c+=u.y,f<0&&(s=Q,f=-f,c-=f),d&&(h=f*d,l+=(r.width-h)/2);break;case F:if(u.x<=0&&(l<=y||d&&(c<=w||g>=O))){T=!1;break}b(F),h-=u.x,l+=u.x,h<0&&(s=$,h=-h,l-=h),d&&(f=h/d,c+=(r.height-f)/2);break;case Q:if(u.y>=0&&(g>=O||d&&(l<=y||m>=C))){T=!1;break}b(Q),f+=u.y,f<0&&(s=U,f=-f,c-=f),d&&(h=f*d,l+=(r.width-h)/2);break;case et:if(d){if(u.y<=0&&(c<=w||m>=C)){T=!1;break}b(U),f-=u.y,c+=u.y,h=f*d}else b(U),b($),u.x>=0?m<C?h+=u.x:u.y<=0&&c<=w&&(T=!1):h+=u.x,u.y<=0?c>w&&(f-=u.y,c+=u.y):(f-=u.y,c+=u.y);h<0&&f<0?(s=rt,f=-f,h=-h,c-=f,l-=h):h<0?(s=it,h=-h,l-=h):f<0&&(s=at,f=-f,c-=f);break;case it:if(d){if(u.y<=0&&(c<=w||l<=y)){T=!1;break}b(U),f-=u.y,c+=u.y,h=f*d,l+=r.width-h}else b(U),b(F),u.x<=0?l>y?(h-=u.x,l+=u.x):u.y<=0&&c<=w&&(T=!1):(h-=u.x,l+=u.x),u.y<=0?c>w&&(f-=u.y,c+=u.y):(f-=u.y,c+=u.y);h<0&&f<0?(s=at,f=-f,h=-h,c-=f,l-=h):h<0?(s=et,h=-h,l-=h):f<0&&(s=rt,f=-f,c-=f);break;case rt:if(d){if(u.x<=0&&(l<=y||g>=O)){T=!1;break}b(F),h-=u.x,l+=u.x,f=h/d}else b(Q),b(F),u.x<=0?l>y?(h-=u.x,l+=u.x):u.y>=0&&g>=O&&(T=!1):(h-=u.x,l+=u.x),u.y>=0?g<O&&(f+=u.y):f+=u.y;h<0&&f<0?(s=et,f=-f,h=-h,c-=f,l-=h):h<0?(s=at,h=-h,l-=h):f<0&&(s=it,f=-f,c-=f);break;case at:if(d){if(u.x>=0&&(m>=C||g>=O)){T=!1;break}b($),h+=u.x,f=h/d}else b(Q),b($),u.x>=0?m<C?h+=u.x:u.y>=0&&g>=O&&(T=!1):h+=u.x,u.y>=0?g<O&&(f+=u.y):f+=u.y;h<0&&f<0?(s=it,f=-f,h=-h,c-=f,l-=h):h<0?(s=rt,h=-h,l-=h):f<0&&(s=et,f=-f,c-=f);break;case oe:this.move(u.x,u.y),T=!1;break;case se:this.zoom(Fe(n),t),T=!1;break;case ne:if(!u.x||!u.y){T=!1;break}L=ge(this.cropper),l=A.startX-L.left,c=A.startY-L.top,h=r.minWidth,f=r.minHeight,u.x>0?s=u.y>0?at:et:u.x<0&&(l-=h,s=u.y>0?rt:it),u.y<0&&(c-=f),this.cropped||(H(this.cropBox,B),this.cropped=!0,this.limited&&this.limitCropBox(!0,!0));break}T&&(r.width=h,r.height=f,r.left=l,r.top=c,this.action=s,this.renderCropBox()),N(n,function(p){p.startX=p.endX,p.startY=p.endY})}},ci={crop:function(){return this.ready&&!this.cropped&&!this.disabled&&(this.cropped=!0,this.limitCropBox(!0,!0),this.options.modal&&I(this.dragBox,ft),H(this.cropBox,B),this.setCropBoxData(this.initialCropBoxData)),this},reset:function(){return this.ready&&!this.disabled&&(this.imageData=M({},this.initialImageData),this.canvasData=M({},this.initialCanvasData),this.cropBoxData=M({},this.initialCropBoxData),this.renderCanvas(),this.cropped&&this.renderCropBox()),this},clear:function(){return this.cropped&&!this.disabled&&(M(this.cropBoxData,{left:0,top:0,width:0,height:0}),this.cropped=!1,this.renderCropBox(),this.limitCanvas(!0,!0),this.renderCanvas(),H(this.dragBox,ft),I(this.cropBox,B)),this},replace:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!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,H(this.cropper,Ht)),this},disable:function(){return this.ready&&!this.disabled&&(this.disabled=!0,I(this.cropper,Ht)),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&&arguments[1]!==void 0?arguments[1]:t,e=this.canvasData,o=e.left,r=e.top;return this.moveTo(mt(t)?t:o+Number(t),mt(i)?i:r+Number(i))},moveTo:function(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:t,e=this.canvasData,o=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.movable&&(v(t)&&(e.left=t,o=!0),v(i)&&(e.top=i,o=!0),o&&this.renderCanvas(!0)),this},zoom:function(t,i){var e=this.canvasData;return t=Number(t),t<0?t=1/(1-t):t=1+t,this.zoomTo(e.width*t/e.naturalWidth,null,i)},zoomTo:function(t,i,e){var o=this.options,r=this.canvasData,n=r.width,s=r.height,d=r.naturalWidth,l=r.naturalHeight;if(t=Number(t),t>=0&&this.ready&&!this.disabled&&o.zoomable){var c=d*t,h=l*t;if(tt(this.element,Tt,{ratio:t,oldRatio:n/d,originalEvent:e})===!1)return this;if(e){var f=this.pointers,m=ge(this.cropper),g=f&&Object.keys(f).length?qe(f):{pageX:e.pageX,pageY:e.pageY};r.left-=(c-n)*((g.pageX-m.left-r.left)/n),r.top-=(h-s)*((g.pageY-m.top-r.top)/s)}else K(i)&&v(i.x)&&v(i.y)?(r.left-=(c-n)*((i.x-r.left)/n),r.top-=(h-s)*((i.y-r.top)/s)):(r.left-=(c-n)/2,r.top-=(h-s)/2);r.width=c,r.height=h,this.renderCanvas(!0)}return this},rotate:function(t){return this.rotateTo((this.imageData.rotate||0)+Number(t))},rotateTo:function(t){return t=Number(t),v(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&&arguments[1]!==void 0?arguments[1]:t,e=this.imageData,o=!1;return t=Number(t),i=Number(i),this.ready&&!this.disabled&&this.options.scalable&&(v(t)&&(e.scaleX=t,o=!0),v(i)&&(e.scaleY=i,o=!0),o&&this.renderCanvas(!0,!0)),this},getData:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:!1,i=this.options,e=this.imageData,o=this.canvasData,r=this.cropBoxData,n;if(this.ready&&this.cropped){n={x:r.left-o.left,y:r.top-o.top,width:r.width,height:r.height};
vendor: 1,243 bytes, line 10
10var s=e.width/e.naturalWidth;if(N(n,function(c,h){n[h]=c/s}),t){var d=Math.round(n.y+n.height),l=Math.round(n.x+n.width);n.x=Math.round(n.x),n.y=Math.round(n.y),n.width=l-n.x,n.height=d-n.y}}else n={x:0,y:0,width:0,height:0};return i.rotatable&&(n.rotate=e.rotate||0),i.scalable&&(n.scaleX=e.scaleX||1,n.scaleY=e.scaleY||1),n},setData:function(t){var i=this.options,e=this.imageData,o=this.canvasData,r={};if(this.ready&&!this.disabled&&K(t)){var n=!1;i.rotatable&&v(t.rotate)&&t.rotate!==e.rotate&&(e.rotate=t.rotate,n=!0),i.scalable&&(v(t.scaleX)&&t.scaleX!==e.scaleX&&(e.scaleX=t.scaleX,n=!0),v(t.scaleY)&&t.scaleY!==e.scaleY&&(e.scaleY=t.scaleY,n=!0)),n&&this.renderCanvas(!0,!0);var s=e.width/e.naturalWidth;v(t.x)&&(r.left=t.x*s+o.left),v(t.y)&&(r.top=t.y*s+o.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?M({},this.containerData):{}},getImageData:function(){return this.sized?M({},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;
vendor: 4,890 bytes, line 10
10return this.ready&&!this.disabled&&K(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 t=this.cropBoxData,i;return this.ready&&this.cropped&&(i={left:t.left,top:t.top,width:t.width,height:t.height}),i||{}},setCropBoxData:function(t){var i=this.cropBoxData,e=this.options.aspectRatio,o,r;return this.ready&&this.cropped&&!this.disabled&&K(t)&&(v(t.left)&&(i.left=t.left),v(t.top)&&(i.top=t.top),v(t.width)&&t.width!==i.width&&(o=!0,i.width=t.width),v(t.height)&&t.height!==i.height&&(r=!0,i.height=t.height),e&&(o?i.height=i.width/e:r&&(i.width=i.height*e)),this.renderCropBox()),this},getCroppedCanvas:function(){var t=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(!this.ready||!window.HTMLCanvasElement)return null;var i=this.canvasData,e=Ke(this.image,this.imageData,i,t);if(!this.cropped)return e;var o=this.getData(t.rounded),r=o.x,n=o.y,s=o.width,d=o.height,l=e.width/Math.floor(i.naturalWidth);l!==1&&(r*=l,n*=l,s*=l,d*=l);var c=s/d,h=V({aspectRatio:c,width:t.maxWidth||1/0,height:t.maxHeight||1/0}),f=V({aspectRatio:c,width:t.minWidth||0,height:t.minHeight||0},"cover"),m=V({aspectRatio:c,width:t.width||(l!==1?e.width:s),height:t.height||(l!==1?e.height:d)}),g=m.width,y=m.height;g=Math.min(h.width,Math.max(f.width,g)),y=Math.min(h.height,Math.max(f.height,y));var w=document.createElement("canvas"),C=w.getContext("2d");w.width=J(g),w.height=J(y),C.fillStyle=t.fillColor||"transparent",C.fillRect(0,0,g,y);var O=t.imageSmoothingEnabled,T=O===void 0?!0:O,L=t.imageSmoothingQuality;C.imageSmoothingEnabled=T,L&&(C.imageSmoothingQuality=L);var A=e.width,u=e.height,b=r,p=n,x,D,X,W,P,z;b<=-s||b>A?(b=0,x=0,X=0,P=0):b<=0?(X=-b,b=0,x=Math.min(A,s+b),P=x):b<=A&&(X=0,x=Math.min(s,A-b),P=x),x<=0||p<=-d||p>u?(p=0,D=0,W=0,z=0):p<=0?(W=-p,p=0,D=Math.min(u,d+p),z=D):p<=u&&(W=0,D=Math.min(d,u-p),z=D);var S=[b,p,x,D];if(P>0&&z>0){var G=g/s;S.push(X*G,W*G,P*G,z*G)}return C.drawImage.apply(C,[e].concat(re(S.map(function(ct){return Math.floor(J(ct))})))),w},setAspectRatio:function(t){var i=this.options;return!this.disabled&&!mt(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,o=this.face;if(this.ready&&!this.disabled){var r=t===St,n=i.movable&&t===he;t=r||n?t:ce,i.dragMode=t,ht(e,st,t),Z(e,yt,r),Z(e,xt,n),i.cropBoxMovable||(ht(o,st,t),Z(o,yt,r),Z(o,xt,n))}return this}},li=Y.Cropper,ve=function(){function a(t){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(Ee(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=M({},Qt,K(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 Me(a,[{key:"init",value:function(){var i=this.element,e=i.tagName.toLowerCase(),o;if(!i[E]){if(i[E]=this,e==="img"){if(this.isImg=!0,o=i.getAttribute("src")||"",this.originalUrl=o,!o)return;o=i.src}else e==="canvas"&&window.HTMLCanvasElement&&(o=i.toDataURL());this.load(o)}}},{key:"load",value:function(i){var e=this;if(i){this.url=i,this.imageData={};var o=this.element,r=this.options;if(!r.rotatable&&!r.scalable&&(r.checkOrientation=!1),!r.checkOrientation||!window.ArrayBuffer){this.clone();return}if(_e.test(i)){Pe.test(i)?this.read(ti(i)):this.clone();return}var n=new XMLHttpRequest,s=this.clone.bind(this);this.reloading=!0,this.xhr=n,n.onabort=s,n.onerror=s,n.ontimeout=s,n.onprogress=function(){n.getResponseHeader("content-type")!==qt&&n.abort()},n.onload=function(){e.read(n.response)},n.onloadend=function(){e.reloading=!1,e.xhr=null},r.checkCrossOrigin&&Zt(i)&&o.crossOrigin&&(i=Jt(i)),n.open("GET",i,!0),n.responseType="arraybuffer",n.withCredentials=o.crossOrigin==="use-credentials",n.send()}}},{key:"read",value:function(i){var e=this.options,o=this.imageData,r=ii(i),n=0,s=1,d=1;if(r>1){this.url=ei(i,qt);var l=ai(r);n=l.rotate,s=l.scaleX,d=l.scaleY}e.rotatable&&(o.rotate=n),e.scalable&&(o.scaleX=s,o.scaleY=d),this.clone()}},{key:"clone",value:function(){var i=this.element,e=this.url,o=i.crossOrigin,r=e;this.options.checkCrossOrigin&&Zt(e)&&(o||(o="anonymous"),r=Jt(e)),this.crossOrigin=o,this.crossOriginUrl=r;var n=document.createElement("img");o&&(n.crossOrigin=o),n.src=r||e,n.alt=i.alt||"The image to crop",this.image=n,n.onload=this.start.bind(this),n.onerror=this.stop.bind(this),I(n,Yt),i.parentNode.insertBefore(n,i.nextSibling)}},{key:"start",value:function(){var i=this,e=this.image;e.onload=null,e.onerror=null,this.sizing=!0;var o=Y.navigator&&/(?:iPad|iPhone|iPod).*?AppleWebKit/i.test(Y.navigator.userAgent),r=function(l,c){M(i.imageData,{naturalWi
10dth:l,naturalHeight:c,aspectRatio:l/c}),i.initialImageData=M({},i.imageData),i.sizing=!1,i.sized=!0,i.build()};if(e.naturalWidth&&!o){r(e.naturalWidth,e.naturalHeight);return}var n=document.createElement("img"),s=document.body||document.documentElement;this.sizingImage=n,n.onload=function(){r(n.width,n.height),o||s.removeChild(n)},n.src=e.src,o||(n.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(n))}},{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,o=this.image,r=i.parentNode,n=document.createElement("div");n.innerHTML=Xe;var s=n.querySelector(".".concat(E,"-container")),d=s.querySelector(".".concat(E,"-canvas")),l=s.querySelector(".".concat(E,"-drag-box")),c=s.querySelector(".".concat(E,"-crop-box")),h=c.querySelector(".".concat(E,"-face"));this.container=r,this.cropper=s,this.canvas=d,this.dragBox=l,this.cropBox=c,this.viewBox=s.querySelector(".".concat(E,"-view-box")),this.face=h,d.appendChild(o),I(i,B),r.insertBefore(s,i.nextSibling),H(o,Yt),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,I(c,B),e.guides||I(c.getElementsByClassName("".concat(E,"-dashed")),B),e.center||I(c.getElementsByClassName("".concat(E,"-center")),B),e.background&&I(s,"".concat(E,"-bg")),e.highlight||I(h,Ae),e.cropBoxMovable&&(I(h,xt),ht(h,st,At)),e.cropBoxResizable||(I(c.getElementsByClassName("".concat(E,"-line")),B),I(c.getElementsByClassName("".concat(E,"-point")),B)),this.render(),this.ready=!0,this.setDragMode(e.dragMode),e.autoCrop&&this.crop(),this.setData(e.data),R(e.ready)&&_(i,Gt,e.ready,{once:!0}),tt(i,Gt)}}},{key:"unbuild",value:function(){if(this.ready){this.ready=!1,this.unbind(),this.resetPreview();var i=this.cropper.parentNode;i&&i.removeChild(this.cropper),H(this.element,B)}}},{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=li,a}},{key:"setDefaults",value:function(i){M(Qt,K(i)&&i)}}])}();M(ve.prototype,ri,ni,oi,si,hi,ci);const te={passport:150,"2x2":200,"3x3":300,"4x4":400},ee=8192,di=800,fi=600;function nt(a){const t=document.getElementById("ctImgCropToastBody"),i=document.getElementById("ctImgCropToast");if(!t||!i||typeof bootstrap>"u"){window.alert(a);return}t.textContent=a,bootstrap.Toast.getOrCreateInstance(i).show()}function yi(){if(!document.getElementById("ct-image-cropper-root"))return;const t=document.getElementById("ctImgCropUploadCard"),i=document.getElementById("ctImgCropFiles"),e=document.getElementById("ctImgCropDrop"),o=document.getElementById("ctImgCropCaption"),r=document.getElementById("ctImgCropPreset"),n=document.getElementById("ctImgCropOutW"),s=document.getElementById("ctImgCropOutH"),d=document.getElementById("ctImgCropSelectionMeta"),l=document.getElementById("ctImgCropPlaceholder"),c=document.getElementById("ctImgCropStage"),h=document.getElementById("ctImgCropImg"),f=document.getElementById("ctImgCropDownload"),m=document.getElementById("ctImgCropAnother");if(!i||!e||!h||!c||!l||!f||!m||!n||!s)return;let g=null,y=null;function w(){g&&(g.destroy(),g=null)}function C(p){const x=p||g;if(!d||!x){d&&(d.textContent="");return}const D=x.getData(!0);if(!(D!=null&&D.width)||!(D!=null&&D.height)){d.textContent="";return}d.textContent=`Crop selection on image: ${Math.round(D.width)} Ã ${Math.round(D.height)} px`}function O(){let p=parseInt(String(n.value),10),x=parseInt(String(s.value),10);return(!Number.isFinite(p)||p<1)&&(p=1),(!Number.isFinite(x)||x<1)&&(x=1),p=Math.min(p,ee),x=Math.min(x,ee),{w:p,h:x}}function T(){if(!r)return;const p=r.value;if(!p||!te[p])return;const x=te[p];n.value=String(x),s.value=String(x)}function L(){w(),y=null,h.removeAttribute("src"),c.classList.add("d-none"),l.classList.remove("d-none"),f.disabled=!0,n.value=String(di),s.value=String(fi),r&&(r.value=""),d&&(d.textContent="")}function A(){w();const p=new ve(h,{viewMode:1,responsive:!0,autoCropArea:.8,ready(){C(p)},crop(){C(p)}});g=p,f.disabled=!1}function u(p,x){w(),y=x,h.onload=()=>{l.classList.add("d-none"),c.classList.remove("d-none"),A()},h.src=p}r==null||r.addEventListener("change",()=>{T()}),n.addEventListener("input",()=>{r&&r.value&&(r.value="")}
10),s.addEventListener("input",()=>{r&&r.value&&(r.value="")});const b=xe({input:i,drop:e,dragContainer:t||null,captionEl:o||null,accumulate:!1,onInvalidFile:nt,onChange:()=>{let p=b.getQueue();if(p.length>1){b.setQueue([p[0]]);return}if(p.length===0){kt(i),L();return}const x=p[0],D=new FileReader;D.onload=()=>u(String(D.result),x),D.onerror=()=>nt("Could not read the file."),D.readAsDataURL(x)}});b&&(f.addEventListener("click",()=>{if(!g||!y)return;const{w:p,h:x}=O();let D;try{D=g.getCroppedCanvas({width:p,height:x})}catch{nt("Could not crop this image.");return}if(!D||!D.width){nt("Could not crop this image.");return}const X=y.type&&String(y.type).startsWith("image/")?y.type:"image/png",W=X==="image/jpeg"?.92:void 0;D.toBlob(P=>{if(!P){nt("Could not create the download file.");return}ye(P,`ConversionTab_cropped_${y.name}`)},X,W)}),m.addEventListener("click",()=>{kt(i),L()}))}export{yi as initImageCropperPage};
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.