1import{c as le,ax as pe,r as S,j as o,X as he,x as ue,W as me,n as G,U as $,V as fe,ay as q}from"./index-Cshou3OC.js";import{D as B,C as X,P as V,G as Y}from"./dnd.esm-CHhD8z-g.js";import{_ as ge,a as N}from"./tslib.es6-CwyXKlH1.js";import{S as ve}from"./square-DhbdM5z9.js";import{S as xe}from"./smartphone-Bl8X91m5.js";import{U as K}from"./upload-DFKeQM0m.js";import{T as J}from"./trash-2-BJAUkNYh.js";import{M as be}from"./monitor-DYDk3VsN.js";/** 2 * @license lucide-react v0.475.0 - ISC 3 * 4 * This source code is licensed under the ISC license. 5 * See the LICENSE file in the root directory of this source tree. 6 */const we=[["path",{d:"M6 2v14a2 2 0 0 0 2 2h14",key:"ron5a4"}],["path",{d:"M18 22V8a2 2 0 0 0-2-2H2",key:"7s9ehn"}]],Z=le("Crop",we);var W,Q;function Ce(){if(Q)return W;Q=1;var d=!1,s,e,t,r,i,n,c,l,p,m,x,v,C,y,j;function b(){if(!d){d=!0;var g=navigator.userAgent,h=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel).(\d+\.\d+))|(?:Opera(?:.+Version.|.)(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))|(?:Trident\/\d+\.\d+.*rv:(\d+\.\d+))/.exec(g),u=/(Mac OS X)|(Windows)|(Linux)/.exec(g);if(v=/\b(iPhone|iP[ao]d)/.exec(g),C=/\b(iP[ao]d)/.exec(g),m=/Android/i.exec(g),y=/FBAN\/\w+;/i.exec(g),j=/Mobile/i.exec(g),x=!!/Win64/.exec(g),h){s=h[1]?parseFloat(h[1]):h[5]?parseFloat(h[5]):NaN,s&&document&&document.documentMode&&(s=document.documentMode);var f=/(?:Trident\/(\d+.\d+))/.exec(g);n=f?parseFloat(f[1])+4:s,e=h[2]?parseFloat(h[2]):NaN,t=h[3]?parseFloat(h[3]):NaN,r=h[4]?parseFloat(h[4]):NaN,r?(h=/(?:Chrome\/(\d+\.\d+))/.exec(g),i=h&&h[1]?parseFloat(h[1]):NaN):i=NaN}else s=e=t=i=r=NaN;if(u){if(u[1]){var w=/(?:Mac OS X (\d+(?:[._]\d+)?))/.exec(g);c=w?parseFloat(w[1].replace("_",".")):!0}else c=!1;l=!!u[2],p=!!u[3]}else c=l=p=!1}}var a={ie:function(){return b()||s},ieCompatibilityMode:function(){return b()||n>s},ie64:function(){return a.ie()&&x},firefox:function(){return b()||e},opera:function(){return b()||t},webkit:function(){return b()||r},safari:function(){return a.webkit()},chrome:function(){return b()||i},windows:function(){return b()||l},osx:function(){return b()||c},linux:function(){return b()||p},iphone:function(){return b()||v},mobile:function(){return b()||v||C||m||j},nativeApp:function(){return b()||y},android:function(){return b()||m},ipad:function(){return b()||C}};return W=a,W}var F,ee;function ye(){if(ee)return F;ee=1;var d=!!(typeof window<"u"&&window.document&&window.document.createElement),s={canUseDOM:d,canUseWorkers:typeof Worker<"u",canUseEventListeners:d&&!!(window.addEventListener||window.attachEvent),canUseViewport:d&&!!window.screen,isInWorker:!d};return F=s,F}var U,te;function Se(){if(te)return U;te=1;var d=ye(),s;d.canUseDOM&&(s=document.implementation&&document.implementation.hasFeature&&document.implementation.hasFeature("","")!==!0);/** 7 * Checks if an event is supported in the current execution environment. 8 * 9 * NOTE: This will not work correctly for non-generic events such as `change`, 10 * `reset`, `load`, `error`, and `select`. 11 * 12 * Borrows from Modernizr. 13 * 14 * @param {string} eventNameSuffix Event name, e.g. "click". 15 * @param {?boolean} capture Check if the capture phase is supported. 16 * @return {boolean} True if the event is supported. 17 * @internal 18 * @license Modernizr 3.0.0pre (Custom Build) | MIT 19 */function e(t,r){if(!d.canUseDOM||r&&!("addEventListener"in document))return!1;var i="on"+t,n=i in document;if(!n){var c=document.createElement("div");c.setAttribute(i,"return;"),n=typeof c[i]=="function"}return!n&&s&&t==="wheel"&&(n=document.implementation.hasFeature("Events.wheel","3.0")),n}return U=e,U}var L,oe;function je(){if(oe)return L;oe=1;var d=Ce(),s=Se(),e=10,t=40,r=800;function i(n){var c=0,l=0,p=0,m=0;return"detail"in n&&(l=n.detail),"wheelDelta"in n&&(l=-n.wheelDelta/120),"wheelDeltaY"in n&&(l=-n.wheelDeltaY/120),"wheelDeltaX"in n&&(c=-n.wheelDeltaX/120),"axis"in n&&n.axis===n.HORIZONTAL_AXIS&&(c=l,l=0),p=c*e,m=l*e,"deltaY"in n&&(m=n.deltaY),"deltaX"in n&&(p=n.deltaX),(p||m)&&n.deltaMode&&(n.deltaMode==1?(p*=t,m*=t):(p*=r,m*=r)),p&&!c&&(c=p<1?-1:1),m&&!l&&(l=m<1?-1:1),{spinX:c,spinY:l,pixelX:p,pixelY:m}}return i.getEventType=function(){return d.firefox()?"DOMMouseScroll":s("wheel")?"wheel":"mousewheel"},L=i,L}var O,re;function Ne(){return re||(re=1,O=je()),O}var De=Ne();const Pe=pe(De);function Ee(d,s,e,t,r,i){i===void 0&&(i=0);var n=M(d,s,i),c=n.width,l=n.height,p=Math.min(c,e),m=Math.min(l,t);return p>m*r?{width:m*r,height:m}:{width:p,height:p/r}}function Re(d){return d.width>
19d.height?d.width/d.naturalWidth:d.height/d.naturalHeight}function A(d,s,e,t,r){r===void 0&&(r=0);var i=M(s.width,s.height,r),n=i.width,c=i.height;return{x:ne(d.x,n,e.width,t),y:ne(d.y,c,e.height,t)}}function ne(d,s,e,t){var r=Math.abs(s*t/2-e/2);return T(d,-r,r)}function ie(d,s){return Math.sqrt(Math.pow(d.y-s.y,2)+Math.pow(d.x-s.x,2))}function ae(d,s){return Math.atan2(s.y-d.y,s.x-d.x)*180/Math.PI}function ze(d,s,e,t,r,i,n){i===void 0&&(i=0),n===void 0&&(n=!0);var c=n?_e:Me,l=M(s.width,s.height,i),p=M(s.naturalWidth,s.naturalHeight,i),m={x:c(100,((l.width-e.width/r)/2-d.x/r)/l.width*100),y:c(100,((l.height-e.height/r)/2-d.y/r)/l.height*100),width:c(100,e.width/l.width*100/r),height:c(100,e.height/l.height*100/r)},x=Math.round(c(p.width,m.width*p.width/100)),v=Math.round(c(p.height,m.height*p.height/100)),C=p.width>=p.height*t,y=C?{width:Math.round(v*t),height:v}:{width:x,height:Math.round(x/t)},j=N(N({},y),{x:Math.round(c(p.width-y.width,m.x*p.width/100)),y:Math.round(c(p.height-y.height,m.y*p.height/100))});return{croppedAreaPercentages:m,croppedAreaPixels:j}}function _e(d,s){return Math.min(d,Math.max(0,s))}function Me(d,s){return s}function Ae(d,s,e,t,r,i){var n=M(s.width,s.height,e),c=T(t.width/n.width*(100/d.width),r,i),l={x:c*n.width/2-t.width/2-n.width*c*(d.x/100),y:c*n.height/2-t.height/2-n.height*c*(d.y/100)};return{crop:l,zoom:c}}function ke(d,s,e){var t=Re(s);return e.height>e.width?e.height/(d.height*t):e.width/(d.width*t)}function Ie(d,s,e,t,r,i){e===void 0&&(e=0);var n=M(s.naturalWidth,s.naturalHeight,e),c=T(ke(d,s,t),r,i),l=t.height>t.width?t.height/d.height:t.width/d.width,p={x:((n.width-d.width)/2-d.x)*l,y:((n.height-d.height)/2-d.y)*l};return{crop:p,zoom:c}}function se(d,s){return{x:(s.x+d.x)/2,y:(s.y+d.y)/2}}function Te(d){return d*Math.PI/180}function M(d,s,e){var t=Te(e);return{width:Math.abs(Math.cos(t)*d)+Math.abs(Math.sin(t)*s),height:Math.abs(Math.sin(t)*d)+Math.abs(Math.cos(t)*s)}}function T(d,s,e){return Math.min(Math.max(d,s),e)}function I(){for(var d=[],s=0;s<arguments.length;s++)d[s]=arguments[s];return d.filter(function(e){return typeof e=="string"&&e.length>0}).join(" ").trim()}var We=`.reactEasyCrop_Container { 20 position: absolute; 21 top: 0; 22 left: 0; 23 right: 0; 24 bottom: 0; 25 overflow: hidden; 26 user-select: none; 27 touch-action: none; 28 cursor: move; 29 display: flex; 30 justify-content: center; 31 align-items: center; 32} 33 34.reactEasyCrop_Image, 35.reactEasyCrop_Video { 36 will-change: transform; /* this improves performances and prevent painting issues on iOS Chrome */ 37} 38 39.reactEasyCrop_Contain { 40 max-width: 100%; 41 max-height: 100%; 42 margin: auto; 43 position: absolute; 44 top: 0; 45 bottom: 0; 46 left: 0; 47 right: 0; 48} 49.reactEasyCrop_Cover_Horizontal { 50 width: 100%; 51 height: auto; 52} 53.reactEasyCrop_Cover_Vertical { 54 width: auto; 55 height: 100%; 56} 57 58.reactEasyCrop_CropArea { 59 position: absolute; 60 left: 50%; 61 top: 50%; 62 transform: translate(-50%, -50%); 63 border: 1px solid rgba(255, 255, 255, 0.5); 64 box-sizing: border-box; 65 box-shadow: 0 0 0 9999em; 66 color: rgba(0, 0, 0, 0.5); 67 overflow: hidden; 68} 69 70.reactEasyCrop_CropAreaRound { 71 border-radius: 50%; 72} 73 74.reactEasyCrop_CropAreaGrid::before { 75 content: ' '; 76 box-sizing: border-box; 77 position: absolute; 78 border: 1px solid rgba(255, 255, 255, 0.5); 79 top: 0; 80 bottom: 0; 81 left: 33.33%; 82 right: 33.33%; 83 border-top: 0; 84 border-bottom: 0; 85} 86 87.reactEasyCrop_CropAreaGrid::after { 88 content: ' '; 89 box-sizing: border-box; 90 position: absolute; 91 border: 1px solid rgba(255, 255, 255, 0.5); 92 top: 33.33%; 93 bottom: 33.33%; 94 left: 0; 95 right: 0; 96 border-left: 0; 97 border-right: 0; 98} 99`,Fe=1,Ue=3,Le=1,Oe=(function(d){ge(s,d);function s(){var e=d!==null&&d.apply(this,arguments)||this;return e.cropperRef=S.createRef(),e.imageRef=S.createRef(),e.videoRef=S.createRef(),e.containerPosition={x:0,y:0},e.containerRef=null,e.styleRef=null,e.containerRect=null,e.mediaSize={width:0,height:0,naturalWidth:0,naturalHeight:0},e.dragStartPosition={x:0,y:0},e.dragStartCrop={x:0,y:0},e.gestureZoomStart=0,e.gestureRotationStart=0,e.isTouching=!1,e.lastPinchDistance=0,e.lastPinchRotation=0,e.rafDragTimeout=null,e.rafPinchTimeout=null,e.wheelTimer=null,e.currentDoc=typeof document<"u"?document:null,e.currentWindow=typeof window<"u"?window:null,e.resizeObserver=null,e.previousCropSize=null,e.isInitialized=!1,e.state={cropSize:null,hasWheelJustStarted:!1,mediaObjectFit:void 0},e.initResizeObserver=function(){if(!(typeof window.ResizeObserver>"u"||!e.containerRef)){var t=!0;e.resizeObserver=new window.ResizeObserver(function(r){if(t){t=!1;return}e.computeSizes()}),e.resizeObserver.observe(e.containerRef)}},e.preventZoomSafari=function(t){return t.preventDefault()},e.cleanEvents=function(){e.currentDoc&&(e.currentDoc.removeEventListener("mousemove",e.onMouseMove),e.currentDoc.removeEventListener("mouseup",e.onDragStopped),e.currentDoc.removeEventListener("touchmove",e.onTouchMove),e.currentDoc.removeEventListener("touchend",e.onDragStopped),e.currentDoc.removeEventListener("gesturechange",e.onGestureChange),e.currentDoc.removeEventListener("gestureend",e.onGestureEnd),e.currentDoc.removeEventListener("scroll",e.onScroll))},e.clearScrollEvent=function(){e.containerRef&&e.containerRef.removeEventListener("wheel",e.onWheel),e.wheelTimer&&clearTimeout(e.wheelTimer)},e.onMediaLoad=function(){var t=e.computeSizes();t&&(e.previousCropSize=t,e.emitCropData(),e.setInitialCrop(t),e.isInitialized=!0),e.props.onMediaLoaded&&e.props.onMediaLoaded(e.mediaSize)},e.setInitialCrop=function(t){if(e.props.initialCroppedAreaPercentages){var r=Ae(e.props.initialCroppedAreaPercentages,e.mediaSize,e.props.rotation,t,e.props.minZoom,e.props.maxZoom),i=r.crop,n=r.zoom;e.props.onCropChange(i),e.props.onZoomChange&&e.props.onZoomChange(n)}else if(e.props.initialCroppedAreaPixels){var c=Ie(e.props.initialCroppedAreaPixels,e.mediaSize,e.props.rotation,t,e.props.minZoom,e.props.maxZoom),i=c.crop,n=c.zoom;e.props.onCropChange(i),e.props.onZoomChange&&e.props.onZoomChange(n)}},e.computeSizes=function(){var t,r,i,n,c,l,p=e.imageRef.current||e.videoRef.current;if(p&&e.containerRef){e.containerRect=e.containerRef.getBoundingClientRect(),e.saveContainerPosition();var m=e.containerRect.width/e.containerRect.height,x=((t=e.imageRef.current)===null||t===void 0?void 0:t.naturalWi
99dth)||((r=e.videoRef.current)===null||r===void 0?void 0:r.videoWidth)||0,v=((i=e.imageRef.current)===null||i===void 0?void 0:i.naturalHeight)||((n=e.videoRef.current)===null||n===void 0?void 0:n.videoHeight)||0,C=p.offsetWidth<x||p.offsetHeight<v,y=x/v,j=void 0;if(C)switch(e.state.mediaObjectFit){default:case"contain":j=m>y?{width:e.containerRect.height*y,height:e.containerRect.height}:{width:e.containerRect.width,height:e.containerRect.width/y};break;case"horizontal-cover":j={width:e.containerRect.width,height:e.containerRect.width/y};break;case"vertical-cover":j={width:e.containerRect.height*y,height:e.containerRect.height};break}else j={width:p.offsetWidth,height:p.offsetHeight};e.mediaSize=N(N({},j),{naturalWidth:x,naturalHeight:v}),e.props.setMediaSize&&e.props.setMediaSize(e.mediaSize);var b=e.props.cropSize?e.props.cropSize:Ee(e.mediaSize.width,e.mediaSize.height,e.containerRect.width,e.containerRect.height,e.props.aspect,e.props.rotation);return(((c=e.state.cropSize)===null||c===void 0?void 0:c.height)!==b.height||((l=e.state.cropSize)===null||l===void 0?void 0:l.width)!==b.width)&&e.props.onCropSizeChange&&e.props.onCropSizeChange(b),e.setState({cropSize:b},e.recomputeCropPosition),e.props.setCropSize&&e.props.setCropSize(b),b}},e.saveContainerPosition=function(){if(e.containerRef){var t=e.containerRef.getBoundingClientRect();e.containerPosition={x:t.left,y:t.top}}},e.onMouseDown=function(t){e.currentDoc&&(t.preventDefault(),e.currentDoc.addEventListener("mousemove",e.onMouseMove),e.currentDoc.addEventListener("mouseup",e.onDragStopped),e.saveContainerPosition(),e.onDragStart(s.getMousePoint(t)))},e.onMouseMove=function(t){return e.onDrag(s.getMousePoint(t))},e.onScroll=function(t){e.currentDoc&&(t.preventDefault(),e.saveContainerPosition())},e.onTouchStart=function(t){e.currentDoc&&(e.isTouching=!0,!(e.props.onTouchRequest&&!e.props.onTouchRequest(t))&&(e.currentDoc.addEventListener("touchmove",e.onTouchMove,{passive:!1}),e.currentDoc.addEventListener("touchend",e.onDragStopped),e.saveContainerPosition(),t.touches.length===2?e.onPinchStart(t):t.touches.length===1&&e.onDragStart(s.getTouchPoint(t.touches[0]))))},e.onTouchMove=function(t){t.preventDefault(),t.touches.length===2?e.onPinchMove(t):t.touches.length===1&&e.onDrag(s.getTouchPoint(t.touches[0]))},e.onGestureStart=function(t){e.currentDoc&&(t.preventDefault(),e.currentDoc.addEventListener("gesturechange",e.onGestureChange),e.currentDoc.addEventListener("gestureend",e.onGestureEnd),e.gestureZoomStart=e.props.zoom,e.gestureRotationStart=e.props.rotation)},e.onGestureChange=function(t){if(t.preventDefault(),!e.isTouching){var r=s.getMousePoint(t),i=e.gestureZoomStart-1+t.scale;if(e.setNewZoom(i,r,{shouldUpdatePosition:!0}),e.props.onRotationChange){var n=e.gestureRotationStart+t.rotation;e.props.onRotationChange(n)}}},e.onGestureEnd=function(t){e.cleanEvents()},e.onDragStart=function(t){var r,i,n=t.x,c=t.y;e.dragStartPosition={x:n,y:c},e.dragStartCrop=N({},e.props.crop),(i=(r=e.props).onInteractionStart)===null||i===void 0||i.call(r)},e.onDrag=function(t){var r=t.x,i=t.y;e.currentWindow&&(e.rafDragTimeout&&e.currentWindow.cancelAnimationFrame(e.rafDragTimeout),e.rafDragTimeout=e.currentWindow.requestAnimationFrame(function(){if(e.state.cropSize&&!(r===void 0||i===void 0)){var n=r-e.dragStartPosition.x,c=i-e.dragStartPosition.y,l={x:e.dragStartCrop.x+n,y:e.dragStartCrop.y+c},p=e.props.restrictPosition?A(l,e.mediaSize,e.state.cropSize,e.props.zoom,e.props.rotation):l;e.props.onCropChange(p)}}))},e.onDragStopped=function(){var t,r;e.isTouching=!1,e.cleanEvents(),e.emitCropData(),(r=(t=e.props).onInteractionEnd)===null||r===void 0||r.call(t)},e.onWheel=function(t){if(e.currentWindow&&!(e.props.onWheelRequest&&!e.props.onWheelRequest(t))){t.preventDefault();var r=s.getMousePoint(t),i=Pe(t).pixelY,n=e.props.zoom-i*e.props.zoomSpeed/200;e.setNewZoom(n,r,{shouldUpdatePosition:!0}),e.state.hasWheelJustStarted||e.setState({hasWheelJustStarted:!0},function(){var c,l;return(l=(c=e.props).onInteractionStart)===null||l===void 0?void 0:l.call(c)}),e.wheelTimer&&clearTimeout(e.wheelTimer),e.wheelTimer=e.currentWindow.setTimeout(function(){return e.setState({hasWheelJustStarted:!1},function(){var c,l;return(l=(c=e.props).onInteractionEnd)===null||l===void 0?void 0:l.call(c)})},250)}},e.getPointOnContainer=function(t,r){var i=t.x,n=t.y;if(!e.containerRect)throw new Error("The Cropper is not mounted");return{x:e.containerRect.width/2-(i-r.x),y:e.containerRect.height/2-(n-r.y)}},e.getPointOnMedia=function(t){var r=t.x,i=t.y,n=e.props,c=n.crop,l=n.zoom;return{x:(r+c.x)/l,y:(i+c.y)/l}},e.setNewZoom=function(t,r,i){var n=i===void 0?{}:i,c=n.shouldUpdatePosition,l=c===void 0?!0:c;if(!(!e.state.cropSize||!e.props.onZoomChange)){var p=T(t,e.props.minZoom,e.props.maxZoom);if(l){var m=e.getPointOnContainer(r,e.containerPosition),x=e.getPointOnMedia(m),v={x:x.x*p-m.x,y:x.y*p-m.y},C=e.props.restrictPosition?A(v,e.mediaSize,e.state.cropSize,p,e.props.rotation):v;e.props.onCropChange(C)}e.props.onZoomChange(p)}},e.getCropData=function(){if(!e.state.cropSize)return null;var t=e.props.restrictPosition?A(e.props.crop,e.mediaSize,e.state.cropSize,e.props.zoom,e.props.rotation):e.props.crop;return ze(t,e.mediaSize,e.state.cropSize,e.getAspect(),e.props.zoom,e.props.rotation,e.props.restrictPosition)},e.emitCropData=function(){var t=e.getCropData();if(t){var r=t.croppedAreaPercentages,i=t.croppedAreaPixels;e.props.onCropComplete&&e.props.onCropComplete(r,i),e.props.onCropAreaChange&&e.props.onCropAreaChange(r,i)}},e.emitCropAreaChange=function(){var t=e.getCropData();if(t){var r=t.croppedAreaPercentages,i=t.croppedAreaPixels;e.props.onCropAreaChange&&e.props.onCropAreaChange(r,i)}},e.recomputeCropPosition=function(){var t,r;if(e.state.cropSize){var i=e.props.crop;if(e.isInitialized&&(!((t=e.previousCropSize)===null||t===void 0)&&t.width)&&(!((r=e.previousCropSize)===null||r===void 0)&&r.height)){var n=Math.abs(e.previousCropSize.width-e.state.cropSize.width)>1e-6||Math.abs(e.previousCropSize.height-e.state.cropSize.height)>1e-6;if(n){var c=e.state.cropSize.width/e.previousCropSize.width,l=e.state.cropSize.height/e.previousCropSize.height;i={x:e.props.crop.x*c,y:e.props.crop.y*l}}}var p=e.props.restrictPosition?A(i,e.mediaSize,e.state.cropSize,e.props.zoom,e.props.rotation):i;e.previousCropSize=e.state.cropSize,e.props.onCropChange(p),e.emitCropData()}},e.onKeyDown=function(t){var r,i,n=e.props,c=n.crop,l=n.onCropChange,p=n.keyboardStep,m=n.zoom,x=n.rotation,v=p;if(e.state.cropSize){t.shiftKey&&(v*=.2);var C=N({},c);switch(t.key){case"ArrowUp":C.y-=v,t.preventDefault();break;case"ArrowDown":C.y+=v,t.preventDefault();break;case"ArrowLeft":C.x-=v,t.preventDefault();break;case"ArrowRight":C.x+=v,t.preventDefault();break;default:return}e.props.restrictPosition&&(C=A(C,e.mediaSize,e.state.cropSize,m,x)),t.repeat||(i=(r=e.props).onInteractionStart)===null||i===void 0||i.call(r),l(C)}},e.onKeyUp=function(t){var r,i;switch(t.key){case"ArrowUp":case"ArrowDown":case"ArrowLeft":case"ArrowRight":t.preventDefault();break;default:return}e.emitCropData(),(i=(r=e.props).onInteractionEnd)===null||i===void 0||i.call(r)},e}return s.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(),typeof window.ResizeObserver>"u"&&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=We,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))},s.prototype.componentWillUnmount=function(){var e,t;!this.currentDoc||!this.currentWindow||(typeof window.ResizeObserver>"u"&&this.currentWindow.removeEventListener("resize",this.computeSizes),(e=this.resizeObserver)===null||e===void 0||e.disconnect(),this.containerRef&&this.containerRef.removeEventListener("gesturestart",this.preventZoomSafari),this.styleRef&&((t=this.styleRef.parentNode)===null||t===void 0||t.removeChild(this.styleRef)),this.cleanEvents(),this.props.zoomWithScroll&&this.clearScrollEvent())},s.prototype.componentDidUpdate=function(e){var t,r,i,n,c,l,p,m,x;e.rotation!==this.props.rotation?(this.computeSizes(),this.recomputeCropPosition()):e.aspect!==this.props.aspect?this.computeSizes():e.objectFit!==this.props.objectFit?this.computeSizes():e.zoom!==this.props.zoom?this.recomputeCropPosition():((t=e.cropSize)===null||t===void 0?void 0:t.height)!==((r=this.props.cropSize)===null||r===void 0?void 0:r.height)||((i=e.cropSize)===null||i===void 0?void 0:i.width)!==((n=this.props.cropSize)===null||n===void 0?void 0:n.width)?this.computeSizes():(((c=e.crop)===null||c===void 0?void 0:c.x)!==((l=this.props.crop)===null||l===void 0?void 0:l.x)||((
99p=e.crop)===null||p===void 0?void 0:p.y)!==((m=this.props.crop)===null||m===void 0?void 0:m.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&&((x=this.videoRef.current)===null||x===void 0||x.load());var v=this.getObjectFit();v!==this.state.mediaObjectFit&&this.setState({mediaObjectFit:v},this.computeSizes)},s.prototype.getAspect=function(){var e=this.props,t=e.cropSize,r=e.aspect;return t?t.width/t.height:r},s.prototype.getObjectFit=function(){var e,t,r,i;if(this.props.objectFit==="cover"){var n=this.imageRef.current||this.videoRef.current;if(n&&this.containerRef){this.containerRect=this.containerRef.getBoundingClientRect();var c=this.containerRect.width/this.containerRect.height,l=((e=this.imageRef.current)===null||e===void 0?void 0:e.naturalWidth)||((t=this.videoRef.current)===null||t===void 0?void 0:t.videoWidth)||0,p=((r=this.imageRef.current)===null||r===void 0?void 0:r.naturalHeight)||((i=this.videoRef.current)===null||i===void 0?void 0:i.videoHeight)||0,m=l/p;return m<c?"horizontal-cover":"vertical-cover"}return"horizontal-cover"}return this.props.objectFit},s.prototype.onPinchStart=function(e){var t=s.getTouchPoint(e.touches[0]),r=s.getTouchPoint(e.touches[1]);this.lastPinchDistance=ie(t,r),this.lastPinchRotation=ae(t,r),this.onDragStart(se(t,r))},s.prototype.onPinchMove=function(e){var t=this;if(!(!this.currentDoc||!this.currentWindow)){var r=s.getTouchPoint(e.touches[0]),i=s.getTouchPoint(e.touches[1]),n=se(r,i);this.onDrag(n),this.rafPinchTimeout&&this.currentWindow.cancelAnimationFrame(this.rafPinchTimeout),this.rafPinchTimeout=this.currentWindow.requestAnimationFrame(function(){var c=ie(r,i),l=t.props.zoom*(c/t.lastPinchDistance);t.setNewZoom(l,n,{shouldUpdatePosition:!1}),t.lastPinchDistance=c;var p=ae(r,i),m=t.props.rotation+(p-t.lastPinchRotation);t.props.onRotationChange&&t.props.onRotationChange(m),t.lastPinchRotation=p})}},s.prototype.render=function(){var e=this,t,r=this.props,i=r.image,n=r.video,c=r.mediaProps,l=r.cropperProps,p=r.transform,m=r.crop,x=m.x,v=m.y,C=r.rotation,y=r.zoom,j=r.cropShape,b=r.showGrid,a=r.roundCropAreaPixels,g=r.style,h=g.containerStyle,u=g.cropAreaStyle,f=g.mediaStyle,w=r.classes,z=w.containerClassName,E=w.cropAreaClassName,P=w.mediaClassName,D=(t=this.state.mediaObjectFit)!==null&&t!==void 0?t:this.getObjectFit();return S.createElement("div",{onMouseDown:this.onMouseDown,onTouchStart:this.onTouchStart,ref:function(k){return e.containerRef=k},"data-testid":"container",style:h,className:I("reactEasyCrop_Container",z)},i?S.createElement("img",N({alt:"",className:I("reactEasyCrop_Image",D==="contain"&&"reactEasyCrop_Contain",D==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",D==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",P)},c,{src:i,ref:this.imageRef,style:N(N({},f),{transform:p||"translate(".concat(x,"px, ").concat(v,"px) rotate(").concat(C,"deg) scale(").concat(y,")")}),onLoad:this.onMediaLoad})):n&&S.createElement("video",N({autoPlay:!0,playsInline:!0,loop:!0,muted:!0,className:I("reactEasyCrop_Video",D==="contain"&&"reactEasyCrop_Contain",D==="horizontal-cover"&&"reactEasyCrop_Cover_Horizontal",D==="vertical-cover"&&"reactEasyCrop_Cover_Vertical",P)},c,{ref:this.videoRef,onLoadedMetadata:this.onMediaLoad,style:N(N({},f),{transform:p||"translate(".concat(x,"px, ").concat(v,"px) rotate(").concat(C,"deg) scale(").concat(y,")")}),controls:!1}),(Array.isArray(n)?n:[{src:n}]).map(function(_){return S.createElement("source",N({key:_.src},_))})),this.state.cropSize&&S.createElement("div",N({ref:this.cropperRef,style:N(N({},u),{width:a?Math.round(this.state.cropSize.width):this.state.cropSize.width,height:a?Math.round(this.state.cropSize.height):this.state.cropSize.height}),tabIndex:0,onKeyDown:this.onKeyDown,onKeyUp:this.onKeyUp,"data-testid":"cropper",className:I("reactEasyCrop_CropArea",j==="round"&&"reactEasyCrop_CropAreaRound",b&&"reactEasyCrop_CropAreaGrid",E)},l)))},s.defaultProps={zoom:1,rotation:0,aspect:4/3,maxZoom:Ue,minZoom:Fe,cropShape:"rect",objectFit:"contain",showGrid:!0,style:{},classes:{},mediaProps:{},cropperProps:{},zoomSpeed:1,restrictPosition:!0,zoomWithScroll:!0,keyboardStep:Le},s.getMousePoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},s.getTouchPoint=function(e){return{x:Number(e.clientX),y:Number(e.clientY)}},s})(S.Component);function Ze({image:d,onCrop:s,onCancel:e,positionMode:t="center",initialCrop:r,initialZoom:i,initialAspect:n}){const[c,l]=S.useState(r||{x:0,y:0}),[p,m]=S.useState(i||1),[x,v]=S.useState(n!==void 0?n:t==="portrait"?9/16:t==="landscape"?16/9
99:1),[C,y]=S.useState(null),j=S.useCallback((a,g)=>{y(g)},[]),b=async()=>{if(C)try{const a=document.createElement("canvas"),g=a.getContext("2d"),h=new Image;h.src=d,await new Promise(P=>{h.onload=P});const{width:u,height:f,x:w,y:z}=C;a.width=u,a.height=f,g.drawImage(h,w,z,u,f,0,0,u,f);const E=a.toDataURL("image/jpeg",.8);s(E,{crop:c,zoom:p,aspect:x})}catch(a){console.error("Crop failed:",a),alert("Failed to crop image")}};return o.jsx("div",{className:"fixed inset-0 z-[200] bg-black/80 backdrop-blur-sm flex items-start sm:items-center justify-center p-4 overflow-y-auto",style:{width:"100vw",height:"100vh",top:0,left:0},onClick:a=>{a.preventDefault(),a.stopPropagation(),a.nativeEvent.stopImmediatePropagation()},onTouchEnd:a=>{a.preventDefault(),a.stopPropagation(),a.nativeEvent.stopImmediatePropagation()},onMouseDown:a=>{a.preventDefault(),a.stopPropagation(),a.nativeEvent.stopImmediatePropagation()},children:o.jsxs("div",{className:"bg-card rounded-2xl p-4 w-full max-w-lg my-auto",onClick:a=>{a.stopPropagation()},onTouchEnd:a=>{a.stopPropagation()},onMouseDown:a=>{a.stopPropagation()},children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsxs("h3",{className:"font-serif text-lg font-semibold text-foreground flex items-center gap-2",children:[o.jsx(Z,{className:"w-5 h-5"}),"Crop Image"]}),o.jsx("button",{onClick:a=>{a.preventDefault(),a.stopPropagation(),a.nativeEvent.stopImmediatePropagation(),e()},onMouseDown:a=>{a.preventDefault(),a.stopPropagation(),a.nativeEvent.stopImmediatePropagation()},onTouchStart:a=>{a.preventDefault(),a.stopPropagation(),a.nativeEvent.stopImmediatePropagation()},onTouchEnd:a=>{a.preventDefault(),a.stopPropagation(),a.nativeEvent.stopImmediatePropagation(),e()},className:"p-1.5 rounded-lg hover:bg-secondary transition-colors",children:o.jsx(he,{className:"w-5 h-5"})})]}),o.jsx("div",{className:"flex gap-2 mb-4",children:[{label:"1:1",value:1,icon:ve},{label:"4:3",value:4/3},{label:"16:9",value:16/9},{label:"Free",value:void 0}].map(a=>o.jsxs("button",{onClick:g=>{g.preventDefault(),g.stopPropagation(),g.nativeEvent.stopImmediatePropagation(),v(a.value)},onMouseDown:g=>{g.preventDefault(),g.stopPropagation(),g.nativeEvent.stopImmediatePropagation()},onTouchStart:g=>{g.preventDefault(),g.stopPropagation(),g.nativeEvent.stopImmediatePropagation()},onTouchEnd:g=>{g.preventDefault(),g.stopPropagation(),g.nativeEvent.stopImmediatePropagation(),v(a.value)},className:`flex items-center gap-1.5 px-3 py-1.5 rounded-lg font-sans text-xs font-medium transition-colors ${x===a.value?"bg-primary text-primary-foreground":"bg-secondary text-secondary-foreground hover:bg-accent/20"}`,children:[a.icon&&o.jsx(a.icon,{className:"w-3.5 h-3.5"}),a.label]},a.label))}),o.jsx("div",{className:"relative mb-4 rounded-xl overflow-hidden bg-secondary h-[40vh] max-h-[300px] min-h-[200px]",children:o.jsx(Oe,{image:d,crop:c,zoom:p,aspect:x,onCropChange:l,onZoomChange:m,onCropComplete:j,cropShape:"rect",showGrid:!0,cropSize:void 0})}),o.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[o.jsx("span",{className:"font-sans text-xs text-muted-foreground shrink-0",children:"Zoom"}),o.jsx("input",{type:"range",min:"1",max:"3",step:"0.1",value:p,onChange:a=>m(parseFloat(a.target.value)),className:"flex-1 h-2 bg-secondary rounded-lg appearance-none cursor-pointer accent-primary"}),o.jsxs("span",{className:"font-sans text-xs text-muted-foreground w-10 text-right",children:[Math.round(p*100),"%"]})]}),o.jsxs("div",{className:"flex gap-2",children:[o.jsx("button",{onClick:a=>{a.preventDefault(),a.stopPropagation(),a.nativeEvent.stopImmediatePropagation(),e()},onMouseDown:a=>{a.preventDefault(),a.stopPropagation(),a.nativeEvent.stopImmediatePropagation()},onTouchStart:a=>{a.preventDefault(),a.stopPropagation(),a.nativeEvent.stopImmediatePropagation()},onTouchEnd:a=>{a.preventDefault(),a.stopPropagation(),a.nativeEvent.stopImmediatePropagation(),e()},className:"flex-1 px-4 py-2.5 rounded-xl bg-secondary text-secondary-foreground font-sans text-sm font-medium hover:opacity-90 transition-opacity",children:"Cancel"}),o.jsxs("button",{onClick:a=>{a.preventDefault(),a.stopPropagation(),a.nativeEvent.stopImmediatePropagation(),b()},onMouseDown:a=>{a.preventDefault(),a.stopPropagation(),a.nativeEvent.stopImmediatePropagation()},onTouchStart:a=>{a.preventDefault(),a.stopPropagation(),a.nativeEvent.stopImmediatePropagation()},onTouchEnd:a=>{a.preventDefault(),a.stopPropagation(),a.nativeEvent.stopImmediatePropagation(),b()},className:"flex-1 px-4 py-2.5 rounded-xl bg-primary text-primary-foreground font-sans text-sm font-medium hover:opacity-90 transition-opacity flex items-center justify-center gap-2",children:[o.jsx(ue,{className:"w-4 h-4"}),"Crop & Save"]})]})]})})}function He(d,s,e){return new Promise((t,r)=>{const i=new FileReader;i.onload=n=>{const c=new Image;c.onload=()=>{const l=document.createElement("canvas");let p=c.width,m=c.height;const x=Math.min(s/p,e/m);x<1&&(p=Math.round(p*x),m=Math.round(m*x)),l.width=s,l.height=e;const v=l.getContext("2d");v.imageSmoothingEnabled=!0,v.imageSmoothingQuality="high",v.fillStyle="#0f1117",v.fillRect(0,0,l.width,l.height);const C=(l.width-p)/2,y=(l.height-m)/2;v.drawImage(c,C,y,p,m),l.toBlob(j=>{j?t(new File([j],`screenshot-${d.name}`,{type:"image/png"})):r(new Error("Canvas conversion failed"))},"image/png",.95)},c.onerror=r,c.src=n.target.result},i.onerror=r,i.readAsDataURL(d)})}function Je(){const[d,s]=S.useState([]),[e,t]=S.useState([]),[r,i]=S.useState(!1),[n,c]=S.useState(null),[l,p]=S.useState(null),m=S.useRef(null),x=S.useRef(null),v=async(h,u)=>{i(!0);try{const f=u==="mobile"?1024:1920,w=u==="mobile"?1707:1080,z=await He(h,f,w),{file_url:E}=await q.integrations.Core.UploadFile({file:z}),P={id:Date.now(),type:u,url:E,fileName:h.name,resizedSize:`${f}x${w}
99`,timestamp:new Date().toLocaleString()};u==="mobile"?s(D=>[...D,P]):t(D=>[...D,P])}catch(f){alert("Upload failed: "+f.message)}i(!1)},C=async(h,u)=>{var f;i(!0);try{if(console.log("[Crop] Starting crop upload for type:",u),console.log("[Crop] Data URL length:",h.length),!h||!h.includes(","))throw new Error("Invalid cropped image data");const[w,z]=h.split(","),E=((f=w.match(/:(.*?);/))==null?void 0:f[1])||"image/png";console.log("[Crop] MIME type:",E);const P=atob(z),D=new Uint8Array(P.length);for(let R=0;R<P.length;R++)D[R]=P.charCodeAt(R);const _=new File([D],`cropped-screenshot-${u}.png`,{type:E});console.log("[Crop] File size:",_.size,"bytes");const{file_url:k}=await q.integrations.Core.UploadFile({file:_});console.log("[Crop] Upload successful, URL:",k);const ce=u==="mobile"?1024:1920,de=u==="mobile"?1707:1080,H={id:Date.now(),type:u,url:k,fileName:"Cropped screenshot",resizedSize:`${ce}x${de}`,timestamp:new Date().toLocaleString()};u==="mobile"?s(R=>[...R,H]):t(R=>[...R,H]),c(null),p(null),alert("Screenshot cropped and uploaded successfully!")}catch(w){console.error("[Crop] Error:",w),alert("Crop failed: "+w.message)}i(!1)},y=(h,u)=>{if(!h.destination)return;const f=u==="mobile"?[...d]:[...e],[w]=f.splice(h.source.index,1);f.splice(h.destination.index,0,w),u==="mobile"?s(f):t(f)},j=(h,u)=>{u==="mobile"?s(f=>f.filter(w=>w.id!==h)):t(f=>f.filter(w=>w.id!==h))},b=async h=>{await navigator.clipboard.writeText(h)},a=(h,u)=>{const f=document.createElement("a");f.href=h,f.download=u,f.click()},g=[...d,...e];return o.jsxs("div",{className:"w-full max-w-[120rem] mx-auto px-5 sm:px-8 pt-10 pb-32",children:[o.jsxs("div",{className:"text-center mb-10",children:[o.jsx("h1",{className:"font-serif text-3xl font-bold text-foreground mb-2",children:"Manifest Screenshots"}),o.jsx("p",{className:"font-sans text-sm text-muted-foreground",children:"Upload, crop, and rearrange PWA manifest screenshots"})]}),o.jsx("div",{className:"bg-card border border-border rounded-2xl p-6 mb-8 shadow-sm",children:o.jsxs("div",{className:"flex items-start gap-3",children:[o.jsx(me,{className:"w-5 h-5 text-primary shrink-0 mt-0.5"}),o.jsxs("div",{className:"space-y-2",children:[o.jsx("p",{className:"font-sans text-sm text-foreground font-medium",children:"Screenshot Requirements"}),o.jsxs("ul",{className:"font-sans text-xs text-muted-foreground space-y-1 list-disc list-inside",children:[o.jsxs("li",{children:[o.jsx("strong",{children:"Mobile:"})," 9:16 aspect ratio, auto-resized to 1024x1707px"]}),o.jsxs("li",{children:[o.jsx("strong",{children:"Desktop:"})," 16:9 aspect ratio, auto-resized to 1920x1080px"]}),o.jsx("li",{children:"Format: PNG or JPG (converted to PNG)"}),o.jsx("li",{children:"Maximum file size: 5MB per image"}),o.jsx("li",{children:"Chrome Android shows only the first narrow screenshot in install prompt"}),o.jsx("li",{children:"Drag screenshots to rearrange their order in the manifest"})]})]})]})}),o.jsxs("div",{className:"bg-card border border-border rounded-2xl p-6 mb-6 shadow-sm",children:[o.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[o.jsx(xe,{className:"w-5 h-5 text-primary"}),o.jsxs("div",{children:[o.jsx("h2",{className:"font-serif text-lg font-semibold text-foreground",children:"Mobile Screenshots"}),o.jsx("p",{className:"font-sans text-xs text-muted-foreground",children:"Portrait screenshots for mobile devices"})]})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx("input",{ref:m,type:"file",accept:"image/*",onChange:h=>{var f;const u=(f=h.target.files)==null?void 0:f[0];u&&v(u,"mobile"),h.target.value=""},disabled:r,className:"hidden"}),o.jsx("button",{onClick:()=>{var h;return(h=m.current)==null?void 0:h.click()},disabled:r,className:"w-full flex flex-col items-center justify-center gap-3 px-4 py-12 border-2 border-dashed border-border rounded-xl bg-secondary/30 hover:bg-secondary/50 transition-colors cursor-pointer disabled:opacity-60",children:r?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"w-6 h-6 animate-spin rounded-full border-2 border-primary border-t-transparent"}),o.jsx("p",{className:"font-sans text-xs text-muted-foreground",children:"Uploading..."})]}):o.jsxs(o.Fragment,{children:[o.jsx(K,{className:"w-6 h-6 text-muted-foreground"}),o.jsxs("div",{className:"text-center",children:[o.jsx("p",{className:"font-sans text-sm text-foreground font-medium",children:"Click to upload mobile screenshot"}),o.jsx("p",{className:"font-sans text-xs text-muted-foreground mt-1",children:"Auto-resized to 1024x1707 (9:16)"})]})]})})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx("p",{className:"font-sans text-sm font-medium text-foreground",children:"Uploaded mobile screenshots (drag to rearrange):"}),d.length===0?o.jsx("p",{className:"font-sans text-xs text-muted-foreground italic",children:"No screenshots uploaded yet"}):o.jsx(B,{onDragEnd:h=>y(h,"mobile"),children:o.jsx(X,{droppableId:"mobile-screenshots",children:h=>o.jsxs("div",{...h.droppableProps,ref:h.innerRef,className:"space-y-3 max-h-96 overflow-y-auto",children:[d.map((u,f)=>o.jsx(V,{draggableId:String(u.id),index:f,children:w=>o.jsxs("div",{ref:w.innerRef,...w.draggableProps,className:"flex gap-3 p-3 rounded-xl bg-secondary/30 border border-border",children:[o.jsx("div",{...w.dragHandleProps,className:"flex items-center justify-center w-8 text-muted-foreground cursor-grab active:cursor-grabbing",children:o.jsx(Y,{className:"w-4 h-4"})}),o.jsx("div",{className:"w-20 h-32 rounded-lg overflow-hidden bg-background shrink-0",children:o.jsx("img",{src:u.url,alt:u.fileName,className:"w-full h-full object-cover"})}),o.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[o.jsx("p",{className:"font-sans text-xs font-medium text-foreground truncate",children:u.fileName}),o.jsxs("p",{className:"font-sans text-[10px] text-muted-foreground",children:["Resized to ",u.resizedSize]}),o.jsx("p",{className:"font-sans text-[10px] text-muted-foreground",children:u.timestamp}),o.jsxs("div",{className:"flex gap-2 flex-wrap",children:[o.jsxs("button",{onClick:()=>b(u.url),className:"flex items-center gap-1 px-2 py-1 rounded-md bg-background border border-border text-[10px] font-sans text-muted-foreground hover:text-foreground transition-colors",children:[o.jsx(G,{className:"w-3 h-3"})," Copy"]}),o.jsxs("button",{onClick:()=>a(u.url,`screenshot-mobile-${f+1}.png`),className:"flex items-center gap-1 px-2 py-1 rounded-md bg-background border border-border text-[10px] font-sans text-muted-foreground hover:text-foreground transition-colors",children:[o.jsx($,{className:"w-3 h-3"})," Download"]}),o.jsxs("button",{onClick:()=>{c(u.url),p("mobile")},className:"flex items-center gap-1 px-2 py-1 rounded-md bg-background border border-border text-[10px] font-sans text-muted-foreground hover:text-foreground transition-colors",children:[o.jsx(Z,{className:"w-3 h-3"})," Crop"]}),o.jsx("button",{onClick:()=>j(u.id,"mobile"),className:"flex items-center gap-1 px-2 py-1 rounded-md bg-background border border-destructive text-destructive text-[10px] font-sans hover:bg-destructive/10 transition-colors",children:o.jsx(J,{className:"w-3 h-3"})})]})]})]})},u.id)),h.placeholder]})})})]})]})]}),o.jsxs("div",{className:"bg-card border border-border rounded-2xl p-6 mb-6 shadow-sm",children:[o.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[o.jsx(be,{className:"w-5 h-5 text-primary"}),o.jsxs("div",{children:[o.jsx("h2",{className:"font-serif text-lg font-semibold text-foreground",children:"Desktop Screenshots"}),o.jsx("p",{className:"font-sans text-xs text-muted-foreground",children:"Landscape screenshots for desktop/tablet"})]})]}),o.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[o.jsxs("div",{className:"space-y-3",children:[o.jsx("input",{ref:x,type:"file",accept:"image/*",onChange:h=>{var f;const u=(f=h.target.files)==null?void 0:f[0];u&&v(u,"desktop"),h.target.value=""},disabled:r,className:"hidden"}),o.jsx("button",{onClick:()=>{var h;
99return(h=x.current)==null?void 0:h.click()},disabled:r,className:"w-full flex flex-col items-center justify-center gap-3 px-4 py-12 border-2 border-dashed border-border rounded-xl bg-secondary/30 hover:bg-secondary/50 transition-colors cursor-pointer disabled:opacity-60",children:r?o.jsxs(o.Fragment,{children:[o.jsx("div",{className:"w-6 h-6 animate-spin rounded-full border-2 border-primary border-t-transparent"}),o.jsx("p",{className:"font-sans text-xs text-muted-foreground",children:"Uploading..."})]}):o.jsxs(o.Fragment,{children:[o.jsx(K,{className:"w-6 h-6 text-muted-foreground"}),o.jsxs("div",{className:"text-center",children:[o.jsx("p",{className:"font-sans text-sm text-foreground font-medium",children:"Click to upload desktop screenshot"}),o.jsx("p",{className:"font-sans text-xs text-muted-foreground mt-1",children:"Auto-resized to 1920x1080 (16:9)"})]})]})})]}),o.jsxs("div",{className:"space-y-3",children:[o.jsx("p",{className:"font-sans text-sm font-medium text-foreground",children:"Uploaded desktop screenshots (drag to rearrange):"}),e.length===0?o.jsx("p",{className:"font-sans text-xs text-muted-foreground italic",children:"No screenshots uploaded yet"}):o.jsx(B,{onDragEnd:h=>y(h,"desktop"),children:o.jsx(X,{droppableId:"desktop-screenshots",children:h=>o.jsxs("div",{...h.droppableProps,ref:h.innerRef,className:"space-y-3 max-h-96 overflow-y-auto",children:[e.map((u,f)=>o.jsx(V,{draggableId:String(u.id),index:f,children:w=>o.jsxs("div",{ref:w.innerRef,...w.draggableProps,className:"flex gap-3 p-3 rounded-xl bg-secondary/30 border border-border",children:[o.jsx("div",{...w.dragHandleProps,className:"flex items-center justify-center w-8 text-muted-foreground cursor-grab active:cursor-grabbing",children:o.jsx(Y,{className:"w-4 h-4"})}),o.jsx("div",{className:"w-32 h-20 rounded-lg overflow-hidden bg-background shrink-0",children:o.jsx("img",{src:u.url,alt:u.fileName,className:"w-full h-full object-cover"})}),o.jsxs("div",{className:"flex-1 min-w-0 space-y-2",children:[o.jsx("p",{className:"font-sans text-xs font-medium text-foreground truncate",children:u.fileName}),o.jsxs("p",{className:"font-sans text-[10px] text-muted-foreground",children:["Resized to ",u.resizedSize]}),o.jsx("p",{className:"font-sans text-[10px] text-muted-foreground",children:u.timestamp}),o.jsxs("div",{className:"flex gap-2 flex-wrap",children:[o.jsxs("button",{onClick:()=>b(u.url),className:"flex items-center gap-1 px-2 py-1 rounded-md bg-background border border-border text-[10px] font-sans text-muted-foreground hover:text-foreground transition-colors",children:[o.jsx(G,{className:"w-3 h-3"})," Copy"]}),o.jsxs("button",{onClick:()=>a(u.url,`screenshot-desktop-${f+1}.png`),className:"flex items-center gap-1 px-2 py-1 rounded-md bg-background border border-border text-[10px] font-sans text-muted-foreground hover:text-foreground transition-colors",children:[o.jsx($,{className:"w-3 h-3"})," Download"]}),o.jsxs("button",{onClick:()=>{c(u.url),p("desktop")},className:"flex items-center gap-1 px-2 py-1 rounded-md bg-background border border-border text-[10px] font-sans text-muted-foreground hover:text-foreground transition-colors",children:[o.jsx(Z,{className:"w-3 h-3"})," Crop"]}),o.jsx("button",{onClick:()=>j(u.id,"desktop"),className:"flex items-center gap-1 px-2 py-1 rounded-md bg-background border border-destructive text-destructive text-[10px] font-sans hover:bg-destructive/10 transition-colors",children:o.jsx(J,{className:"w-3 h-3"})})]})]})]})},u.id)),h.placeholder]})})})]})]})]}),n&&o.jsx(Ze,{image:n,onCrop:h=>C(h,l),onCancel:()=>{c(null),p(null)},positionMode:l==="mobile"?"portrait":"landscape"}),g.length>0&&o.jsxs("div",{className:"bg-card border border-border rounded-2xl p-6 mt-8 shadow-sm",children:[o.jsxs("div",{className:"flex items-center justify-between mb-4",children:[o.jsx("h2",{className:"font-serif text-lg font-semibold text-foreground",children:"Manifest Code"}),o.jsxs("button",{onClick:()=>b(`screenshots: [ 100${g.map((h,u)=>` { 101 src: "${h.url}", 102 sizes: "${h.type==="mobile"?"1024x1707":"1920x1080"}", 103 type: "image/png", 104 form_factor: "${h.type==="mobile"?"narrow":"wide"}", 105 label: "Screenshot ${u+1}" 106 }`).join(`, 107`)} 108]`),className:"flex items-center gap-2 px-4 py-2 rounded-xl bg-primary text-primary-foreground font-sans text-sm font-medium transition-all duration-200 hover:scale-[1.02] active:scale-[0.98]",children:[o.jsx(fe,{className:"w-4 h-4"})," Copy Code"]})]}),o.jsx("p",{className:"font-sans text-sm text-muted-foreground mb-4",children:"Order matches your screenshot arrangement above:"}),o.jsx("pre",{className:"bg-secondary/50 rounded-xl p-4 overflow-x-auto text-xs font-mono text-foreground",children:`screenshots: [ 109${g.map((h,u)=>` { 110 src: "${h.url}", 111 sizes: "${h.type==="mobile"?"1024x1707":"1920x1080"}", 112 type: "image/png", 113 form_factor: "${h.type==="mobile"?"narrow":"wide"}", 114 label: "Screenshot ${u+1}" 115 }`).join(`, 116`)} 117]`})]})]})}export{Je as default};
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.