1"use strict";(self.webpackChunkszerzi_front=self.webpackChunkszerzi_front||[]).push([[6515],{31934:(pt,F,w)=>{w.d(F,{QG:()=>ot,ap:()=>at});var o=w(94650),H=w(2662),T=w(36895),L=w(11481);const Y=["wrapper"],Z=["sourceImage"];function K(s,r){if(1&s){const t=o.EpF();o.TgZ(0,"img",4,5),o.NdJ("load",function(){o.CHM(t);const a=o.oxw();return o.KtG(a.imageLoadedInView())}),o.qZA()}if(2&s){const t=o.oxw();o.Udp("visibility",t.imageVisible?"visible":"hidden")("transform",t.safeTransformStyle),o.Q6J("src",t.safeImgDataUrl,o.LSH)}}function G(s,r){if(1&s){const t=o.EpF();o.ynx(0),o.TgZ(1,"span",9),o.NdJ("mousedown",function(a){o.CHM(t);const i=o.oxw(2);return o.KtG(i.startMove(a,i.moveTypes.Resize,"topleft"))})("touchstart",function(a){o.CHM(t);const i=o.oxw(2);return o.KtG(i.startMove(a,i.moveTypes.Resize,"topleft"))}),o._UZ(2,"span",10),o.qZA(),o.TgZ(3,"span",11),o._UZ(4,"span",10),o.qZA(),o.TgZ(5,"span",12),o.NdJ("mousedown",function(a){o.CHM(t);const i=o.oxw(2);return o.KtG(i.startMove(a,i.moveTypes.Resize,"topright"))})("touchstart",function(a){o.CHM(t);const i=o.oxw(2);return o.KtG(i.startMove(a,i.moveTypes.Resize,"topright"))}),o._UZ(6,"span",10),o.qZA(),o.TgZ(7,"span",13),o._UZ(8,"span",10),o.qZA(),o.TgZ(9,"span",14),o.NdJ("mousedown",function(a){o.CHM(t);const i=o.oxw(2);return o.KtG(i.startMove(a,i.moveTypes.Resize,"bottomright"))})("touchstart",function(a){o.CHM(t);const i=o.oxw(2);return o.KtG(i.startMove(a,i.moveTypes.Resize,"bottomright"))}),o._UZ(10,"span",10),o.qZA(),o.TgZ(11,"span",15),o._UZ(12,"span",10),o.qZA(),o.TgZ(13,"span",16),o.NdJ("mousedown",function(a){o.CHM(t);const i=o.oxw(2);return o.KtG(i.startMove(a,i.moveTypes.Resize,"bottomleft"))})("touchstart",function(a){o.CHM(t);const i=o.oxw(2);return o.KtG(i.startMove(a,i.moveTypes.Resize,"bottomleft"))}),o._UZ(14,"span",10),o.qZA(),o.TgZ(15,"span",17),o._UZ(16,"span",10),o.qZA(),o.TgZ(17,"span",18),o.NdJ("mousedown",function(a){o.CHM(t);const i=o.oxw(2);return o.KtG(i.startMove(a,i.moveTypes.Resize,"top"))})("touchstart",function(a){o.CHM(t);const i=o.oxw(2);return o.KtG(i.startMove(a,i.moveTypes.Resize,"top"))}),o.qZA(),o.TgZ(18,"span",19),o.NdJ("mousedown",function(a){o.CHM(t);const i=o.oxw(2);return o.KtG(i.startMove(a,i.moveTypes.Resize,"right"))})("touchstart",function(a){o.CHM(t);const i=o.oxw(2);return o.KtG(i.startMove(a,i.moveTypes.Resize,"right"))}),o.qZA(),o.TgZ(19,"span",20),o.NdJ("mousedown",function(a){o.CHM(t);const i=o.oxw(2);return o.KtG(i.startMove(a,i.moveTypes.Resize,"bottom"))})("touchstart",function(a){o.CHM(t);const i=o.oxw(2);return o.KtG(i.startMove(a,i.moveTypes.Resize,"bottom"))}),o.qZA(),o.TgZ(20,"span",21),o.NdJ("mousedown",function(a){o.CHM(t);const i=o.oxw(2);return o.KtG(i.startMove(a,i.moveTypes.Resize,"left"))})("touchstart",function(a){o.CHM(t);const i=o.oxw(2);return o.KtG(i.startMove(a,i.moveTypes.Resize,"left"))}),o.qZA(),o.BQk()}}function X(s,r){if(1&s){const t=o.EpF();o.TgZ(0,"div",6),o.NdJ("keydown",function(a){o.CHM(t);const i=o.oxw();return o.KtG(i.keyboardAccess(a))}),o.TgZ(1,"div",7),o.NdJ("mousedown",function(a){o.CHM(t);const i=o.oxw();return o.KtG(i.startMove(a,i.moveTypes.Move))})("touchstart",function(a){o.CHM(t);const i=o.oxw();return o.KtG(i.startMove(a,i.moveTypes.Move))}),o.qZA(),o.YNc(2,G,21,0,"ng-container",8),o.qZA()}if(2&s){const t=o.oxw();o.Udp("top",t.cropper.y1,"px")("left",t.cropper.x1,"px")("width",t.cropper.x2-t.cropper.x1,"px")("height",t.cropper.y2-t.cropper.y1,"px")("margin-left","center"===t.alignImage?t.marginLeft:null)("visibility",t.imageVisible?"visible":"hidden"),o.ekj("rounded",t.roundCropper),o.xp6(2),o.Q6J("ngIf",!t.hideResizeSquares)}}const M={Move:"move",Resize:"resize",Pinch:"pinch"};class f{crop(r,t,e,a){const i=this.getImagePosition(r,t,e,a),n=i.x2-i.x1,h=i.y2-i.y1,p=document.createElement("canvas");p.width=n,p.height=h;const c=p.getContext("2d");if(!c)return;null!=a.backgroundColor&&(c.fillStyle=a.backgroundColor,c.fillRect(0,0,n,h));const g=(a.transform.scale||1)*(a.transform.flipH?-1:1),v=(a.transform.scale||1)*(a.transform.flipV?-1:1),m=t.transformed;c.setTransform(g,0,0,v,m.size.width/2,m.size.height/2),c.translate(-i.x1/g,-i.y1/v),c.rotate((a.transform.rotate||0)*Math.PI/180),c.drawImage(m.image,-m.size.width/2,-m.size.height/2);const d={width:n,height:h,imagePosition:i,cropperPosition:Object.assign({},e)};a.containWithinAspectRatio&&(d.offsetImagePosition=this.getOffsetImagePosition(r,t,e,a));const l=this.getResizeRatio(n,h,a);return 1!==l&&(d.width=Math.round(n*l),d.height=a.maintainAspectRatio?Math.round(d.width/a.aspectRatio):Math.round(h*l),function V(s,r,t){const e=s.width,a=s.height,i=e/(r=Math.round(r)),n=a/(t=Math.round(t)),h=Math.ceil(i/2),p=Math.ceil(n/2),c=s.getContext("2d");if(c){const g=c.getImageData(0,0,e,a),v=c.createImageData(r,t),m=g.data,d=v.data;for(let l=0;l<t;l++)for(let C=0;C<r;C++){const I=4*(C+l*r),rt=l*n;let x=0,S=0,O=0,W=0,B=0,k=0,Q=0;const nt=Math.floor(C*i),st=Math.floor(l*n);let z=Math.ceil((C+1)*i),E=Math.ceil((l+1)*n);z=Math.min(z,e),E=Math.min(E,a);for(let R=st;R<E;R++){const D=Math.abs(rt-R)/p,ht=C*i,ct=D*D;for(let b=nt;b<z;b++){const U=Math.abs(ht-b)/h,A=Math.sqrt(ct+U*U);if(A>=1)continue;x=2*A*A*A-3*A*A+1;const y=4*(b+R*e);
1Q+=x*m[y+3],O+=x,m[y+3]<255&&(x=x*m[y+3]/250),W+=x*m[y],B+=x*m[y+1],k+=x*m[y+2],S+=x}}d[I]=W/S,d[I+1]=B/S,d[I+2]=k/S,d[I+3]=Q/O}s.width=r,s.height=t,c.putImageData(v,0,0)}}(p,d.width,d.height)),d.base64=p.toDataURL("image/"+a.format,this.getQuality(a)),d}getImagePosition(r,t,e,a){const n=t.transformed.size.width/r.nativeElement.offsetWidth,h={x1:Math.round(e.x1*n),y1:Math.round(e.y1*n),x2:Math.round(e.x2*n),y2:Math.round(e.y2*n)};return a.containWithinAspectRatio||(h.x1=Math.max(h.x1,0),h.y1=Math.max(h.y1,0),h.x2=Math.min(h.x2,t.transformed.size.width),h.y2=Math.min(h.y2,t.transformed.size.height)),h}getOffsetImagePosition(r,t,e,a){const h=t.transformed.size.width/r.nativeElement.offsetWidth;let p,c;(a.canvasRotation+t.exifTransform.rotate)%2?(p=(t.transformed.size.width-t.original.size.height)/2,c=(t.transformed.size.height-t.original.size.width)/2):(p=(t.transformed.size.width-t.original.size.width)/2,c=(t.transformed.size.height-t.original.size.height)/2);const g={x1:Math.round(e.x1*h)-p,y1:Math.round(e.y1*h)-c,x2:Math.round(e.x2*h)-p,y2:Math.round(e.y2*h)-c};return a.containWithinAspectRatio||(g.x1=Math.max(g.x1,0),g.y1=Math.max(g.y1,0),g.x2=Math.min(g.x2,t.transformed.size.width),g.y2=Math.min(g.y2,t.transformed.size.height)),g}getResizeRatio(r,t,e){const a=e.resizeToWidth/r,i=e.resizeToHeight/t,n=new Array;e.resizeToWidth>0&&n.push(a),e.resizeToHeight>0&&n.push(i);const h=0===n.length?1:Math.min(...n);return h>1&&!e.onlyScaleDown?h:Math.min(h,1)}getQuality(r){return Math.min(1,Math.max(0,r.imageQuality/100))}}f.\u0275fac=function(r){return new(r||f)},f.\u0275prov=o.Yz7({token:f,factory:f.\u0275fac,providedIn:"root"}),f.ngInjectableDef=(0,o.Yz7)({factory:function(){return new f},token:f,providedIn:"root"});class j{constructor(){this.format="png",this.maintainAspectRatio=!0,this.transform={},this.aspectRatio=1,this.resizeToWidth=0,this.resizeToHeight=0,this.cropperMinWidth=0,this.cropperMinHeight=0,this.cropperMaxHeight=0,this.cropperMaxWidth=0,this.cropperStaticWidth=0,this.cropperStaticHeight=0,this.canvasRotation=0,this.initialStepSize=3,this.roundCropper=!1,this.onlyScaleDown=!1,this.imageQuality=92,this.autoCrop=!0,this.backgroundColor=void 0,this.containWithinAspectRatio=!1,this.hideResizeSquares=!1,this.alignImage="center",this.cropperScaledMinWidth=20,this.cropperScaledMinHeight=20,this.cropperScaledMaxWidth=20,this.cropperScaledMaxHeight=20,this.stepSize=this.initialStepSize}setOptions(r){Object.keys(r).filter(t=>t in this).forEach(t=>this[t]=r[t])}setOptionsFromChanges(r){Object.keys(r).filter(t=>t in this).forEach(t=>this[t]=r[t].currentValue)}}class u{constructor(){this.autoRotateSupported=function J(){return new Promise(s=>{const r=new Image;r.onload=()=>{s(1===r.width&&2===r.height)},r.src="data:image/jpeg;base64,/9j/4QAiRXhpZgAATU0AKgAAAAgAAQESAAMAAAABAAYAAAAAAAD/2wCEAAEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAQEBAf/AABEIAAEAAgMBEQACEQEDEQH/xABKAAEAAAAAAAAAAAAAAAAAAAALEAEAAAAAAAAAAAAAAAAAAAAAAQEAAAAAAAAAAAAAAAAAAAAAEQEAAAAAAAAAAAAAAAAAAAAA/9oADAMBAAIRAxEAPwA/8H//2Q=="})}()}loadImageFile(r,t){return new Promise((e,a)=>{const i=new FileReader;i.onload=n=>{this.loadImage(n.target.result,r.type,t).then(e).catch(a)},i.readAsDataURL(r)})}loadImage(r,t,e){return this.isValidImageType(t)?this.loadBase64Image(r,e):Promise.reject(new Error("Invalid image type"))}isValidImageType(r){return/image\/(png|jpg|jpeg|bmp|gif|tiff|webp)/.test(r)}loadImageFromURL(r,t){return new Promise((e,a)=>{const i=new Image;i.onerror=()=>a,i.onload=()=>{const n=document.createElement("canvas"),h=n.getContext("2d");n.width=i.width,n.height=i.height,h.drawImage(i,0,0),this.loadBase64Image(n.toDataURL(),t).then(e)},i.crossOrigin="anonymous",i.src=r})}loadBase64Image(r,t){return new Promise((e,a)=>{const i=new Image;i.onload=()=>e({originalImage:i,originalBase64:r}),i.onerror=a,i.src=r}).then(e=>this.transformImageBase64(e,t))}transformImageBase64(r,t){return(0,H.mG)(this,void 0,void 0,function*(){const e=yield this.autoRotateSupported,a=yield function N(s){switch("string"==typeof s&&(s=function P(s){const r=new DataView(function $(s){s=s.replace(/^data\:([^\;]+)\;base64,/gim,"");const r=atob(s),t=r.length,e=new Uint8Array(t);for(let a=0;a<t;a++)e[a]=r.charCodeAt(a);return e.buffer}(s));if(65496!=r.getUint16(0,!1))return-2;const t=r.byteLength;let e=2;for(;e<t;){if(r.getUint16(e+2,!1)<=8)return-1;const a=r.getUint16(e,!1);if(e+=2,65505==a){if(1165519206!=r.getUint32(e+=2,!1))return-1;const i=18761==r.getUint16(e+=6,!1);e+=r.getUint32(e+4,i);const n=r.getUint16(e,i);e+=2;for(let h=0;h<n;h++)if(274==r.getUint16(e+12*h,i))return r.getUint16(e+12*h+8,i)}else{if(65280!=(65280&a))break;e+=r.getUint16(e,!1)}}return-1}(s)),s){case 2:return{rotate:0,flip:!0};case 3:return{rotate:2,flip:!1};case 4:return{rotate:2,flip:!0};case 5:return{rotate:1,flip:!0};case 6:return{rotate:1,flip:!1};case 7:return{rotate:3,flip:!0};case 8:return{rotate:3,flip:!1};default:return{rotate:0,flip:!1}}}(e?-1:r.originalBase64);return r.originalImage&&r.originalImage.complete?this.transformLoadedImage({original:{base64:r.originalBase64,image:r.originalImage,size:{width:r.originalImage.naturalWi
1dth,height:r.originalImage.naturalHeight}},exifTransform:a},t):Promise.reject(new Error("No image loaded"))})}transformLoadedImage(r,t){return(0,H.mG)(this,void 0,void 0,function*(){const e=t.canvasRotation+r.exifTransform.rotate,a={width:r.original.image.naturalWidth,height:r.original.image.naturalHeight};if(0===e&&!r.exifTransform.flip&&!t.containWithinAspectRatio)return{original:{base64:r.original.base64,image:r.original.image,size:Object.assign({},a)},transformed:{base64:r.original.base64,image:r.original.image,size:Object.assign({},a)},exifTransform:r.exifTransform};const i=this.getTransformedSize(a,r.exifTransform,t),n=document.createElement("canvas");n.width=i.width,n.height=i.height;const h=n.getContext("2d");h.setTransform(r.exifTransform.flip?-1:1,0,0,1,n.width/2,n.height/2),h.rotate(Math.PI*(e/2)),h.drawImage(r.original.image,-a.width/2,-a.height/2);const p=n.toDataURL(),c=yield this.loadImageFromBase64(p);return{original:{base64:r.original.base64,image:r.original.image,size:Object.assign({},a)},transformed:{base64:p,image:c,size:{width:c.width,height:c.height}},exifTransform:r.exifTransform}})}loadImageFromBase64(r){return new Promise((t,e)=>{const a=new Image;a.onload=()=>t(a),a.onerror=e,a.src=r})}getTransformedSize(r,t,e){const a=e.canvasRotation+t.rotate;if(e.containWithinAspectRatio){if(a%2){const n=r.height/e.aspectRatio;return{width:Math.max(r.height,r.width*e.aspectRatio),height:Math.max(r.width,n)}}{const n=r.width/e.aspectRatio;return{width:Math.max(r.width,r.height*e.aspectRatio),height:Math.max(r.height,n)}}}return a%2?{height:r.width,width:r.height}:{width:r.width,height:r.height}}}u.\u0275fac=function(r){return new(r||u)},u.\u0275prov=o.Yz7({token:u,factory:u.\u0275fac,providedIn:"root"}),u.ngInjectableDef=(0,o.Yz7)({factory:function(){return new u},token:u,providedIn:"root"});class _{resetCropperPosition(r,t,e){const a=r.nativeElement;if(e.cropperStaticHeight&&e.cropperStaticWidth)t.x1=0,t.x2=a.offsetWidth>e.cropperStaticWidth?e.cropperStaticWidth:a.offsetWidth,t.y1=0,t.y2=a.offsetHeight>e.cropperStaticHeight?e.cropperStaticHeight:a.offsetHeight;else{const i=Math.min(e.cropperScaledMaxWidth,a.offsetWidth),n=Math.min(e.cropperScaledMaxHeight,a.offsetHeight);if(e.maintainAspectRatio)if(i/e.aspectRatio<n){t.x1=0,t.x2=i;const h=i/e.aspectRatio;t.y1=(a.offsetHeight-h)/2,t.y2=t.y1+h}else{t.y1=0,t.y2=n;const h=n*e.aspectRatio;t.x1=(a.offsetWidth-h)/2,t.x2=t.x1+h}else t.x1=0,t.x2=i,t.y1=0,t.y2=n}}move(r,t,e){const a=this.getClientX(r)-t.clientX,i=this.getClientY(r)-t.clientY;e.x1=t.x1+a,e.y1=t.y1+i,e.x2=t.x2+a,e.y2=t.y2+i}resize(r,t,e,a,i){const n=this.getClientX(r)-t.clientX,h=this.getClientY(r)-t.clientY;switch(t.position){case"left":e.x1=Math.min(Math.max(t.x1+n,e.x2-i.cropperScaledMaxWidth),e.x2-i.cropperScaledMinWidth);break;case"topleft":e.x1=Math.min(Math.max(t.x1+n,e.x2-i.cropperScaledMaxWidth),e.x2-i.cropperScaledMinWidth),e.y1=Math.min(Math.max(t.y1+h,e.y2-i.cropperScaledMaxHeight),e.y2-i.cropperScaledMinHeight);break;case"top":e.y1=Math.min(Math.max(t.y1+h,e.y2-i.cropperScaledMaxHeight),e.y2-i.cropperScaledMinHeight);break;case"topright":e.x2=Math.max(Math.min(t.x2+n,e.x1+i.cropperScaledMaxWidth),e.x1+i.cropperScaledMinWidth),e.y1=Math.min(Math.max(t.y1+h,e.y2-i.cropperScaledMaxHeight),e.y2-i.cropperScaledMinHeight);break;case"right":e.x2=Math.max(Math.min(t.x2+n,e.x1+i.cropperScaledMaxWidth),e.x1+i.cropperScaledMinWidth);break;case"bottomright":e.x2=Math.max(Math.min(t.x2+n,e.x1+i.cropperScaledMaxWidth),e.x1+i.cropperScaledMinWidth),e.y2=Math.max(Math.min(t.y2+h,e.y1+i.cropperScaledMaxHeight),e.y1+i.cropperScaledMinHeight);break;case"bottom":e.y2=Math.max(Math.min(t.y2+h,e.y1+i.cropperScaledMaxHeight),e.y1+i.cropperScaledMinHeight);break;case"bottomleft":e.x1=Math.min(Math.max(t.x1+n,e.x2-i.cropperScaledMaxWidth),e.x2-i.cropperScaledMinWidth),e.y2=Math.max(Math.min(t.y2+h,e.y1+i.cropperScaledMaxHeight),e.y1+i.cropperScaledMinHeight);break;case"center":const p=r.scale,c=Math.min(Math.max(i.cropperScaledMinWidth,Math.abs(t.x2-t.x1)*p),i.cropperScaledMaxWidth),g=Math.min(Math.max(i.cropperScaledMinHeight,Math.abs(t.y2-t.y1)*p),i.cropperScaledMaxHeight);e.x1=t.clientX-c/2,e.x2=t.clientX+c/2,e.y1=t.clientY-g/2,e.y2=t.clientY+g/2,e.x1<0?(e.x2-=e.x1,e.x1=0):e.x2>a.width&&(e.x1-=e.x2-a.width,e.x2=a.width),e.y1<0?(e.y2-=e.y1,e.y1=0):e.y2>a.height&&(e.y1-=e.y2-a.height,e.y2=a.height)}i.maintainAspectRatio&&this.checkAspectRatio(t.position,e,a,i)}checkAspectRatio(r,t,e,a){let i=0,n=0;switch(r){case"top":t.x2=t.x1+(t.y2-t.y1)*a.aspectRatio,i=Math.max(t.x2-e.width,0),n=Math.max(0-t.y1,0),(i>0||n>0)&&(t.x2-=n*a.aspectRatio>i?n*a.aspectRatio:i,t.y1+=n*a.aspectRatio>i?n:i/a.aspectRatio);break;case"bottom":t.x2=t.x1+(t.y2-t.y1)*a.aspectRatio,i=Math.max(t.x2-e.width,0),n=Math.max(t.y2-e.height,0),(i>0||n>0)&&(t.x2-=n*a.aspectRatio>i?n*a.aspectRatio:i,t.y2-=n*a.aspectRatio>i?n:i/a.aspectRatio);break;case"topleft":t.y1=t.y2-(t.x2-t.x1)/a.aspectRatio,i=Math.max(0-t.x1,0),n=Math.max(0-t.y1,0),(i>0||n>0)&&(t.x1+=n*a.aspectRatio>i?n*a.aspectRatio:i,t.y1+=n*a.aspectRatio>i?n:i/a.aspectRatio);break;case"topright":t.y1=t.y2-(t.x2-t.x1)/a.aspectRatio,i=Math.max(t.x2-e.width,0),n=Math.max(0-t.y1,0),(i>0||n>0)&&(t.x2-=n*a.aspectRatio>i?n*a.aspectRatio:i,t.y1+=n*a.aspectRatio>i?n:i/a.aspectRatio);break;case"right":case"bottomright":t.y2=t.y1+(t.x2-t.x1)/a.aspectRatio,i=Math.max(t.x2-e.width,0),n=Math.max(t.y2-e.height,0),(i>0||n>0)&&(t.x2-=n*a.aspectRatio>i?n*a.aspectRatio:i,t.y2-=n*a.aspectRatio>i?n:i/a.aspectRatio);break;case"left":case"bottomleft":t.y2=t.y1+(t.x2-t.x1)/a.aspectRatio,i=Math.max(0-t.x1,0),n=Math.max(t.y2-e.height,0),(i>0||n>0)&&(t.x1+=n*a.aspectRatio>i?n*a.aspectRatio:i,t.y2-=n*a.aspectRatio>i?n:i/a.aspectRatio);break;case"center":t.x2=t.x1+(t.y2-t.y1)*a.aspectRatio,t.y2=t.y1+(t.x2-t.x1)/a.aspectRatio;const h=Math.max(0-t.x1,0),p=Math.max(t.x2-e.width,0),c=Math.max(t.y2-e.height,0),g=Math.max(0-t.y1,0);(h>0||p>0||c>0||g>0)&&(t.x1+=c*a.aspectRatio>h?c*a.aspectRatio:h,t.x2-=g*a.aspectRatio>p?g*a.aspectRatio:p,t.y1+=g*a.aspectRatio>p?g:p/a.aspectRatio,t.y2-=c*a.aspectRatio>h?c:h/a.aspectRatio)}}getClientX(r){return(r.touches&&r.touches[0]?r.touches[0].clientX:r.clientX)||0}getClientY(r){return(r.touches&&r.touches[0]?r.touches[0].clientY:r.clientY)||0}}_.\u0275fac=function(r){return new(r||_)},_.\u0275prov=o.Yz7({token:_,factory:_.\u0275fac,providedIn:"root"}),_.ngInjectableDef=(0,o.Yz7)({factory:function(){return new _},token:_,providedIn:"root"});let at=(()=>{class s{constructor(t,e,a,i,n){this.cropService=t,this.cropperPositionService=e,this.loadImageService=a,this.sanitizer=i,this.cd=n,this.Hammer=typeof window<"u"?window.Hammer:null,this.settings=new j,this.setImageMaxSizeRetries=0,this.marginLeft="0px",this.moveTypes=M,this.imageVisible=!1,this.format=this.settings.format,this.transform={},this.maintainAspectRatio=this.settings.maintainAspectRatio,this.aspectRatio=this.settings.aspectRatio,this.resizeToWidth=this.settings.resizeToWidth,this.resizeToHeight=this.settings.resizeToHeight,this.cropperMinWidth=this.settings.cropperMinWidth,this.cropperMinHeight=this.settings.cropperMinHeight,this.cropperMaxHeight=this.settings.cropperMaxHeight,this.cropperMaxWidth=this.settings.cropperMaxWidth,this.cropperStaticWidth=this.settings.cropperStaticWidth,this.cropperStaticHeight=this.settings.cropperStaticHeight,this.canvasRotation=this.settings.canvasRotation,this.initialStepSize=this.settings.initialStepSize,this.roundCropper=this.settings.roundCropper,this.onlyScaleDown=this.settings.onlyScaleDown,this.imageQuality=this.settings.imageQuality,this.autoCrop=this.settings.autoCrop,this.backgroundColor=this.settings.backgroundColor,this.containWithinAspectRatio=this.settings.containWithinAspectRatio,this.hideResizeSquares=this.settings.hideResizeSquares,this.cropper={x1:-100,y1:-100,x2:1e4,y2:1e4},this.alignImage=this.settings.alignImage,this.disabled=!1,this.imageCropped=new o.vpe,this.startCropImage=new o.vpe,this.imageLoaded=new o.vpe,this.cropperReady=new o.vpe,this.loadImageFailed=new o.vpe,this.reset()}ngOnChanges(t){this.onChangesUpdateSettings(t),this.onChangesInputImage(t),this.loadedImage&&this.loadedImage.original.image.complete&&(t.containWithinAspectRatio||t.canvasRotation)&&this.loadImageService.transformLoadedImage(this.loadedImage,this.settings).then(e=>this.setLoadedImage(e)).catch(e=>this.loadImageError(e)),t.cropper&&(this.setMaxSize(),this.setCropperScaledMinSize(),this.setCropperScaledMaxSize(),this.checkCropperPosition(!1),this.doAutoCrop(),this.cd.markForCheck()),t.aspectRatio&&this.imageVisible&&this.resetCropperPosition(),t.transform&&(this.transform=this.transform||{},this.setCssTransform(),this.doAutoCrop())}onChangesUpdateSettings(t){this.settings.setOptionsFromChanges(t),this.settings.cropperStaticHeight&&this.settings.cropperStaticWidth&&this.settings.setOptions({hideResizeSquares:!0,cropperMinWidth:this.settings.cropperStaticWidth,cropperMinHeight:this.settings.cropperStaticHeight,cropperMaxHeight:this.settings.cropperStaticHeight,cropperMaxWidth:this.settings.cropperStaticWidth,maintainAspectRatio:!1})}onChangesInputImage(t){(t.imageChangedEvent||t.imageURL||t.imageBase64||t.imageFile)&&this.reset(),t.imageChangedEvent&&this.isValidImageChangedEvent()&&this.loadImageFile(this.imageChangedEvent.target.files[0]),t.imageURL&&this.imageURL&&this.loadImageFromURL(this.imageURL),t.imageBase64&&this.imageBase64&&this.loadBase64Image(this.imageBase64),t.imageFile&&this.imageFile&&this.loadImageFile(this.imageFile)}isValidImageChangedEvent(){return this.imageChangedEvent&&this.imageChangedEvent.target&&this.imageChangedEvent.target.files&&this.imageChangedEvent.target.files.length>0}setCssTransform(){this.safeTransformStyle=this.sanitizer.bypassSecurityTrustStyle("scaleX("+(this.transform.scale||1)*(this.transform.flipH?-1:1)+")scaleY("+(this.transform.scale||1)*(this.transform.flipV?-1:1)+")rotate("+(this.transform.rotate||0)+"deg)")}ngOnInit(){this.settings.stepSize=this.initialStepSize,this.activatePinchGesture()}reset(){this.imageVisible=!1,this.loadedImage=null,this.safeImgDataUrl="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQYV2NgAAIAAAUAAarVyFEAAAAASUVORK5CYII=",this.moveStart={active:!1,type:null,position:null,x1:0,y1:0,x2:0,y2:0,clientX:0,clientY:0},this.maxSize={width:0,height:0},this.cropper.x1=-100,this.cropper.y1=-100,this.cropper.x2=1e4,this.cropper.y2=1e4}loadImageFile(t){this.loadImageService.loadImageFile(t,this.settings).then(e=>this.setLoadedImage(e)).catch(e=>this.loadImageError(e))}loadBase64Image(t){this.loadImageService.loadBase64Image(t,this.settings).then(e=>this.setLoadedImage(e)).catch(e=>this.loadImageError(e))}loadImageFromURL(t){this.loadImageService.loadImageFromURL(t,this.settings).then(e=>this.setLoadedImage(e)).catch(e=>this.loadImageError(e))}setLoadedImage(t){this.loadedImage=t,this.safeImgDataUrl=this.sanitizer.bypassSecurityTrustResourceUrl(t.transformed.base64),this.cd.markForCheck()}loadImageError(t){console.error(t),this.loadImageFailed.emit()}imageLoadedInView(){null!=this.loadedImage&&(this.imageLoaded.emit(this.loadedImage),this.setImageMaxSizeRetries=0,setTimeout(()=>this.checkImageMaxSizeRecursively()))}checkImageMaxSizeRecursively(){this.setImageMaxSizeRetries>40?this.loadImageFailed.emit():this.sourceImageLoaded()?(this.setMaxSize(),this.setCropperScaledMinSize(),this.setCropperScaledMaxSize(),this.resetCropperPosition(),this.cropperReady.emit(Object.assign({},this.maxSize)),this.cd.markForCheck()):(this.setImageMaxSizeRetries++,setTimeout(()=>this.checkImageMaxSizeRecursively(),50))}sourceImageLoaded(){return this.sourceImage&&this.sourceImage.nativeElement&&this.sourceImage.nativeElement.offsetWidth>0}onResize(){!this.loadedImage||(this.resizeCropperPosition(),this.setMaxSize(),this.setCropperScaledMinSize(),this.setCropperScaledMaxSize())}activatePinchGesture(){if(this.Hammer){const t=new this.Hammer(this.wrapper.nativeElement);t.get("pinch").set({enable:!0}),t.on("pinchmove",this.onPinch.bind(this)),t.on("pinchend",this.pinchStop.bind(this)),t.on("pinchstart",this.startPinch.bind(this))}else(0,o.X6Q)()&&console.warn("[NgxImageCropper] Could not find HammerJS - Pinch Gesture won't work")}resizeCropperPosition(){const t=this.sourceImage.nativeElement;(this.maxSize.width!==t.offsetWidth||this.maxSize.height!==t.offsetHeight)&&(this.cropper.x1=this.cropper.x1*t.offsetWidth/this.maxSize.width,this.cropper.x2=this.cropper.x2*t.offsetWidth/this.maxSize.width,this.cropper.y1=this.cropper.y1*t.offsetHeight/this.maxSize.height,this.cropper.y2=this.cropper.y2*t.offsetHeight/this.maxSize.height)}resetCropperPosition(){this.cropperPositionService.resetCropperPosition(this.sourceImage,this.cropper,this.settings),this.doAutoCrop(),this.imageVisible=!0}keyboardAccess(t){this.changeKeyboardStepSize(t),this.keyboardMoveCropper(t)}changeKeyboardStepSize(t){t.key>="1"&&t.key<="9"&&(this.settings.stepSize=+t.key)}keyboardMoveCropper(t){if(!["ArrowUp","ArrowDown","ArrowRight","ArrowLeft"].includes(t.key))return;const a=t.shiftKey?M.Resize:M.Move,i=t.altKey?function et(s){switch(s){case"ArrowUp":return"bottom";case"ArrowRight":return"left";case"ArrowDown":return"top";default:return"right"}}(t.key):function tt(s){switch(s){case"ArrowUp":return"top";case"ArrowRight":return"right";case"ArrowDown":return"bottom";default:return"left"}}(t.key),n=function it(s,r){switch(s){case"ArrowUp":return{clientX:0,clientY:-1*r};case"ArrowRight":return{clientX:r,clientY:0};case"ArrowDown":return{clientX:0,clientY:r};default:return{clientX:-1*r,clientY:0}}}(t.key,this.settings.stepSize);t.preventDefault(),t.stopPropagation(),this.startMove({clientX:0,clientY:0},a,i),this.moveImg(n),this.moveStop()}startMove(t,e,a=null){this.moveStart&&this.moveStart.active&&this.moveStart.type===M.Pinch||(t.preventDefault&&t.preventDefault(),this.moveStart=Object.assign({active:!0,type:e,position:a,clientX:this.cropperPositionService.getClientX(t),clientY:this.cropperPositionService.getClientY(t)},this.cropper))}startPinch(t){!this.safeImgDataUrl||(t.preventDefault&&t.preventDefault(),this.moveStart=Object.assign({active:!0,type:M.Pinch,position:"center",clientX:this.cropper.x1+(this.cropper.x2-this.cropper.x1)/2,clientY:this.cropper.y1+(this.cropper.y2-this.cropper.y1)/2},this.cropper))}moveImg(t){this.moveStart.active&&(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),this.moveStart.type===M.Move?(this.cropperPositionService.move(t,this.moveStart,this.cropper),this.checkCropperPosition(!0)):this.moveStart.type===M.Resize&&(!this.cropperStaticWidth&&!this.cropperStaticHeight&&this.cropperPositionService.resize(t,this.moveStart,this.cropper,this.maxSize,this.settings),this.checkCropperPosition(!1)),this.cd.detectChanges())}onPinch(t){this.moveStart.active&&(t.stopPropagation&&t.stopPropagation(),t.preventDefault&&t.preventDefault(),this.moveStart.type===M.Pinch&&(this.cropperPositionService.resize(t,this.moveStart,this.cropper,this.maxSize,this.settings),this.checkCropperPosition(!1)),this.cd.detectChanges())}setMaxSize(){if(this.sourceImage){const t=this.sourceImage.nativeElement;this.maxSize.width=t.offsetWidth,this.maxSize.height=t.offsetHeight,this.marginLeft=this.sanitizer.bypassSecurityTrustStyle("calc(50% - "+this.maxSize.width/2+"px)")}}setCropperScaledMinSize(){this.loadedImage&&this.loadedImage.transformed&&this.loadedImage.transformed.image?(this.setCropperScaledMinWidth(),this.setCropperScaledMinHeight()):(this.settings.cropperScaledMinWidth=20,this.settings.cropperScaledMinHeight=20)}setCropperScaledMinWidth(){this.settings.cropperScaledMinWidth=this.cropperMinWidth>0?Math.max(20,this.cropperMinWidth/this.loadedImage.transformed.image.width*this.maxSize.width):20}setCropperScaledMinHeight(){this.settings.cropperScaledMinHeight=this.maintainAspectRatio?Math.max(20,this.settings.cropperScaledMinWidth/this.aspectRatio):this.cropperMinHeight>0?Math.max(20,this.cropperMinHeight/this.loadedImage.transformed.image.height*this.maxSize.height):20}setCropperScaledMaxSize(){if(this.loadedImage&&this.loadedImage.transformed&&this.loadedImage.transformed.image){const t=this.loadedImage.transformed.size.width/this.maxSize.width;this.settings.cropperScaledMaxWidth=this.cropperMaxWidth>20?this.cropperMaxWidth/t:this.maxSize.width,this.settings.cropperScaledMaxHeight=this.cropperMaxHeight>2
10?this.cropperMaxHeight/t:this.maxSize.height,this.maintainAspectRatio&&(this.settings.cropperScaledMaxWidth>this.settings.cropperScaledMaxHeight*this.aspectRatio?this.settings.cropperScaledMaxWidth=this.settings.cropperScaledMaxHeight*this.aspectRatio:this.settings.cropperScaledMaxWidth<this.settings.cropperScaledMaxHeight*this.aspectRatio&&(this.settings.cropperScaledMaxHeight=this.settings.cropperScaledMaxWidth/this.aspectRatio))}else this.settings.cropperScaledMaxWidth=this.maxSize.width,this.settings.cropperScaledMaxHeight=this.maxSize.height}checkCropperPosition(t=!1){this.cropper.x1<0&&(this.cropper.x2-=t?this.cropper.x1:0,this.cropper.x1=0),this.cropper.y1<0&&(this.cropper.y2-=t?this.cropper.y1:0,this.cropper.y1=0),this.cropper.x2>this.maxSize.width&&(this.cropper.x1-=t?this.cropper.x2-this.maxSize.width:0,this.cropper.x2=this.maxSize.width),this.cropper.y2>this.maxSize.height&&(this.cropper.y1-=t?this.cropper.y2-this.maxSize.height:0,this.cropper.y2=this.maxSize.height)}moveStop(){this.moveStart.active&&(this.moveStart.active=!1,this.doAutoCrop())}pinchStop(){this.moveStart.active&&(this.moveStart.active=!1,this.doAutoCrop())}doAutoCrop(){this.autoCrop&&this.crop()}crop(){if(this.sourceImage&&this.sourceImage.nativeElement&&null!=this.loadedImage.transformed.image){this.startCropImage.emit();const t=this.cropService.crop(this.sourceImage,this.loadedImage,this.cropper,this.settings);return null!=t&&this.imageCropped.emit(t),t}return null}}return s.\u0275fac=function(t){return new(t||s)(o.Y36(f),o.Y36(_),o.Y36(u),o.Y36(L.H7),o.Y36(o.sBO))},s.\u0275cmp=o.Xpm({type:s,selectors:[["image-cropper"]],viewQuery:function(t,e){if(1&t&&(o.Gf(Y,7),o.Gf(Z,5)),2&t){let a;o.iGM(a=o.CRH())&&(e.wrapper=a.first),o.iGM(a=o.CRH())&&(e.sourceImage=a.first)}},hostVars:4,hostBindings:function(t,e){1&t&&o.NdJ("resize",function(){return e.onResize()},!1,o.Jf7)("mousemove",function(i){return e.moveImg(i)},!1,o.evT)("touchmove",function(i){return e.moveImg(i)},!1,o.evT)("mouseup",function(){return e.moveStop()},!1,o.evT)("touchend",function(){return e.moveStop()},!1,o.evT),2&t&&(o.Udp("text-align",e.alignImage),o.ekj("disabled",e.disabled))},inputs:{format:"format",transform:"transform",maintainAspectRatio:"maintainAspectRatio",aspectRatio:"aspectRatio",resizeToWidth:"resizeToWidth",resizeToHeight:"resizeToHeight",cropperMinWidth:"cropperMinWidth",cropperMinHeight:"cropperMinHeight",cropperMaxHeight:"cropperMaxHeight",cropperMaxWidth:"cropperMaxWidth",cropperStaticWidth:"cropperStaticWidth",cropperStaticHeight:"cropperStaticHeight",canvasRotation:"canvasRotation",initialStepSize:"initialStepSize",roundCropper:"roundCropper",onlyScaleDown:"onlyScaleDown",imageQuality:"imageQuality",autoCrop:"autoCrop",backgroundColor:"backgroundColor",containWithinAspectRatio:"containWithinAspectRatio",hideResizeSquares:"hideResizeSquares",cropper:"cropper",alignImage:"alignImage",disabled:"disabled",imageChangedEvent:"imageChangedEvent",imageURL:"imageURL",imageBase64:"imageBase64",imageFile:"imageFile"},outputs:{imageCropped:"imageCropped",startCropImage:"startCropImage",imageLoaded:"imageLoaded",cropperReady:"cropperReady",loadImageFailed:"loadImageFailed"},features:[o.TTD],decls:5,vars:10,consts:[["wrapper",""],["class","source-image",3,"src","visibility","transform","load",4,"ngIf"],[1,"overlay"],["class","cropper","tabindex","0",3,"rounded","top","left","width","height","margin-left","visibility","keydown",4,"ngIf"],[1,"source-image",3,"src","load"],["sourceImage",""],["tabindex","0",1,"cropper",3,"keydown"],[1,"move",3,"mousedown","touchstart"],[4,"ngIf"],[1,"resize","topleft",3,"mousedown","touchstart"],[1,"square"],[1,"resize","top"],[1,"resize","topright",3,"mousedown","touchstart"],[1,"resize","right"],[1,"resize","bottomright",3,"mousedown","touchstart"],[1,"resize","bottom"],[1,"resize","bottomleft",3,"mousedown","touchstart"],[1,"resize","left"],[1,"resize-bar","top",3,"mousedown","touchstart"],[1,"resize-bar","right",3,"mousedown","touchstart"],[1,"resize-bar","bottom",3,"mousedown","touchstart"],[1,"resize-bar","left",3,"mousedown","touchstart"]],template:function(t,e){1&t&&(o.TgZ(0,"div",null,0),o.YNc(2,K,2,5,"img",1),o._UZ(3,"div",2),o.YNc(4,X,3,15,"div",3),o.qZA()),2&t&&(o.Udp("background",e.imageVisible&&e.backgroundColor),o.xp6(2),o.Q6J("ngIf",e.safeImgDataUrl),o.xp6(1),o.Udp("width",e.maxSize.width,"px")("height",e.maxSize.height,"px")("margin-left","center"===e.alignImage?e.marginLeft:null),o.xp6(1),o.Q6J("ngIf",e.imageVisible))},dependencies:[T.O5],styles:['[_nghost-%COMP%]{display:flex;position:relative;width:100%;max-width:100%;max-height:100%;overflow:hidden;padding:5px;text-align:center}[_nghost-%COMP%] > div[_ngcontent-%COMP%]{width:100%;position:relative}[_nghost-%COMP%] > div[_ngcontent-%COMP%] img.source-image[_ngcontent-%COMP%]{max-width:100%;max-height:100%;transform-origin:center}[_nghost-%COMP%] .overlay[_ngcontent-%COMP%]{position:absolute;pointer-events:none;touch-action:none;
1outline:var(--cropper-overlay-color,#fff) solid 100vw;top:0;left:0}[_nghost-%COMP%] .cropper[_ngcontent-%COMP%]{position:absolute;display:flex;color:#53535c;background:0 0;outline:rgba(255,255,255,.3) solid 100vw;outline:var(--cropper-outline-color,rgba(255,255,255,.3)) solid 100vw;touch-action:none}[_nghost-%COMP%] .cropper[_ngcontent-%COMP%]:after{position:absolute;content:"";top:0;bottom:0;left:0;right:0;pointer-events:none;border:1px dashed;opacity:.75;color:inherit;z-index:1}[_nghost-%COMP%] .cropper[_ngcontent-%COMP%] .move[_ngcontent-%COMP%]{width:100%;cursor:move;border:1px solid rgba(255,255,255,.5)}[_nghost-%COMP%] .cropper[_ngcontent-%COMP%]:focus .move[_ngcontent-%COMP%]{border-color:#1e90ff;border-width:2px}[_nghost-%COMP%] .cropper[_ngcontent-%COMP%] .resize[_ngcontent-%COMP%]{position:absolute;display:inline-block;line-height:6px;padding:8px;opacity:.85;z-index:1}[_nghost-%COMP%] .cropper[_ngcontent-%COMP%] .resize[_ngcontent-%COMP%] .square[_ngcontent-%COMP%]{display:inline-block;background:#53535c;width:6px;height:6px;border:1px solid rgba(255,255,255,.5);box-sizing:content-box}[_nghost-%COMP%] .cropper[_ngcontent-%COMP%] .resize.topleft[_ngcontent-%COMP%]{top:-12px;left:-12px;cursor:nwse-resize}[_nghost-%COMP%] .cropper[_ngcontent-%COMP%] .resize.top[_ngcontent-%COMP%]{top:-12px;left:calc(50% - 12px);cursor:ns-resize}[_nghost-%COMP%] .cropper[_ngcontent-%COMP%] .resize.topright[_ngcontent-%COMP%]{top:-12px;right:-12px;cursor:nesw-resize}[_nghost-%COMP%] .cropper[_ngcontent-%COMP%] .resize.right[_ngcontent-%COMP%]{top:calc(50% - 12px);right:-12px;cursor:ew-resize}[_nghost-%COMP%] .cropper[_ngcontent-%COMP%] .resize.bottomright[_ngcontent-%COMP%]{bottom:-12px;right:-12px;cursor:nwse-resize}[_nghost-%COMP%] .cropper[_ngcontent-%COMP%] .resize.bottom[_ngcontent-%COMP%]{bottom:-12px;left:calc(50% - 12px);cursor:ns-resize}[_nghost-%COMP%] .cropper[_ngcontent-%COMP%] .resize.bottomleft[_ngcontent-%COMP%]{bottom:-12px;left:-12px;cursor:nesw-resize}[_nghost-%COMP%] .cropper[_ngcontent-%COMP%] .resize.left[_ngcontent-%COMP%]{top:calc(50% - 12px);left:-12px;cursor:ew-resize}[_nghost-%COMP%] .cropper[_ngcontent-%COMP%] .resize-bar[_ngcontent-%COMP%]{position:absolute;z-index:1}[_nghost-%COMP%] .cropper[_ngcontent-%COMP%] .resize-bar.top[_ngcontent-%COMP%]{top:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}[_nghost-%COMP%] .cropper[_ngcontent-%COMP%] .resize-bar.right[_ngcontent-%COMP%]{top:11px;right:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}[_nghost-%COMP%] .cropper[_ngcontent-%COMP%] .resize-bar.bottom[_ngcontent-%COMP%]{bottom:-11px;left:11px;width:calc(100% - 22px);height:22px;cursor:ns-resize}[_nghost-%COMP%] .cropper[_ngcontent-%COMP%] .resize-bar.left[_ngcontent-%COMP%]{top:11px;left:-11px;height:calc(100% - 22px);width:22px;cursor:ew-resize}[_nghost-%COMP%] .cropper.rounded[_ngcontent-%COMP%]{outline-color:transparent}[_nghost-%COMP%] .cropper.rounded[_ngcontent-%COMP%]:after{border-radius:100%;box-shadow:0 0 0 100vw rgba(255,255,255,.3);box-shadow:0 0 0 100vw var(--cropper-outline-color,rgba(255,255,255,.3))}@media (orientation:portrait){[_nghost-%COMP%] .cropper[_ngcontent-%COMP%]{outline-width:100vh}[_nghost-%COMP%] .cropper.rounded[_ngcontent-%COMP%]:after{box-shadow:0 0 0 100vh rgba(255,255,255,.3);box-shadow:0 0 0 100vh var(--cropper-outline-color,rgba(255,255,255,.3))}}[_nghost-%COMP%] .cropper.rounded[_ngcontent-%COMP%] .move[_ngcontent-%COMP%]{border-radius:100%}.disabled[_nghost-%COMP%] .cropper[_ngcontent-%COMP%] .move[_ngcontent-%COMP%], .disabled[_nghost-%COMP%] .cropper[_ngcontent-%COMP%] .resize[_ngcontent-%COMP%], .disabled[_nghost-%COMP%] .cropper[_ngcontent-%COMP%] .resize-bar[_ngcontent-%COMP%]{display:none}'],changeDetection:0}),s})(),ot=(()=>{class s{}return s.\u0275fac=function(t){return new(t||s)},s.\u0275mod=o.oAB({type:s}),s.\u0275inj=o.cJS({imports:[T.ez]}),s})()}}]);
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.