PageSourceSearch

https://baug.fr/_next/static/chunks/0-2-z5ujjdi4v.js

js baug.fr collected 2026-10-08 12:47:56 UTC 29,635 bytes, 1 lines download raw bytes

1(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,600652,(e,t,o)=>{var r,i,n,a,s,c,h,p,l,u,d,m,g,f,v,w=!1;function x(){if(!w){w=!0;var e=navigator.userAgent,t=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(e),o=/(Mac OS X)|(Windows)|(Linux)/.exec(e);if(m=/\b(iPhone|iP[ao]d)/.exec(e),g=/\b(iP[ao]d)/.exec(e),u=/Android/i.exec(e),f=/FBAN\/\w+;/i.exec(e),v=/Mobile/i.exec(e),d=!!/Win64/.exec(e),t){(r=t[1]?parseFloat(t[1]):t[5]?parseFloat(t[5]):NaN)&&document&&document.documentMode&&(r=document.documentMode);var x=/(?:Trident\/(\d+.\d+))/.exec(e);c=x?parseFloat(x[1])+4:r,i=t[2]?parseFloat(t[2]):NaN,n=t[3]?parseFloat(t[3]):NaN,s=(a=t[4]?parseFloat(t[4]):NaN)&&(t=/(?:Chrome\/(\d+\.\d+))/.exec(e))&&t[1]?parseFloat(t[1]):NaN}else r=i=n=s=a=NaN;if(o){if(o[1]){var y=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(e);h=!y||parseFloat(y[1].replace("_","."))}else h=!1;p=!!o[2],l=!!o[3]}else h=p=l=!1}}var y={ie:function(){return x()||r},ieCompatibilityMode:function(){return x()||c>r},ie64:function(){return y.ie()&&d},firefox:function(){return x()||i},opera:function(){return x()||n},webkit:function(){return x()||a},safari:function(){return y.webkit()},chrome:function(){return x()||s},windows:function(){return x()||p},osx:function(){return x()||h},linux:function(){return x()||l},iphone:function(){return x()||m},mobile:function(){return x()||m||g||u||v},nativeApp:function(){return x()||f},android:function(){return x()||u},ipad:function(){return x()||g}};t.exports=y},410316,(e,t,o)=>{"use strict";var r=!!("u">typeof window&&window.document&&window.document.createElement);t.exports={canUseDOM:r,canUseWorkers:"u">typeof Worker,canUseEventListeners:r&&!!(window.addEventListener||window.attachEvent),canUseViewport:r&&!!window.screen,isInWorker:!r}},433418,(e,t,o)=>{"use strict";var r,i=e.r(410316);i.canUseDOM&&(r=document.implementation&&document.implementation.hasFeature&&!0!==document.implementation.hasFeature("","")),t.exports=function(e,t){if(!i.canUseDOM||t&&!("addEventListener"in document))return!1;var o="on"+e,n=o in document;if(!n){var a=document.createElement("div");a.setAttribute(o,"return;"),n="function"==typeof a[o]}return!n&&r&&"wheel"===e&&(n=document.implementation.hasFeature("Events.wheel","3.0")),n}},952545,(e,t,o)=>{"use strict";var r=e.r(600652),i=e.r(433418);function n(e){var t=0,o=0,r=0,i=0;return"detail"in e&&(o=e.detail),"wheelDelta"in e&&(o=-e.wheelDelta/120),"wheelDeltaY"in e&&(o=-e.wheelDeltaY/120),"wheelDeltaX"in e&&(t=-e.wheelDeltaX/120),"axis"in e&&e.axis===e.HORIZONTAL_AXIS&&(t=o,o=0),r=10*t,i=10*o,"deltaY"in e&&(i=e.deltaY),"deltaX"in e&&(r=e.deltaX),(r||i)&&e.deltaMode&&(1==e.deltaMode?(r*=40,i*=40):(r*=800,i*=800)),r&&!t&&(t=r<1?-1:1),i&&!o&&(o=i<1?-1:1),{spinX:t,spinY:o,pixelX:r,pixelY:i}}n.getEventType=function(){return r.firefox()?"DOMMouseScroll":i("wheel")?"wheel":"mousewheel"},t.exports=n},699733,(e,t,o)=>{t.exports=e.r(952545)},976351,e=>{"use strict";var t=e.i(843476),o=e.i(271645),r=e.i(290571),i=e.i(699733);function n(e,t,o,r,i){void 0===i&&(i=0);var n=u(t.width,t.height,i),s=n.width,c=n.height;return{x:a(e.x,s,o.width,r),y:a(e.y,c,o.height,r)}}function a(e,t,o,r){var i=t*r/2-o/2;return d(e,-i,i)}function s(e,t){return Math.sqrt(Math.pow(e.y-t.y,2)+Math.pow(e.x-t.x,2))}function c(e,t){return 180*Math.atan2(t.y-e.y,t.x-e.x)/Math.PI}function h(e,t){return Math.min(e,Math.max(0,t))}function p(e,t){return t}function l(e,t){return{x:(t.x+e.x)/2,y:(t.y+e.y)/2}}function u(e,t,o){var r=o*Math.PI/180;return{width:Math.abs(Math.cos(r)*e)+Math.abs(Math.sin(r)*t),height:Math.abs(Math.sin(r)*e)+Math.abs(Math.cos(r)*t)}}function d(e,t,o){return Math.min(Math.max(e,t),o)}function m(){for(var e=[],t=0;t<arguments.length;t++)e[t]=arguments[t];return e.filter(function(e){return"string"==typeof e&&!!(e.length>0)}).join(" ").trim()}var g=function(e){function t(){var a=null!==e&&e.apply(this,arguments)||this;return a.cropperRef=o.createRef(),a.imageRef=o.createRef(),a.videoRef=o.createRef(),a.containerPosition={x:0,y:0}
1,a.containerRef=null,a.styleRef=null,a.containerRect=null,a.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},a.dragStartPosition={x:0,y:0},a.dragStartCrop={x:0,y:0},a.gestureZoomStart=0,a.gestureRotationStart=0,a.isTouching=!1,a.lastPinchDistance=0,a.lastPinchRotation=0,a.rafDragTimeout=null,a.rafPinchTimeout=null,a.wheelTimer=null,a.currentDoc="u">typeof document?document:null,a.currentWindow="u">typeof window?window:null,a.resizeObserver=null,a.previousCropSize=null,a.isInitialized=!1,a.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},a.initResizeObserver=function(){if(void 0!==window.ResizeObserver&&a.containerRef){var e=!0;a.resizeObserver=new window.ResizeObserver(function(t){if(e){e=!1;return}a.computeSizes()}),a.resizeObserver.observe(a.containerRef)}},a.preventZoomSafari=function(e){return e.preventDefault()},a.cleanEvents=function(){a.currentDoc&&(a.currentDoc.removeEventListener("mousemove",a.onMouseMove),a.currentDoc.removeEventListener("mouseup",a.onDragStopped),a.currentDoc.removeEventListener("touchmove",a.onTouchMove),a.currentDoc.removeEventListener("touchend",a.onDragStopped),a.currentDoc.removeEventListener("gesturechange",a.onGestureChange),a.currentDoc.removeEventListener("gestureend",a.onGestureEnd),a.currentDoc.removeEventListener("scroll",a.onScroll))},a.clearScrollEvent=function(){a.containerRef&&a.containerRef.removeEventListener("wheel",a.onWheel),a.wheelTimer&&clearTimeout(a.wheelTimer)},a.onMediaLoad=function(){var e=a.computeSizes();e&&(a.previousCropSize=e,a.emitCropData(),a.setInitialCrop(e),a.isInitialized=!0),a.props.onMediaLoaded&&a.props.onMediaLoaded(a.mediaSize)},a.setInitialCrop=function(e){if(a.props.initialCroppedAreaPercentages){var t,o,r,i,n,s,c,h=(t=a.props.initialCroppedAreaPercentages,o=a.mediaSize,r=a.props.rotation,i=a.props.minZoom,n=a.props.maxZoom,s=u(o.width,o.height,r),{crop:{x:(c=d(e.width/s.width*(100/t.width),i,n))*s.width/2-e.width/2-s.width*c*(t.x/100),y:c*s.height/2-e.height/2-s.height*c*(t.y/100)},zoom:c}
1),p=h.crop,l=h.zoom;a.props.onCropChange(p),a.props.onZoomChange&&a.props.onZoomChange(l)}else if(a.props.initialCroppedAreaPixels){var m,g,f,v,w,x,y,C,S,b=(m=a.props.initialCroppedAreaPixels,g=a.mediaSize,f=a.props.rotation,v=a.props.minZoom,w=a.props.maxZoom,void 0===f&&(f=0),x=u(g.naturalWidth,g.naturalHeight,f),C=d((y=g.width>g.height?g.width/g.naturalWidth:g.height/g.naturalHeight,e.height>e.width?e.height/(m.height*y):e.width/(m.width*y)),v,w),S=e.height>e.width?e.height/m.height:e.width/m.width,{crop:{x:((x.width-m.width)/2-m.x)*S,y:((x.height-m.height)/2-m.y)*S},zoom:C}),p=b.crop,l=b.zoom;a.props.onCropChange(p),a.props.onZoomChange&&a.props.onZoomChange(l)}},a.computeSizes=function(){var e,t,o,i,n,s,c=a.imageRef.current||a.videoRef.current;if(c&&a.containerRef){a.containerRect=a.containerRef.getBoundingClientRect(),a.saveContainerPosition();var h,p,l,d,m,g,f,v,w,x,y,C=a.containerRect.width/a.containerRect.height,S=(null==(e=a.imageRef.current)?void 0:e.naturalWidth)||(null==(t=a.videoRef.current)?void 0:t.videoWidth)||0,b=(null==(o=a.imageRef.current)?void 0:o.naturalHeight)||(null==(i=a.videoRef.current)?void 0:i.videoHeight)||0,z=c.offsetWidth<S||c.offsetHeight<b,R=S/b,D=void 0;if(z)switch(a.state.mediaObjectFit){default:case"contain":D=C>R?{width:a.containerRect.height*R,height:a.containerRect.height}:{width:a.containerRect.width,height:a.containerRect.width/R};break;case"horizontal-cover":D={width:a.containerRect.width,height:a.containerRect.width/R};break;case"vertical-cover":D={width:a.containerRect.height*R,height:a.containerRect.height}}else D={width:c.offsetWidth,height:c.offsetHeight};a.mediaSize=(0,r.__assign)((0,r.__assign)({},D),{naturalWidth:S,naturalHeight:b}),a.props.setMediaSize&&a.props.setMediaSize(a.mediaSize);var M=a.props.cropSize?a.props.cropSize:(h=a.mediaSize.width,p=a.mediaSize.height,l=a.containerRect.width,d=a.containerRect.height,m=a.props.aspect,void 0===(g=a.props.rotation)&&(g=0),v=(f=u(h,p,g)).width,w=f.height,(x=Math.min(v,l))>(y=Math.min(w,d))*m?{width:y*m,height:y}:{width:x,height:x/m});return((null==(n=a.state.cropSize)?void 0:n.height)!==M.height||(null==(s=a.state.cropSize)?void 0:s.width)!==M.width)&&a.props.onCropSizeChange&&a.props.onCropSizeChange(M),a.setState({cropSize:M},a.recomputeCropPosition),a.props.setCropSize&&a.props.setCropSize(M),M}},a.saveContainerPosition=function(){if(a.containerRef){var e=a.containerRef.getBoundingClientRect();a.containerPosition={x:e.left,y:e.top}}},a.onMouseDown=function(e){a.currentDoc&&(e.preventDefault(),a.currentDoc.addEventListener("mousemove",a.onMouseMove),a.currentDoc.addEventListener("mouseup",a.onDragStopped),a.saveContainerPosition(),a.onDragStart(t.getMousePoint(e)))},a.onMouseMove=function(e){return a.onDrag(t.getMousePoint(e))},a.onScroll=function(e){a.currentDoc&&(e.preventDefault(),a.saveContainerPosition())},a.onTouchStart=function(e){!a.currentDoc||(a.isTouching=!0,(!a.props.onTouchRequest||a.props.onTouchRequest(e))&&(a.currentDoc.addEventListener("touchmove",a.onTouchMove,{passive:!1}),a.currentDoc.addEventListener("touchend",a.onDragStopped),a.saveContainerPosition(),2===e.touches.length?a.onPinchStart(e):1===e.touches.length&&a.onDragStart(t.getTouchPoint(e.touches[0]))))},a.onTouchMove=function(e){e.preventDefault(),2===e.touches.length?a.onPinchMove(e):1===e.touches.length&&a.onDrag(t.getTouchPoint(e.touches[0]))},a.onGestureStart=function(e){a.currentDoc&&(e.preventDefault(),a.currentDoc.addEventListener("gesturechange",a.onGestureChange),a.currentDoc.addEventListener("gestureend",a.onGestureEnd),a.gestureZoomStart=a.props.zoom,a.gestureRotationStart=a.props.rotation)},a.onGestureChange=function(e){if(e.preventDefault(),!a.isTouching){var o=t.getMousePoint(e),r=a.gestureZoomStart-1+e.scale;if(a.setNewZoom(r,o,{shouldUpdatePosition:!0}),a.props.onRotationChange){var i=a.gestureRotationStart+e.rotation;a.props.onRotationChange(i)}}},a.onGestureEnd=function(e){a.cleanEvents()},a.onDragStart=function(e){var t,o;a.dragStartPosition={x:e.x,y:e.y},a.dragStartCrop=(0,r.__assign)({},a.props.crop),null==(o=(t=a.props).onInteractionStart)||o.call(t)},a.onDrag=function(e){var t=e.x,o=e.y;a.currentWindow&&(a.rafDragTimeout&&a.currentWindow.cancelAnimationFrame(a.rafDragTimeout),a.rafDragTimeout=a.currentWindow.requestAnimationFrame(function(){if(a.state.cropSize&&void 0!==t&&void 0!==o){var e=t-a.dragStartPosition.x,r=o-a.dragStartPosition.y,i={x:a.dragStartCrop.x+e,y:a.dragStartCrop.y+r},s=a.props.restrictPosition?n(i,a.mediaSize,a.state.cropSize,a.props.zoom,a.props.rotation):i;a.props.onCropChange(s)}}))},a.onDragStopped=function(){var e,t;a.isTouching=!1,a.cleanEvents(),a.emitCropData(),null==(t=(e=a.props).onInteractionEnd)||t.call(e)},a.onWheel=function(e){if(a.currentWindow&&(!a.props.onWheelRequest||a.props.onWheelRequest(e))){e.preventDefault();var o=t.getMousePoint(e),r=(0,i.default)(e).pixelY,n=a.props.zoom-r*a.props.zoomSpeed/200;a.setNewZoom(n,o,{shouldUpdatePosition:!0}),a.state.hasWheelJustStarted||a.setState({hasWheelJustStarted:!0},function(){var e,t;return null==(t=(e=a.props).onInteractionStart)?void 0:t.call(e)}),a.wheelTimer&&clearTimeout(a.wheelTimer),a.wheelTimer=a.currentWindow.setTimeout(function(){return a.setState({hasWheelJustStarted:!1},function(){var e,t;return null==(t=(e=a.props).onInteractionEnd)?void 0:t.call(e)})},250)}},a.getPointOnContainer=function(e,t){var o=e.x,r=e.y;if(!a.containerRect)throw Error("The Cropper is not mounted");return{x:a.containerRect.width/2-(o-t.x),y:a.containerRect.height/2-(r-t.y)}},a.getPointOnMedia=function(e){var t=e.x,o=e.y,r=a.props,i=r.crop,n=r.zoom;return{x:(t+i.x)/n,y:(o+i.y)/n}},a.setNewZoom=function(e,t,o){var r=(void 0===o?{}:o).shouldUpdatePosition;if(a.state.cropSize&&a.props.onZoomChange){var i=d(e,a.props.minZoom,a.props.maxZoom);if(void 0===r||r){var s=a.getPointOnContainer(t,a.containerPosition),c=a.getPointOnMedia(s),h={x:c.x*i-s.x,y:c.y*i-s.y},p=a.props.restrictPosition?n(h,a.mediaSize,a.state.cropSize,i,a.props.rotation):h;a.props.onCropChange(p)}a.props.onZoomChange(i)}},a.getCropData=function(){var e,t,o,i,s,c,l,d,m,g,f,v,w,x,y;return a.state.cropSize?(e=a.props.restrictPosition?n(a.props.crop,a.mediaSize,a.state.cropSize,a.props.zoom,a.props.rotation):a.props.crop,t=a.mediaSize,o=a.state.cropSize,i=a.getAspect(),s=a.props.zoom,c=a.props.rotation,l=a.props.restrictPosition,void 0===c&&(c=0),void 0===l&&(l=!0),d=l?h:p,m=u(t.width,t.height,c),g=u(t.naturalWi
1dth,t.naturalHeight,c),f={x:d(100,((m.width-o.width/s)/2-e.x/s)/m.width*100),y:d(100,((m.height-o.height/s)/2-e.y/s)/m.height*100),width:d(100,o.width/m.width*100/s),height:d(100,o.height/m.height*100/s)},v=Math.round(d(g.width,f.width*g.width/100)),w=Math.round(d(g.height,f.height*g.height/100)),x=g.width>=g.height*i?{width:Math.round(w*i),height:w}:{width:v,height:Math.round(v/i)},y=(0,r.__assign)((0,r.__assign)({},x),{x:Math.round(d(g.width-x.width,f.x*g.width/100)),y:Math.round(d(g.height-x.height,f.y*g.height/100))}),{croppedAreaPercentages:f,croppedAreaPixels:y}):null},a.emitCropData=function(){var e=a.getCropData();if(e){var t=e.croppedAreaPercentages,o=e.croppedAreaPixels;a.props.onCropComplete&&a.props.onCropComplete(t,o),a.props.onCropAreaChange&&a.props.onCropAreaChange(t,o)}},a.emitCropAreaChange=function(){var e=a.getCropData();if(e){var t=e.croppedAreaPercentages,o=e.croppedAreaPixels;a.props.onCropAreaChange&&a.props.onCropAreaChange(t,o)}},a.recomputeCropPosition=function(){if(a.state.cropSize){var e,t,o=a.props.crop;if(a.isInitialized&&(null==(e=a.previousCropSize)?void 0:e.width)&&(null==(t=a.previousCropSize)?void 0:t.height)&&(Math.abs(a.previousCropSize.width-a.state.cropSize.width)>1e-6||Math.abs(a.previousCropSize.height-a.state.cropSize.height)>1e-6)){var r=a.state.cropSize.width/a.previousCropSize.width,i=a.state.cropSize.height/a.previousCropSize.height;o={x:a.props.crop.x*r,y:a.props.crop.y*i}}var s=a.props.restrictPosition?n(o,a.mediaSize,a.state.cropSize,a.props.zoom,a.props.rotation):o;a.previousCropSize=a.state.cropSize,a.props.onCropChange(s),a.emitCropData()}},a.onKeyDown=function(e){var t,o,i=a.props,s=i.crop,c=i.onCropChange,h=i.keyboardStep,p=i.zoom,l=i.rotation,u=h;if(a.state.cropSize){e.shiftKey&&(u*=.2);var d=(0,r.__assign)({},s);switch(e.key){case"ArrowUp":d.y-=u,e.preventDefault();break;case"ArrowDown":d.y+=u,e.preventDefault();break;case"ArrowLeft":d.x-=u,e.preventDefault();break;case"ArrowRight":d.x+=u,e.preventDefault();break;default:return}a.props.restrictPosition&&(d=n(d,a.mediaSize,a.state.cropSize,p,l)),e.repeat||null==(o=(t=a.props).onInteractionStart)||o.call(t),c(d)}},a.onKeyUp=function(e){var t,o;switch(e.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":e.preventDefault();break;default:return}a.emitCropData(),null==(o=(t=a.props).onInteractionEnd)||o.call(t)},a}return(0,r.__extends)(t,e),t.prototype.componentDidMount=function(){this.currentDoc&&this.currentWindow&&(this.containerRef&&(this.containerRef.ownerDocument&&(this.currentDoc=this.containerRef.ownerDocument),this.currentDoc.defaultView&&(this.currentWindow=this.currentDoc.defaultView),this.initResizeObserver(),void 0===window.ResizeObserver&&this.currentWindow.addEventListener("resize",this.computeSizes),this.props.zoomWithScroll&&this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}),this.containerRef.addEventListener("gesturestart",this.onGestureStart)),this.currentDoc.addEventListener("scroll",this.onScroll),this.props.disableAutomaticStylesInjection||(this.styleRef=this.currentDoc.createElement("style"),this.styleRef.setAttribute("type","text/css"),this.props.nonce&&this.styleRef.setAttribute("nonce",this.props.nonce),this.styleRef.innerHTML=".reactEasyCrop_Container {\n  position: absolute;\n  top: 0;\n  left: 0;\n  right: 0;\n  bottom: 0;\n  overflow: hidden;\n  user-select: none;\n  touch-action: none;\n  cursor: move;\n  display: flex;\n  justify-content: center;\n  align-items: center;\n}\n\n.reactEasyCrop_Image,\n.reactEasyCrop_Video {\n  will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */\n}\n\n.reactEasyCrop_Contain {\n  max-width: 100%;\n  max-height: 100%;\n  margin: auto;\n  position: absolute;\n  top: 0;\n  bottom: 0;\n  left: 0;\n  right: 0;\n}\n.reactEasyCrop_Cover_Horizontal {\n  width: 100%;\n  height: auto;\n}\n.reactEasyCrop_Cover_Vertical {\n  width: auto;\n  height: 100%;\n}\n\n.reactEasyCrop_CropArea {\n  position: absolute;\n  left: 50%;\n  top: 50%;\n  transform: translate(-50%, -50%);\n  border: 1px solid rgba(255, 255, 255, 0.5);\n  box-sizing: border-box;\n  box-shadow: 0 0 0 9999em;\n  color: rgba(0, 0, 0, 0.5);\n  overflow: hidden;\n}\n\n.reactEasyCrop_CropAreaRound {\n  border-radius: 50%;\n}\n\n.reactEasyCrop_CropAreaGrid::before {\n  content: ' ';\n  box-sizing: border-box;\n  position: absolute;\n  border: 1px solid rgba(255, 255, 255, 0.5);\n  top: 0;\n  bottom: 0;\n  left: 33.33%;\n  right: 33.33%;\n  border-top: 0;\n  border-bottom: 0;\n}
1\n\n.reactEasyCrop_CropAreaGrid::after {\n  content: ' ';\n  box-sizing: border-box;\n  position: absolute;\n  border: 1px solid rgba(255, 255, 255, 0.5);\n  top: 33.33%;\n  bottom: 33.33%;\n  left: 0;\n  right: 0;\n  border-left: 0;\n  border-right: 0;\n}\n",this.currentDoc.head.appendChild(this.styleRef)),this.imageRef.current&&this.imageRef.current.complete&&this.onMediaLoad(),this.props.setImageRef&&this.props.setImageRef(this.imageRef),this.props.setVideoRef&&this.props.setVideoRef(this.videoRef),this.props.setCropperRef&&this.props.setCropperRef(this.cropperRef))},t.prototype.componentWillUnmount=function(){var e,t;this.currentDoc&&this.currentWindow&&(void 0===window.ResizeObserver&&this.currentWindow.removeEventListener("resize",this.computeSizes),null==(e=this.resizeObserver)||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&(null==(t=this.styleRef.parentNode)||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},t.prototype.componentDidUpdate=function(e){e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect||e.objectFit!==this.props.objectFit?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():(null==(t=e.cropSize)?void 0:t.height)!==(null==(o=this.props.cropSize)?void 0:o.height)||(null==(r=e.cropSize)?void 0:r.width)!==(null==(i=this.props.cropSize)?void 0:i.width)?this.computeSizes():((null==(n=e.crop)?void 0:n.x)!==(null==(a=this.props.crop)?void 0:a.x)||(null==(s=e.crop)?void 0:s.y)!==(null==(c=this.props.crop)?void 0:c.y))&&this.emitCropAreaChange(),e.zoomWithScroll!==this.props.zoomWithScroll&&this.containerRef&&(this.props.zoomWithScroll?this.containerRef.addEventListener("wheel",this.onWheel,{passive:!1}):this.clearScrollEvent()),e.video!==this.props.video&&(null==(h=this.videoRef.current)||h.load());var t,o,r,i,n,a,s,c,h,p=this.getObjectFit();p!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:p},this.computeSizes)},t.prototype.getAspect=function(){var e=this.props,t=e.cropSize,o=e.aspect;return t?t.width/t.height:o},t.prototype.getObjectFit=function(){var e,t,o,r;if("cover"===this.props.objectFit){if((this.imageRef.current||this.videoRef.current)&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var i=this.containerRect.width/this.containerRect.height;return((null==(e=this.imageRef.current)?void 0:e.naturalWidth)||(null==(t=this.videoRef.current)?void 0:t.videoWidth)||0)/((null==(o=this.imageRef.current)?void 0:o.naturalHeight)||(null==(r=this.videoRef.current)?void 0:r.videoHeight)||0)<i?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},t.prototype.onPinchStart=function(e){var o=t.getTouchPoint(e.touches[0]),r=t.getTouchPoint(e.touches[1]);this.lastPinchDistance=s(o,r),this.lastPinchRotation=c(o,r),this.onDragStart(l(o,r))},t.prototype.onPinchMove=function(e){var o=this;if(this.currentDoc&&this.currentWindow){var r=t.getTouchPoint(e.touches[0]),i=t.getTouchPoint(e.touches[1]),n=l(r,i);this.onDrag(n),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var e=s(r,i),t=o.props.zoom*(e/o.lastPinchDistance);o.setNewZoom(t,n,{shouldUpdatePosition:!1}),o.lastPinchDistance=e;var a=c(r,i),h=o.props.rotation+(a-o.lastPinchRotation);o.props.onRotationChange&&o.props.onRotationChange(h),o.lastPinchRotation=a})}},t.prototype.render=function(){var e,t=this,i=this.props,n=i.image,a=i.video,s=i.mediaProps,c=i.cropperProps,h=i.transform,p=i.crop,l=p.x,u=p.y,d=i.rotation,g=i.zoom,f=i.cropShape,v=i.showGrid,w=i.roundCropAreaPixels,x=i.style,y=x.containerStyle,C=x.cropAreaStyle,S=x.mediaStyle,b=i.classes,z=b.containerClassName,R=b.cropAreaClassName,D=b.mediaClassName,M=null!=(e=this.state.mediaObjectFit)?e:this.getObjectFit();return o.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(e){return t.containerRef
1=e},"data-testid":"container",style:y,className:m("reactEasyCrop_Container",z)},n?o.createElement("img",(0,r.__assign)({alt:"",className:m("reactEasyCrop_Image","contain"===M&&"reactEasyCrop_Contain","horizontal-cover"===M&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===M&&"reactEasyCrop_Cover_Vertical",D)},s,{src:n,ref:this.imageRef,style:(0,r.__assign)((0,r.__assign)({},S),{transform:h||"translate(".concat(l,"px, ").concat(u,"px) rotate(").concat(d,"deg) scale(").concat(g,")")}),onLoad:this.onMediaLoad})):a&&o.createElement("video",(0,r.__assign)({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:m("reactEasyCrop_Video","contain"===M&&"reactEasyCrop_Contain","horizontal-cover"===M&&"reactEasyCrop_Cover_Horizontal","vertical-cover"===M&&"reactEasyCrop_Cover_Vertical",D)},s,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:(0,r.__assign)((0,r.__assign)({},S),{transform:h||"translate(".concat(l,"px, ").concat(u,"px) rotate(").concat(d,"deg) scale(").concat(g,")")}),controls:!1}),(Array.isArray(a)?a:[{src:a}]).map(function(e){return o.createElement("source",(0,r.__assign)({key:e.src},e))})),this.state.cropSize&&o.createElement("div",(0,r.__assign)({ref:this.cropperRef,style:(0,r.__assign)((0,r.__assign)({},C),{width:w?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:w?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:m("reactEasyCrop_CropArea","round"===f&&"reactEasyCrop_CropAreaRound",v&&"reactEasyCrop_CropAreaGrid",R)},c)))},t.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:3,minZoom:1,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:1},t.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},t}(o.Component);function f(e){return e*Math.PI/180}async function v(e,t,o=0,r={horizontal:!1,vertical:!1},i="image/jpeg"){var n,a;let s,c=await new Promise((t,o)=>{let r=new Image;r.addEventListener("load",()=>t(r)),r.addEventListener("error",e=>o(e)),e.startsWith("http")&&!e.includes(window.location.host)&&r.setAttribute("crossOrigin","anonymous"),r.src=e}),h=document.createElement("canvas"),p=h.getContext("2d");if(!p)return null;let l=f(o),{width:u,height:d}=(n=c.width,a=c.height,{width:Math.abs(Math.cos(s=f(o))*n)+Math.abs(Math.sin(s)*a),height:Math.abs(Math.sin(s)*n)+Math.abs(Math.cos(s)*a)});h.width=u,h.height=d,p.translate(u/2,d/2),p.rotate(l),p.scale(r.horizontal?-1:1,r.vertical?-1:1),p.translate(-c.width/2,-c.height/2),p.drawImage(c,0,0);let m=p.getImageData(t.x,t.y,t.width,t.height);return h.width=t.width,h.height=t.height,p.putImageData(m,0,0),new Promise((e,t)=>{h.toBlob(o=>{o?e(o):t(Error("Canvas is empty"))},i)})}var w=e.i(167881),x=e.i(37727),y=e.i(473708),C=e.i(531278);e.s(["default",0,function({onImageCropped:e,aspect:r=1,externalImageSrc:i,adjustableAspect:n=!1}){let[a,s]=(0,o.useState)(null),[c,h]=(0,o.useState)({x:0,y:0}),[p,l]=(0,o.useState)(1),[u,d]=(0,o.useState)(null),[m,f]=(0,o.useState)(r),[S,b]=(0,o.useState)(r),[z,R]=(0,o.useState)(""),[D,M]=(0,o.useState)(!1),P=o.default.useId(),[E,_]=(0,o.useState)(null),[j,A]=(0,o.useState)(!1),N=(0,o.useRef)(null),[L,W]=(0,o.useState)(!1);o.default.useEffect(()=>{i&&(i.includes("/uploads/")||i.includes("/api/assets/")?(W(!0),fetch(i).then(e=>{if(!e.ok)throw Error("Failed to fetch image");return e.blob()}).then(e=>{let t=new FileReader;t.onloadend=()=>{s(t.result),A(!0),W(!1)},t.readAsDataURL(e)}).catch(e=>{console.error("Failed to load image for cropping:",e),s(i),A(!0),W(!1)})):(s(i),A(!0)))},[i]);let T=(0,o.useCallback)((e,t)=>{d(t)},[]),F=e=>{f(e),l(1),h({x:0,y:0}),R("")};o.default.useEffect(()=>{a&&(h({x:0,y:0}),l(1),d(null),R(""))},[a]),o.default.useEffect(()=>()=>{E&&URL.revokeObjectURL(E)},[E]);let O=async e=>{if(e.target.files&&e.target.files.length>0){let t=e.target.files[0];s(await I(t)),A(!0)}},I=e=>new Promise(t=>{let o=new FileReader;o.addEventListener("load",()=>t(o.result)),o.readAsDataURL(e)}),k=(0,o.useCallback)(async()=>{try{if(!a||!u)return;M(!0),R("");let t=await v(a,u,0,void 0,n?"image/png":"image/jpeg");if(t){let o=URL.createObjectURL(t);_(o),e(t),A(!1),s(null)}}catch(e){console.error(e),R("Impossible de recadrer l’image. Réessayez.")}finally{M(!1)}},[a,u,e,n]);return(0,t.jsxs)("div",{className:"w-full",children:[!E&&!j&&(0,t.jsxs)("div",{onClick:()=>N.current?.click(),className:"border-2 border-dashed border-gray-300 rounded-lg p-6 flex flex-col items-center justify-center cursor-pointer hover:bg-gray-50 transition-colors h-48",children:[(0,t.jsx)(y.Image,{className:"w-10 h-10 text-gray-400 mb-2"}),(0,t.jsx)("span",{className:"text-sm text-gray-500 font-medium",children:"Cliquer pour ajouter une image"}),(0,t.jsx)("span",{className:"text-xs text-gray-400 mt-1",children:n?"Format libre : le logo entier est conservé au départ":"Format carré recommandé"})]}),E&&!j&&(0,t.jsxs)("div",{className:"relative w-32 h-32 rounded-lg overflow-hidden border border-gray-200",children:[(0,t.jsx)("img",{src:E,alt:"Aperçu du reca
1drage",className:"w-full h-full object-contain"}),(0,t.jsx)("button",{type:"button",onClick:()=>{_(null),N.current&&(N.current.value="")},className:"absolute top-1 right-1 bg-white/80 p-1 rounded-full hover:bg-white text-gray-700",children:(0,t.jsx)(x.X,{className:"w-4 h-4"})})]}),(0,t.jsx)("input",{type:"file",onChange:O,accept:"image/*",ref:N,className:"hidden"}),L&&(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",children:(0,t.jsxs)("div",{className:"bg-white rounded-lg shadow-xl p-8 flex flex-col items-center gap-4",children:[(0,t.jsx)(C.Loader2,{className:"w-10 h-10 text-blue-600 animate-spin"}),(0,t.jsx)("span",{className:"text-sm font-medium text-gray-600",children:"Chargement de l'image..."})]})}),j&&!L&&(0,t.jsx)("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/50 p-4",children:(0,t.jsxs)("div",{role:"dialog","aria-modal":"true","aria-labelledby":`${P}-title`,className:"bg-white rounded-lg shadow-xl w-full max-w-lg max-h-[90dvh] overflow-y-auto",children:[(0,t.jsx)("h2",{id:`${P}-title`,className:"px-4 py-3 font-semibold text-gray-900",children:n?"Cadrer le logo":"Recadrer l’image"}),(0,t.jsx)("div",{className:"relative h-[min(40dvh,320px)] w-full bg-gray-900",children:(0,t.jsx)(g,{image:a||"",crop:c,zoom:p,aspect:n?m:r,objectFit:"contain",onMediaLoaded:e=>{let t=e.naturalWidth/e.naturalHeight;b(t),n&&F(t)},onCropChange:h,onCropComplete:T,onZoomChange:l})}),(0,t.jsxs)("div",{className:"p-4 space-y-4",children:[n&&(0,t.jsxs)("div",{className:"space-y-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between gap-3",children:[(0,t.jsx)("label",{htmlFor:`${P}-height`,className:"text-sm font-medium text-gray-700",children:"Hauteur du cadre"}),(0,t.jsx)(w.Button,{type:"button",variant:"outline",size:"sm",onClick:()=>F(S),children:"Logo entier"})]}),(0,t.jsx)("input",{id:`${P}-height`,type:"range",min:Math.min(10,100/S),max:Math.max(200,100/S),step:"any",value:100/m,onChange:e=>F(100/Number(e.target.value)),"aria-valuetext":`${Math.round(100/m)} % de la largeur`,className:"w-full accent-primary"}),(0,t.jsx)("p",{className:"text-xs text-gray-500",children:"Augmentez la hauteur pour inclure le texte sous le logo. « Logo entier » rétablit les proportions originales et annule le zoom."})]}),(0,t.jsxs)("div",{className:"space-y-1",children:[(0,t.jsx)("label",{id:`${P}-zoom`,className:"text-xs font-medium text-gray-500",children:"Zoom"}),(0,t.jsx)("input",{type:"range",value:p,min:1,max:3,step:.1,"aria-labelledby":`${P}-zoom`,onChange:e=>l(Number(e.target.value)),className:"w-full h-2 bg-gray-200 rounded-lg appearance-none cursor-pointer"})]}),z&&(0,t.jsx)("p",{role:"alert",className:"text-sm text-red-600",children:z}),(0,t.jsxs)("div",{className:"flex justify-end gap-2",children:[(0,t.jsx)(w.Button,{type:"button",variant:"outline",onClick:()=>{A(!1),s(null),N.current&&(N.current.value="")},children:"Annuler"}),(0,t.jsx)(w.Button,{type:"button",onClick:k,disabled:!u||D,children:"Valider"})]})]})]})})]})}],976351)}]);

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.