PageSourceSearch

https://bro-depot.com/_next/static/chunks/5646-172164f0315e088b.js

js bro-depot.com collected 2026-10-04 02:42:14 UTC 59,512 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5646],{95014:function(e,n,t){var r=t(26042),i=t(69396),o=t(85893),a=t(83092),l=t(33821);n.Z=function(e){var n=e.sx,t=e.skin,s=e.color,u=(0,a.Z)(),c={primary:(0,r.Z)({},u.primaryLight),secondary:(0,r.Z)({},u.secondaryLight),success:(0,r.Z)({},u.successLight),error:(0,r.Z)({},u.errorLight),warning:(0,r.Z)({},u.warningLight),info:(0,r.Z)({},u.infoLight)};return(0,o.jsx)(l.Z,(0,i.Z)((0,r.Z)({},e),{sx:"light"===t&&s?(0,r.Z)({"& .MuiBadge-badge":c[s]},n):n}))}},62126:function(e,n,t){var r=t(14924),i=t(30120),o=(0,t(81719).ZP)(i.Z)((function(e){var n,t=e.theme;return{"&.dropzone, & .dropzone":(n={minHeight:200,display:"flex",flexWrap:"wrap",position:"relative",alignItems:"center",justifyContent:"center",padding:t.spacing(4),borderRadius:t.shape.borderRadius,border:"2px dashed ".concat("light"===t.palette.mode?"rgba(93, 89, 98, 0.22)":"rgba(247, 244, 254, 0.14)")},(0,r.Z)(n,t.breakpoints.down("xs"),{textAlign:"center"}),(0,r.Z)(n,"&:focus",{outline:"none"}),(0,r.Z)(n,"& + .MuiList-root",{padding:0,marginTop:t.spacing(6.25),"& .MuiListItem-root":{display:"flex",justifyContent:"space-between",borderRadius:t.shape.borderRadius,padding:t.spacing(2.5,2.4,2.5,6),border:"1px solid ".concat("light"===t.palette.mode?"rgba(93, 89, 98, 0.14)":"rgba(247, 244, 254, 0.14)"),"& .file-details":{display:"flex",alignItems:"center"},"& .file-preview":{display:"flex",marginRight:t.spacing(3.75),"& svg":{fontSize:"2rem"}},"& img":{width:38,height:38,padding:t.spacing(.75),borderRadius:t.shape.borderRadius,border:"1px solid ".concat("light"===t.palette.mode?"rgba(93, 89, 98, 0.14)":"rgba(247, 244, 254, 0.14)")},"& .file-name":{fontWeight:600},"& + .MuiListItem-root":{marginTop:t.spacing(3.5)}},"& + .buttons":{display:"flex",justifyContent:"flex-end",marginTop:t.spacing(6.25),"& > :first-of-type":{marginRight:t.spacing(3.5)}}}),(0,r.Z)(n,"& img.single-file-image",{objectFit:"cover",position:"absolute",width:"calc(100% - 1rem)",height:"calc(100% - 1rem)",borderRadius:t.shape.borderRadius}),n)}}));n.Z=o},72007:function(e,n,t){var r=t(14924),i=t(85390),o=t(30120),a=(0,t(81719).ZP)(o.Z)((function(e){var n,t=e.theme;return n={},(0,r.Z)(n,t.breakpoints.down("md"),{"& .MuiStepper-horizontal:not(.MuiStepper-alternativeLabel)":{flexDirection:"column",alignItems:"flex-start"}}),(0,r.Z)(n,"& .MuiStep-root",{"& .step-label":{display:"flex",alignItems:"center",justifyContent:"center"},"& .step-number":{fontWeight:600,letterSpacing:.25,fontSize:"2.125rem",marginRight:t.spacing(2.5),color:t.palette.text.primary},"& .step-title":{fontWeight:500,fontSize:"0.875rem",letterSpacing:"0.1px",color:t.palette.text.primary},"& .step-subtitle":{fontWeight:400,fontSize:"0.75rem",letterSpacing:"0.4px",color:t.palette.text.secondary},"& .MuiStepLabel-root.Mui-disabled":{"& .step-number":{color:t.palette.text.disabled}},"& .Mui-error":{"& .MuiStepLabel-labelContainer, & .step-number, & .step-title, & .step-subtitle":{color:t.palette.error.main}}}),(0,r.Z)(n,"& .MuiStepConnector-root",{"& .MuiStepConnector-line":{borderWidth:3,borderRadius:3},"&.Mui-active, &.Mui-completed":{"& .MuiStepConnector-line":{borderColor:t.palette.primary.main}},"&.Mui-disabled .MuiStepConnector-line":{borderColor:(0,i.E)(t.palette.primary.main,.12)}}),(0,r.Z)(n,"& .MuiStepper-alternativeLabel",{"& .MuiStepConnector-root":{top:10},"& .MuiStepLabel-labelContainer":{display:"flex",alignItems:"center",flexDirection:"column","& > * + *":{marginTop:t.spacing(1)}}}),(0,r.Z)(n,"& .MuiStepper-vertical",{"& .MuiStep-root":{"& .step-label":{justifyContent:"flex-start"},"& .MuiStepContent-root":{borderWidth:3,marginLeft:t.spacing(2.25),borderColor:t.palette.primary.main},"& .button-wrapper":{marginTop:t.spacing(4)},"&.active + .MuiStepConnector-root .MuiStepConnector-line":{borderColor:t.palette.primary.main}},"& .MuiStepConnector-root":{marginLeft:t.spacing(2.25),"& .MuiStepConnector-line":{borderRadius:0}}}),n}));n.Z=a},89479:function(e,n,t){t.d(n,{Tg:function(){return i},UW:function(){return r},jW:function(){return o}});var r=function(e){return e.stopPropagation()},i=function(e){return e.stopPropagation()},o=function(e){var n;e.ctrlKey&&"KeyA"===e.code&&(null===(n=e.target)||void 0===n||n.select()),e.stopPropagation()}},30463:function(e,n,t){var r=t(26042),i=t(69396),o=t(99534),a=t(85893),l=t(55343),s=t(67836),u=t(32631),c=t(96486),d=t(87536),f=t(6328);n.Z=function(e){var n,t=e.methods,p=e.name,m=e.label,g=e.defaultValue,h=e.defaultValues,v=e.rules,x=e.textFieldProps,b=e.controllerProps,y=e.formControlProps,Z=void 0===y?f.f:y,j=t.control,w=(0,d.cl)({control:j}).errors,I=(0,c.get)(w,p),C=g||(0,c.get)(h,p),k=(0,f.V)(p,m);return(0,a.jsxs)(l.Z,(0,i.Z)((0,r.Z)({},Z),{children:[(0,a.jsx)(d.Qr,(0,r.Z)({name:p,control:j,defaultValue:C,rules:v,render:function(e){var n=e.field,t=n.value,i=n.onChange,l=n.onBlur,u=x||{},c=u.onBlur,d=(0,o.Z)(u,["onBlur"]),f=c?function(e){l(),c(e)}:l;return(0,a.jsx)(s.Z,(0,r.Z)({value:t||"",onBlur:f,onChange:function(e){return i(e)},error:Boolean(I),label:k,size:"small"},d))}},b)),I&&(0,a.jsx)(u.Z,{sx:{color:"error.main"},children:null===(n=I.message)||void 0===n?void 0:n.toString()})]}))}},514:function(e,n,t){var r=t(26042),i=t(69396),o=t(85893),a=t(99751),l=t(55343),s=t(29630),u=t(32631),c=t(96486),d=t(87536),f=t(6328);n.Z=function(e){var n,t=e.methods,p=e.name,m=e.label,g=e.defaultValue,h=e.defaultValues,v=e.rules,x=e.controllerProps,b=e.imageUploaderProps,y=e.formControlProps,Z=void 0===y?f.f:y,j=t.control,w=(0,d.cl)({control:j}).errors,I=(0,c.get)(w,p),C=g||(0,c.get)(h,p),k=((0,f.V)(p,m),(null===b||void 0===b?void 0:b.allImages)||C);return null===b||void 0===b||b.buttonColor,(0,o.jsxs)(l.Z,(0,i.Z)((0,r.Z)({error:Boolean(I)},Z),{children:[(0,o.jsx)(d.Qr,(0,r.Z)({name:p,control:j,defaultValue:C,rules:v,render:function(e){var n=e.field,t=n.value,l=n.onChange;n.onBlur;return(0,o.jsxs)("div",{className:"relative",children:[(0,o.jsx)(s.Z,{hidden:!m,component:"div",className:"absolute left-5 top-2 rounded-md border-2 border-stone-400 bg-stone-400 px-1",variant:"body2",children:(0,o.jsx)("span",{className:"text-white",children:m})}
1),(0,o.jsx)(a.Z,(0,i.Z)((0,r.Z)({files:t,setFiles:l},b),{allImages:k}))]})}},x)),I&&(0,o.jsx)(u.Z,{sx:{color:"error.logo"},children:null===(n=I.message)||void 0===n?void 0:n.toString()})]}))}},6328:function(e,n,t){t.d(n,{V:function(){return o},f:function(){return i}});var r=t(96486),i={fullWidth:!0,size:"small"},o=function(e,n){return void 0!==n?n:e?e.includes(".")?(0,r.startCase)(e.split(".").pop()):(0,r.startCase)(e):""}},76366:function(e,n,t){t.d(n,{e:function(){return d}});var r=t(26042),i=t(69396),o=t(85893),a=t(43085),l=t(63015),s=t(11767),u=t(67294),c=t(87536);function d(e){var n=e.defaultValues,t=e.methods,d=e.children,f=e.onSubmit,p=e.formProps,m=(0,l.T)({selector:s.TV}).isUploadingState;return(0,o.jsx)(c.RV,(0,i.Z)((0,r.Z)({},t),{children:(0,o.jsx)("form",(0,i.Z)((0,r.Z)({onSubmit:function(e){e.preventDefault(),m?(0,a.JT)("Please wait for any pending uploads to complete before submitting the form.",{icon:"\u26a0\ufe0f"}):f(e),e.stopPropagation()}},p),{children:u.Children.map(d,(function(e){return null===e?null:e.props.name?(0,u.createElement)(e.type,(0,r.Z)({},(0,i.Z)((0,r.Z)({},e.props),{defaultValues:n,key:e.props.name}))):e}))}))}))}},1427:function(e,n,t){var r=t(85893),i=t(87536),o=t(30463);n.Z=function(e){var n=e.name,t=e.defaultValue,a=e.label,l=e.rules,s=e.defaultValues,u=e.controllerProps,c=e.formControlProps,d=e.textFieldProps,f=(0,i.Gc)();return(0,r.jsx)(o.Z,{name:n,label:a,rules:l,defaultValue:t,defaultValues:s,controllerProps:u,formControlProps:c,textFieldProps:d,methods:f})}},14303:function(e,n,t){var r=t(26042),i=t(85893),o=t(54459),a=t(85390),l=t(30120),s=(0,t(81719).ZP)(l.Z)((function(e){var n=e.theme;return{width:20,height:20,borderWidth:3,borderRadius:"50%",borderStyle:"solid",borderColor:(0,a.E)(n.palette.primary.main,.12)}}));n.Z=function(e){var n=e.active,t=e.completed,a=e.error,l=e.color,u=void 0===l?"primary.main":l;return a?(0,i.jsx)(o.iI,{style:{width:20,height:20,color:"error.main",transform:"scale(1.2)"}}):t?(0,i.jsx)(o.OH,{style:{width:20,height:20,color:u,transform:"scale(1.2)"}}):(0,i.jsx)(s,{className:"stepper-custom-dot",sx:(0,r.Z)({},n&&{borderColor:u})})}},94805:function(e,n,t){var r=t(26042),i=t(69396),o=t(85893),a=t(9942),l=t(54225),s=t(29620),u=t(80562),c=t(95398),d=t(30120),f=t(29630),p=t(67294),m=t(20986),g=(0,p.forwardRef)((function(e,n){return(0,o.jsx)(a.Z,(0,r.Z)({ref:n},e))}));n.Z=function(e){var n,t=e.children,a=e.isOpen,h=e.setIsOpen,v=e.dialogProps,x=e.button,b=e.buttonContent,y=void 0===b?"Open":b,Z=e.title,j=e.description,w=e.maxWidth,I=void 0===w?"md":w,C=(0,p.useCallback)((function(e,n){h(!1)}),[]),k=(0,p.useCallback)((function(e){h(!0)}),[]);return(0,o.jsxs)(o.Fragment,{children:[x||(0,o.jsx)(l.Z,{variant:"contained",sx:{mb:2.5,whiteSpace:"nowrap"},onClick:k,children:y}),(0,o.jsxs)(s.Z,(0,i.Z)((0,r.Z)({fullWidth:!0,maxWidth:I,scroll:"paper",onClose:C,TransitionComponent:g,open:a},v),{PaperProps:(0,i.Z)((0,r.Z)({},null===v||void 0===v?void 0:v.PaperProps),{sx:(0,r.Z)({position:"relative"},null===v||void 0===v||null===(n=v.PaperProps)||void 0===n?void 0:n.sx)}),children:[(0,o.jsx)(u.Z,{size:"small",onClick:function(){return h(!1)},sx:{position:"absolute",right:"1rem",top:"1rem",zIndex:1},children:(0,o.jsx)(m.Tw,{})}),(0,o.jsxs)(c.Z,{sx:{pb:6,px:[4,11],pt:[5,8.5]},children:[(Z||j)&&(0,o.jsxs)(d.Z,{sx:{mb:8,textAlign:"center"},children:[Z&&(0,o.jsx)(f.Z,{variant:"h6",sx:{mb:2,lineHeight:"2rem"},children:Z}),j&&(0,o.jsx)(f.Z,{variant:"body2",children:j})]}),t]})]}))]})}},3334:function(e,n,t){t.d(n,{Z:function(){return ae}});var r=t(47568),i=t(14924),o=t(26042),a=t(69396),l=t(70655),s=t(85893),u=t(12109),c=t.n(u),d=[137,80,78,71,13,10,26,10],f=new Set(["iCCP","gAMA","cHRM","sRGB","eXIf"]),p=function(e){var n=new Uint8Array(e);if(n.byteLength<33||!function(e){return d.every((function(n,t){return e[t]===n}))}(n))return null;if(function(e){var n=new DataView(e.buffer,e.byteOffset,e.byteLength);return n.getUint32(16)*n.getUint32(20)}(n)>4194304)return null;if(function(e){for(var n=new DataView(e.buffer,e.byteOffset,e.byteLength),t=8;t+8<=e.byteLength;){var r=n.getUint32(t),i=String.fromCharCode(e[t+4],e[t+5],e[t+6],e[t+7]);if(f.has(i))return!0;
1if("IEND"===i)return!1;t+=12+r}return!1}(n))return null;var t=c().decode(e);if(t.depth>8)return null;var r=c().toRGBA8(t);return 1!==r.length?null:c().encode(r,t.width,t.height,0)},m=function(){var e=(0,r.Z)((function(e){var n,t,r,i,o;return(0,l.__generator)(this,(function(a){switch(a.label){case 0:if(n=e.size,t=function(t,r){var i=t.size,o=i>0?Number((n/i).toFixed(3)):1;return console.info("[compress]",e.name,{originalBytes:n,compressedBytes:i,ratio:o,method:r}),{file:t,originalBytes:n,compressedBytes:i,ratio:o,method:r}},!e.type.startsWith("image/"))return[2,t(e,"passthrough")];if("image/png"!==e.type)return[2,t(e,"original")];a.label=1;case 1:return a.trys.push([1,3,,4]),[4,e.arrayBuffer()];case 2:return r=a.sent(),!(i=p(r))||i.byteLength>=r.byteLength?[2,t(e,"original")]:[2,t(new File([i],e.name,{type:"image/png",lastModified:e.lastModified}),"png-lossless")];case 3:return o=a.sent(),console.info("[compress] lossless re-encode failed, uploading original",e.name,o),[2,t(e,"original")];case 4:return[2]}}))}));return function(n){return e.apply(this,arguments)}}(),g=t(16563),h=t(50505),v=t(57891),x=t(43085),b=t(70754),y=t(30120),Z=t(81719),j=t(29630),w=t(96486),I=t(32512),C=t(85634),k=t(18377),P=t(67294),S=t(828),F=t(29815),N=t(15948),R=t(20986),A=t(19248),z=t(44414),M=t(13264),_=t(25675),T=t.n(_),O=t(95014),L=t(31753),D=t(96277),E=t(68690),U=function(e){var n=(0,E.wj)(),t=n.imageInPreview,r=n.setImageInPreview,i=n.hasPrevImage,o=n.hasNextImage,a=n.onPrevImage,l=n.onNextImage,u=e.imageUrl,c=e.previewOpen,d=e.setPreviewOpen,f=e.setOnImageHover;return(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(k.Z,{className:"rounded-t-md bg-indigo-400 hover:bg-indigo-600",children:(0,s.jsx)($,{"aria-label":"View image",size:"small",onClick:function(){d(!0),r({content:u,thumbnail:u,type:D.Tv5.Image})},children:(0,s.jsx)(A.Z_,{})})}),(0,s.jsx)(L.ai,{previewOpen:c,handleClose:function(){d(!1),f(!1)},imageInPreview:t,hasPrevImage:i,hasNextImage:o,onPrevImage:a,onNextImage:l})]})},B=(0,M.Z)(T())((function(e){var n=e.theme;return{borderRadius:n.shape.borderRadius,borderTopLeftRadius:1,backgroundColor:n.palette.background.paper,objectFit:"contain",visibility:"visible"}})),W=(0,M.Z)(k.Z)((function(e){var n=e.theme;return{borderRadius:n.shape.borderRadius,backgroundColor:n.palette.background.paper,objectFit:"contain",visibility:"visible"}})),q=function(e){var n=e.src,t=e.alt,r=e.actions,i=(e.findAndReplaceImage,e.index),o=e.showSequence,a=void 0!==o&&o,l=(0,P.useState)(!1),u=l[0],c=l[1],d=(0,P.useState)(!1),f=d[0],p=d[1],m=(0,P.useState)(!1),g=m[0],h=(m[1],0===i?"Cover":"".concat(i)),v=n,x=(0,z.R)(n);return(0,z.y)(n)||(v="/assets/images/imageNotFound.png"),(0,s.jsxs)(k.Z,{onMouseEnter:function(){c(!0)},onMouseLeave:function(){f||g||c(!1)},sx:{position:"relative",display:"inline-block"},children:[(0,s.jsx)(O.Z,{color:"primary",badgeContent:h,sx:{visibility:a?"visible":"hidden"},children:x?(0,s.jsx)(B,{src:v,alt:t,width:100,height:100}):(0,s.jsx)(W,{src:v,alt:t,width:100,height:100,component:"img"})}),(0,s.jsxs)(k.Z,{className:"flex flex-row",sx:{position:"absolute",top:"-1.5rem",left:0,pointerEvents:"auto",zIndex:1e3},children:[r,u&&(0,s.jsx)(U,{imageUrl:v,previewOpen:f,setPreviewOpen:p,setOnImageHover:c})]})]})},V=t(80562),H=t(54225),$=(0,M.Z)(V.Z)((function(e){e.theme;return{color:"white !important",fontSize:"1.125rem",minWidth:"30px",minHeight:"30px"}})),Q=(0,M.Z)(k.Z)((function(e){return{display:"flex",alignItems:"center",justifyContent:"center",borderRadius:"0.5rem","&:hover":{backgroundColor:e.theme.palette.background.highlight}}})),Y=(0,M.Z)(A.Te)((function(e){return{"& path":{stroke:e.theme.palette.primary.main}}})),G=function(e,n,t){return(0,o.Z)({userSelect:"none",padding:2*e,margin:"0 ".concat(e,"px 0 0"),background:n?"rgba(255, 0, 0, 0.0)":"grey"},t)},J=function(e){var n=e.image,t=e.setLoading,r=e.getSingleOriginalImage;return(0,w.get)(n,"originalFile.content")?(0,s.jsx)(k.Z,{className:"rounded-t-md bg-yellow-400 hover:bg-yellow-600",children:(0,s.jsx)($,{"aria-label":"Image Processing",size:"small",onClick:function(){return r(n,t)},children:(0,s.jsx)(A.KD,{})})}):null},K=function(e){var n=(0,E.wj)(),t=n.handleRemoveFile,r=n.findBySrcAndReplaceFile,i=n.ePlatformStoreId,l=n.getSingleOriginalImage,u=e.draggableId,c=e.image,d=e.listIndex,f=e.index,p=e.grid,m=(0,P.useState)(!1),g=m[0],h=m[1],v=(0,P.useState)(!1),x=v[0],y=v[1],Z=(0,w.get)(c,"content"),j=(0,w.get)(c,"type"),I=(0,M.Z)(T())((function(e){e.theme;return{objectFit:"contain",visibility:"visible"}}
1)),C=function(){if(j===D.Tv5.Document){return(0,s.jsxs)(Q,{onMouseOver:function(){y(!0)},onMouseOut:function(){y(!1)},children:[x&&(0,s.jsxs)(k.Z,{className:"absolute z-10 flex h-full w-full flex-col items-center justify-center gap-2 rounded-md",sx:{backgroundColor:"rgb(71, 85, 105, 1.0)"},children:[(0,s.jsx)(H.Z,{className:"",size:"medium",color:"primary",variant:"contained",onClick:function(){window.open("".concat(Z))},children:(0,s.jsx)(A.IF,{})}),(0,s.jsx)(H.Z,{className:"",size:"medium",color:"error",variant:"contained",onClick:function(){t(d+f)},children:(0,s.jsx)(R.pJ,{})})]}),(0,s.jsx)(I,{src:"/assets/images/pdf.png",alt:"pdf.png",width:100,height:100})]})}return(0,s.jsx)(q,{src:Z,alt:"Draggable Image-".concat(f),index:d+f,findAndReplaceImage:r,showSequence:!!i,actions:(0,s.jsxs)(s.Fragment,{children:[(0,s.jsx)(k.Z,{className:"rounded-t-md bg-red-500 hover:bg-red-700",sx:{pointerEvents:"auto"},children:(0,s.jsx)($,{"aria-label":"Remove image",size:"small",type:"button",onMouseDown:function(e){e.stopPropagation(),e.preventDefault(),t(d+f)},onClick:function(e){e.stopPropagation(),e.preventDefault(),t(d+f)},children:(0,s.jsx)(R.Tw,{})})}),(0,s.jsx)(J,{image:c,setLoading:h,getSingleOriginalImage:l})]})},"".concat(Z+f))};return(0,s.jsx)(N._l,{draggableId:"".concat(u,"-").concat(f),index:f,children:function(e,n){return(0,s.jsx)("div",(0,a.Z)((0,o.Z)({ref:e.innerRef,style:G(p,n.isDragging,e.draggableProps.style)},e.draggableProps,e.dragHandleProps),{children:(0,s.jsxs)("div",{className:"relative mx-4 my-5",children:[g&&(0,s.jsx)(k.Z,{className:"absolute left-0 top-0 mr-40 flex h-full w-full items-center justify-center rounded-md rounded-tl-none bg-slate-700 opacity-80 ",sx:{zIndex:3},children:(0,s.jsx)(b.Z,{className:"z-10",disableShrink:!0,sx:{mt:6}})}),C()]})}))}})},X=function(e){var n=e.draggableId,t=e.droppableId,r=e.imageArray,i=e.listIndex;return(0,s.jsx)(N.bK,{droppableId:t,direction:"horizontal",children:function(e,t){return(0,s.jsxs)("div",(0,a.Z)((0,o.Z)({ref:e.innerRef,className:"rounded-sm grid grid-cols-4 gap-1 p-3"},e.droppableProps),{children:[null===r||void 0===r?void 0:r.map((function(e,t){return(0,s.jsx)(K,{draggableId:n,image:e,listIndex:i,index:t,grid:8},t)})),e.placeholder]}))}})},ee=function(e){var n=e._2dImages,t=e.combineImage;return 0===(null===n||void 0===n?void 0:n.length)?null:(0,s.jsx)(N.Z5,{onDragEnd:function(e){var r=e.source,i=e.destination;if(i){var o=r.droppableId,a=i.droppableId;if(o===a){var l=Number(o),s=function(e,n,t){var r=Array.from(e),i=(0,S.Z)(r.splice(n,1),1)[0];return r.splice(t,0,i),r}(n[l],r.index,i.index),u=(0,F.Z)(n);u[l]=s,t(u)}else{var c=Number(o),d=Number(a),f=function(e,n,t,r){var i=Array.from(e),o=Array.from(n),a=(0,S.Z)(i.splice(t.index,1),1)[0],l={};return o.splice(r.index,0,a),l[t.droppableId]=null!==i&&void 0!==i?i:[],l[r.droppableId]=null!==o&&void 0!==o?o:[],l}(n[c],n[d],r,i),p=(0,F.Z)(n);if(!f[c]||!f[d])return void t(p.filter((function(e){return e.length})));p[c]=f[c],p[d]=f[d],t(p.filter((function(e){return e.length})))}}},children:(0,s.jsx)("div",{className:"gap-y-2",children:null===n||void 0===n?void 0:n.map((function(e,t){if(0===(null===e||void 0===e?void 0:e.length))return null;var r=t>0?n[t-1].length:e.length;return(0,s.jsx)(X,{listIndex:r*t,draggableId:"".concat(t),droppableId:"".concat(t),imageArray:e},t)}))})})},ne=function(e){var n=e.pictures,t=e.setPictures,r=e.containerWidth,i=window.screen,o=(i.height,i.width),a=(0,P.useCallback)((function(){var e=r||o-200;return Math.floor(e/140)}),[r,o]),l=(0,P.useCallback)((function(e){for(var t=[],r=a(),i=0;i<n.length;i+=r){var o=e.slice(i,i+r);t.push(o)}return t}),[a,n]),u=(0,P.useMemo)((function(){return l(n)}),[l,n]);return 0===(null===n||void 0===n?void 0:n.length)?null:(0,s.jsx)("div",{children:(0,s.jsx)(ee,{_2dImages:u,combineImage:function(e){t((0,w.flatten)(e))}})})},te=function(e){var n=e.picture,t=e.findBySrcAndReplaceFile,r=e.handleRemoveFile,i=(0,P.useState)(!1),o=i[0],a=i[1],l=(0,w.get)(n,"content"),u=n.type;if(!l)return null;if(u===D.Tv5.Document){return(0,s.jsx)("div",{className:"mx-4 my-5 flex",children:(0,s.jsxs)(Q,{className:"relative",onMouseOver:function(){a(!0)},onMouseOut:function(){a(!1)},children:[o&&(0,s.jsxs)(k.Z,{className:"absolute z-10 flex h-full w-full flex-col items-center justify-center gap-2 rounded-md",sx:{backgroundColor:"rgb(71, 85, 105, 1.0)"},children:[(0,s.jsx)(H.Z,{className:"",size:"medium",color:"primary",variant:"contained",onClick:function(){window.open("".concat(l))},children:(0,s.jsx)(A.IF,{})}),(0,s.jsx)(H.Z,{className:"",size:"medium",color:"error",variant:"contained",onClick:function(){r()},children:(0,s.jsx)(R.pJ,{})})]}),(0,s.jsx)(Y,{size:30})]})})}return(0,s.jsx)("div",{className:"mx-4 my-5 flex",children:(0,s.jsx)(q,{src:l,alt:"An image preview",index:0,findAndReplaceImage:t,actions:(0,s.jsx)(k.Z,{className:"rounded-t-md bg-red-500 hover:bg-red-700",sx:{pointerEvents:"auto"},children:(0,s.jsx)($,{"aria-label":"Remove image",size:"small",type:"button",onMouseDown:function(e){e.stopPropagation(),e.preventDefault(),r()},onClick:function(e){e.stopPropagation(),e.preventDefault(),r()},children:(0,s.jsx)(R.Tw,{})})})})})},re=function(e){var n=e.mode,t=e.hasFile,r=e.files,i=e.setFiles,o=e.handleRemoveFile,a=e.findBySrcAndReplaceFile,l=(0,P.useState)(void 0),u=l[0],c=l[1],d=(0,P.useRef)(null);(0,P.useEffect)((function(){var e=d.current;if(e){var n=new ResizeObserver((function(e){var n=e[0];n&&c(n.contentRect.width)}));return n.observe(e),function(){return n.disconnect()}}}),[]);return r&&0!==(null===r||void 0===r?void 0:r.length)?(0,s.jsxs)(s.Fragment,{children:[t&&(0,s.jsx)(k.Z,{className:"absolute left-0 top-0 mr-40 flex h-full w-full items-center justify-center rounded-md bg-gray-400 opacity-50",sx:{zIndex:"2",pointerEvents:"none"}}),(0,s.jsx)(k.Z,{ref:d,className:"h-full w-full",sx:{zIndex:"2",top:0,left:0},children:(0,s.jsx)(k.Z,{className:"flex flex-wrap items-start gap-x-12 lg:mx-4 ",children:r?(0,s.jsx)(s.Fragment,{children:"single"===n?(0,s.jsx)(te,{picture:r,handleRemoveFile:o,findBySrcAndReplaceFile:a}):(0,s.jsx)(ne,{pictures:r,setPictures:i,containerWidth:u})}):null})})]}):null},ie=(0,Z.ZP)("img")((function(e){var n,t=e.theme;return n={},(0,i.Z)(n,t.breakpoints.up("md"),{marginRight:t.spacing(10)}),(0,i.Z)(n,t.breakpoints.down("md"),{marginBottom:t.spacing(4)}),(0,i.Z)(n,t.breakpoints.down("sm"),{width:250}),n})),oe=(0,Z.ZP)(j.Z)((function(e){var n=e.theme;return(0,i.Z)({marginBottom:n.spacing(5)},n.breakpoints.down("sm"),{marginBottom:n.spacing(4)})})),ae=function(e){var n=e.mode,t=e.cardSize,i=e.buttonColor,u=void 0===i?"primary":i,c=e.files,d=e.setFiles,f=e.addFiles,p=e.loading,Z=e.setLoading,k=e.allImages,P=e.handleRemoveAllFiles,S=e.handleRemoveFile,F=e.findBySrcAndReplaceFile,N=e.f
1ileSize,R=void 0===N?3e7:N,A=e.numOfFiles,z=void 0===A?99:A,M=e.acceptedFileExtensions,_=void 0===M?{"image/*":[".png",".jpg",".jpeg",".webp"]}:M,T=e.onAfterDrop,O=function(){(0,x._N)("You can only upload ".concat(z," file(s) & maximum size of ").concat(R/1e6," MB."),{duration:2e3})},L=function(){var e=Object.values(_).map((function(e,n){if((0,w.isArray)(e)&&!e.length){var t=Object.keys(_)[n];return".".concat(t.substring(t.indexOf("/")+1))}return e}));return(0,w.flatten)(e).join(", ")},D=function(){var e=(0,r.Z)((function(e){return(0,l.__generator)(this,(function(n){switch(n.label){case 0:return[4,m(e)];case 1:return[2,n.sent().file]}}))}));return function(n){return e.apply(this,arguments)}}(),E=function(e){var n=Math.min(R,15728640),t=e.find((function(e){return e.size>n}));return!!t&&((0,x._N)("".concat(t.name," is ").concat((t.size/1e6).toFixed(1)," MB; the maximum is ").concat((n/1e6).toFixed(1)," MB."),{duration:3e3}),!0)},U=function(){(0,x._N)("You can only upload ".concat(L(),"."),{duration:2e3})},B=function(e){var n=Object.keys(_).map((function(e){var n=_[e];return n&&0!==n.length?["application/vnd.openxmlformats-officedocument.spreadsheetml.sheet","application/vnd.ms-excel"].includes(e)?e:n.map((function(n){var t=e.replace(/[^a-z0-9/]/g,""),r=n.replace(/[^a-z0-9]/g,"");return"".concat(t).concat(r)})):e})).flat();return null===n||void 0===n?void 0:n.some((function(n){return e===n}))},W=function(){var e=(0,r.Z)((function(e){var n,t,r,i,o,a,s,u,d,p,m;return(0,l.__generator)(this,(function(l){switch(l.label){case 0:if(Z(!0),n=null===e||void 0===e?void 0:e.map((function(e){return B(null===e||void 0===e?void 0:e.type)})).some((function(e){return!1===e})),c&&c.length+e.length>z)return O(),Z(!1),[2];if(n)return U(),Z(!1),[2];if(E(e))return Z(!1),[2];t=[],r=!0,i=!1,o=void 0,l.label=1;case 1:l.trys.push([1,6,7,8]),a=e[Symbol.iterator](),l.label=2;case 2:return(r=(s=a.next()).done)?[3,5]:(u=s.value,d=t.push,[4,D(u)]);case 3:d.apply(t,[l.sent()]),l.label=4;case 4:return r=!0,[3,2];case 5:return[3,8];case 6:return p=l.sent(),i=!0,o=p,[3,8];case 7:try{r||null==a.return||a.return()}finally{if(i)throw o}return[7];case 8:return[4,(0,g.I)(t,"files")];case 9:return(m=l.sent())&&m.length>0&&f(m),Z(!1),[2]}}))}));return function(n){return e.apply(this,arguments)}}(),q=function(){var e=(0,r.Z)((function(e){var n,t,r,i;return(0,l.__generator)(this,(function(o){switch(o.label){case 0:return(n=e[0])?(Z(!0),t=null===e||void 0===e?void 0:e.map((function(e){return B(null===e||void 0===e?void 0:e.type)})).some((function(e){return!1===e})),(0,v.Q)(c)?t?(U(),Z(!1),[2]):E([n])?(Z(!1),[2]):[4,D(n)]:(O(),Z(!1),[2])):[2];case 1:return r=o.sent(),[4,(0,g.I)([r],"files")];case 2:return(i=o.sent())&&i.length>0&&f(i[0]),Z(!1),[2]}}))}));return function(n){return e.apply(this,arguments)}}(),V=(0,I.uI)({noClick:!0,multiple:1!==z,maxSize:R,accept:_,onDrop:function(){var e=(0,r.Z)((function(e){return(0,l.__generator)(this,(function(t){return T&&T(e),"single"===n?q(e):W(e),[2]}))}));return function(n){return e.apply(this,arguments)}}(),onDropRejected:function(){O()}}),H=V.getRootProps,$=V.getInputProps,Q=V.open,Y="single"===n||"small"===t,G=Y?240:300,J=Y?!(0,v.Q)(c):(null===c||void 0===c?void 0:c.length)>0;return(0,s.jsx)(s.Fragment,{children:(0,s.jsxs)("div",(0,a.Z)((0,o.Z)({},H({className:"dropzone"})),{onPaste:function(e){if(!p){var t=e.target,r=null===t||void 0===t?void 0:t.tagName;if("INPUT"!==r&&"TEXTAREA"!==r&&!(null===t||void 0===t?void 0:t.isContentEditable)){var i=(0,h.Li)(e,B);0!==i.length&&(e.preventDefault(),"single"===n?q([i[0]]):W(i))}}},tabIndex:0,style:{minHeight:"".concat(Y?"230px":"300px")},children:[p&&(0,s.jsx)(y.Z,{className:"absolute left-0 top-0 mr-40 flex h-full w-full items-center justify-center rounded-md",sx:{zIndex:3},children:(0,s.jsx)(b.Z,{className:"z-10",disableShrink:!0,sx:{mt:6}})}),(0,s.jsx)("input",(0,o.Z)({},$())),(0,s.jsxs)(y.Z,{sx:{display:"flex",flexDirection:["column","column","row"],alignItems:"center",opacity:J?"0.4":"1",position:J?"absolute":"relative",pointerEvents:J?"none":"auto"},children:[(0,s.jsx)(ie,{width:G,alt:"Upload img",src:"/assets/images/misc/upload.png"}),!Y&&(0,s.jsxs)(y.Z,{sx:{display:"flex",flexDirection:"column",textAlign:["center","center","inherit"]},children:[(0,s.jsx)(oe,{variant:"h5",children:"Drop files or hover for options."}),(0,s.jsxs)(j.Z,{color:"textSecondary",children:["Allowed ",L()]}),(0,s.jsxs)(j.Z,{color:"textSecondary",children:["Max ",z," files and max size of ",R/1e6," MB"]})]})]}
1),(0,s.jsx)(C.Z,{open:Q,mode:n,numOfFiles:z,handleUpload:W,handleSingleUpload:q,setLoading:Z,loading:p,allImages:k,files:c,handleRemoveAllFiles:P,addFiles:f,buttonColor:u,testFileExtension:B}),(0,s.jsx)(re,{mode:n,hasFile:J,files:c,setFiles:d,handleRemoveFile:S,findBySrcAndReplaceFile:F})]}))})}},85634:function(e,n,t){t.d(n,{c:function(){return R},Z:function(){return z}});var r=t(47568),i=t(70655),o=t(85893),a=t(96277),l=t(50505),s=t(57891),u=t(43085),c=t(54225),d=t(70918),f=t(80562),p=t(81719),m=t(18377),g=t(15734),h=t(67294),v=t(85518),x=t(86501),b=t(20986),y=t(94805),Z=t(93129),j=t(96486),w=function(e){var n=e.allImages,t=e.files,r=e.addFiles,i=e.numOfFiles,l=(0,h.useState)(!1),s=l[0],d=l[1],f=(0,j.uniqBy)(n,"content").filter((function(e){return e.type===a.Tv5.Image}));return(0,o.jsx)(y.Z,{isOpen:s,setIsOpen:d,dialogProps:{open:s,onClose:function(){return d(!1)}},button:(0,o.jsx)(R,{variant:"contained",onClick:function(){return d(!0)},children:"Add Image"}),title:"",description:"Add images",children:(0,o.jsx)("div",{className:"m-2 flex flex-wrap gap-4",children:null===f||void 0===f?void 0:f.map((function(e,n){var a,l=(a=e,-1!==t.findIndex((function(e){return e.content===a.content})));return e.content?(0,o.jsx)(Z.Z,{className:"".concat(l?"rounded-2xl border-4 border-green-500":""),src:e.content,alt:e.content,actions:(0,o.jsxs)(c.Z,{className:"h-full w-full opacity-80",variant:"contained",color:"success",onClick:function(){return function(e){var n;(null!==(n=null===t||void 0===t?void 0:t.length)&&void 0!==n?n:1)>=i?(0,u._N)("You can only upload ".concat(i," files."),{duration:2e3}):r([e])}(e)},children:[(0,o.jsx)(b.dt,{}),(0,o.jsxs)("span",{className:"text-xs",children:[" Add ",l&&"again"]})]})},"".concat(e.content,"-").concat(n)):null}))})})},I=t(26042),C=t(69396),k=t(45135),P=(t(38089),t(27222)),S=t.n(P),F=function(e){var n=function(e){var n=function(e,n){var t,r=e.split(",");if(r[0]&&r[1]){for(var i=null===(t=r[0].match(/:(.*?);/))||void 0===t?void 0:t[1],o=atob(r[1]),a=o.length,l=new Uint8Array(a);a>=0;)l[a]=o.charCodeAt(a),a-=1;return new File([l],n,{type:i})}}(e,"image/png");"multiple"===t?r([n]):"single"===t&&i([n]),a()},t=e.mode,r=e.handleUpload,i=e.handleSingleUpload,a=e.closeModal;return(0,o.jsx)(S(),{onTakePhoto:function(e){n(e)},idealFacingMode:P.FACING_MODES.ENVIRONMENT,isSilentMode:!!v.nI})},N=function(e){var n=(0,h.useState)(!1),t=n[0],a=n[1],l=(0,h.useState)(""),s=l[0],u=l[1],c=function(){return a(!1)};return(0,h.useEffect)((function(){function e(){return(e=(0,r.Z)((function(e){var n,t;return(0,i.__generator)(this,(function(r){switch(r.label){case 0:n=null,r.label=1;case 1:return r.trys.push([1,3,,4]),[4,navigator.mediaDevices.getUserMedia(e)];case 2:return n=r.sent(),console.log("stream",n),[3,4];case 3:return t=r.sent(),console.log(t),u("".concat(t)),[3,4];case 4:return[2]}}
1))}))).apply(this,arguments)}t&&function(n){e.apply(this,arguments)}({video:!0})}),[t]),(0,o.jsx)(y.Z,{isOpen:t,setIsOpen:a,dialogProps:{open:t,onClose:function(){return c()}},button:(0,o.jsx)(R,{variant:"contained",onClick:function(){return a(!0)},color:"secondary",children:"Take Photo"}),title:"Webcam Capture",description:"",children:s?(0,o.jsx)(k.Z,{severity:"error",children:s}):(0,o.jsx)(F,(0,C.Z)((0,I.Z)({},e),{closeModal:c}))})},R=(0,p.ZP)(c.Z)((function(){return{minWidth:"9rem"}})),A={open:{x:0,visibility:"visible",display:"flex"},close:{x:"30%",display:"none"}},z=function(e){var n=e.open,t=e.mode,p=e.numOfFiles,y=e.handleUpload,Z=e.handleSingleUpload,j=e.loading,I=void 0!==j&&j,C=e.files,k=e.handleRemoveAllFiles,P=e.addFiles,S=e.allImages,F=e.buttonColor,z=e.testFileExtension,M=(0,h.useState)(!1),_=M[0],T=M[1],O=(0,h.useState)(!1),L=O[0],D=O[1],E=null,U=(0,h.useCallback)((0,r.Z)((function(){var e,n,r,o,a;return(0,i.__generator)(this,(function(i){switch(i.label){case 0:if(_||I)return[2];T(!0),i.label=1;case 1:return i.trys.push([1,,7,8]),("single"===t?(0,s.Q)(C)?0:1:null!==(e=null===C||void 0===C?void 0:C.length)&&void 0!==e?e:0)>=p?((0,u._N)("You can only upload ".concat(p," file(s)."),{duration:2e3}),[2]):[4,(0,l.lZ)(z)];case 2:if(!(n=i.sent()).ok){switch(n.reason){case"unsupported":x.ZP.error(null!==(r=n.detail)&&void 0!==r?r:"Your browser doesn't support clipboard image paste.");break;case"permission_denied":x.ZP.error(null!==(o=n.detail)&&void 0!==o?o:"Clipboard permission denied. Allow access and retry.");break;case"empty":x.ZP.error("Clipboard is empty. Copy an image first.");break;case"cors_blocked":x.ZP.error(null!==(a=n.detail)&&void 0!==a?a:'Couldn\'t load the image URL. In Chrome, use "Copy Image" instead of "Copy Image Address".',{duration:6e3});break;case"no_image":x.ZP.error(n.detail?"Clipboard has no supported image. ".concat(n.detail):"Clipboard doesn't contain a supported image.",{duration:5e3});break;default:x.ZP.error("Cannot read clipboard. Focus this tab, re-copy the image, and try again.")}return[2]}return"single"!==t?[3,4]:[4,Z([n.file])];case 3:return i.sent(),[3,6];case 4:return[4,y([n.file])];case 5:i.sent(),i.label=6;case 6:return[3,8];case 7:return T(!1),[7];case 8:return[2]}}
1))})),[_,I,C,t,p,z,Z,y]),B=(0,h.useMemo)((function(){return!(!S||!S.length)&&S.some((function(e){return e.type===a.Tv5.Image}))}),[S]);return(0,o.jsxs)(m.Z,{className:"h-full gap-y-2",sx:{position:"absolute",display:"flex",flexDirection:"column",alignItems:"end",zIndex:3,top:0,right:0},children:[!L&&(0,o.jsx)(c.Z,{color:F,variant:"contained",onClick:function(){return D(!L)},children:(0,o.jsx)(b.JM,{})}),(0,o.jsx)(g.E.div,{className:"!h-full !w-full",animate:L?"open":"close",initial:"close",variants:A,children:(0,o.jsxs)(d.Z,{className:"h-full w-full p-2",sx:{borderRadius:0},children:[(0,o.jsx)("div",{className:"flex flex-wrap justify-end pb-2",children:(0,o.jsx)(f.Z,{size:"small",color:"secondary",onClick:function(){return D(!L)},children:(0,o.jsx)(b.Tw,{})})}),(0,o.jsxs)(m.Z,{className:"flex flex-col items-center gap-y-2",sx:{zIndex:3,top:0,right:0},children:[B&&(0,o.jsx)(w,{allImages:S,files:C,addFiles:P,numOfFiles:p}),(0,o.jsx)(R,{color:F,variant:"contained",onClick:n,children:"Upload"}),v.nI&&(0,o.jsx)(R,{variant:"outlined",onClick:U,disabled:_||I,children:_?"Pasting\u2026":"Paste Image"}),v.tq?(0,o.jsxs)(o.Fragment,{children:[(0,o.jsx)(R,{variant:"contained",onClick:function(){return null===E||void 0===E?void 0:E.click()},color:"secondary",children:"Take Photo"}),(0,o.jsx)("input",{className:"absolute -z-10 opacity-0",type:"file",ref:function(e){E=e},name:"",multiple:"multiple"===t,onChange:function(e){var n=e.target.files;if(n){var r=Object.values(n);"multiple"===t?y(r):"single"===t&&Z(r)}},capture:!0})]}):(0,o.jsx)(N,{mode:t,handleUpload:y,handleSingleUpload:Z}),(0,o.jsx)(R,{variant:"contained",color:"error",onClick:k,children:"Clear All"})]})]})})]})}},54459:function(e,n,t){t.d(n,{D2:function(){return a},OH:function(){return u},Z:function(){return l},iI:function(){return s}});var r=t(51649),i=t(5434),o=t(79352),a=r.qVU,l=r.CcW,s=o._l2,u=i.IM},19248:function(e,n,t){t.d(n,{IF:function(){return f},KD:function(){return d},OJ:function(){return c},Te:function(){return s},ZK:function(){return l},Z_:function(){return u},_8:function(){return p}});var r=t(45155),i=t(51649),o=t(5434),a=t(79352),l=r.B7O,s=r.cdp,u=a.VhL,c=a.pb1,d=i.do9,f=a.UMo,p=o.uKn},87811:function(e,n,t){t.d(n,{AD:function(){return s},G6:function(){return a},HD:function(){return c},Ms:function(){return o},Ye:function(){return u},qg:function(){return l}});var r=t(80471),i=t(86893),o=i.rH8,a=i.bTu,l=i.YFh,s=i.Tfp,u=r.kEI,c=r.BM_},68690:function(e,n,t){t.d(n,{Ej:function(){return p},wj:function(){return m}});var r=t(47568),i=t(29815),o=t(70655),a=t(85893),l=t(57891),s=t(63015),u=t(11767),c=t(96486),d=t(67294),f=d.createContext(void 0),p=function(e){var n=e.children,t=e.files,p=e.setFiles,m=e.allImages,g=e.ePlatformStoreId,h=(0,d.useState)([]),v=h[0],x=h[1],b=(0,d.useState)(!1),y=b[0],Z=b[1],j=(0,d.useState)(void 0),w=j[0],I=j[1],C=function(e){p((null!==t&&void 0!==t?t:[]).concat(e))},k=function(e){var n=t.filter((function(n,t){return t!==e}));p((0,i.Z)(n))},P=function(){p([]),x([])},S=(0,d.useCallback)((function(e,n){0!==(null===e||void 0===e?void 0:e.length)&&0!==(null===n||void 0===n?void 0:n.length)&&(null===e||void 0===e?void 0:e.length)===(null===n||void 0===n?void 0:n.length)&&p((function(t){return(0,c.isNil)(t)||!t.length?[]:t.map((function(t){var r=e.findIndex((function(e){return e.content===t.content}));return-1!==r?(0,c.isNil)(n[r])?t:n[r]:t}))}))}),[t]),F=function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"content";if(e&&n){var i=t.findIndex((function(n){return(0,c.get)(n,"".concat(r))===e})),o=t.map((function(e,t){return t===i?n:e}));p(o)}},N=function(e){x(e)},R=function(e){x((0,i.Z)(v).concat([e]))},A=function(e){var n=v.filter((function(n,t){return n.content!==e.content}));x((0,i.Z)(n))},z=function(){x([])},M=function(e){return 0!==v.length&&v.some((function(n){return n.content===e.content}))},_=function(){var e=(0,r.Z)((function(){var e;return(0,o.__generator)(this,(function(n){return v.length?(Z(!0),e=v.filter((function(e){return e.originalFile})).map((function(e){e.content;var n=e.originalFile;e.thumbnail,e.type;return n})),S(v,e),Z(!1),[2]):[2]}))}));return function(){return e.apply(this,arguments)}}(),T=function(){var e=(0,r.Z)((function(e,n){var t,r;return(0,o.__generator)(this,(function(i){return e.content,t=e.originalFile,e.thumbnail,e.type,n(!0),r=t&&!(0,l.Q)(t)?[t]:[],S([e],r),n(!1),[2]}))}
1));return function(n,t){return e.apply(this,arguments)}}(),O=(0,d.useMemo)((function(){return!(!(0,c.isArray)(t)||0===t.length||1===t.length)&&0!==t.findIndex((function(e){return e.content===(null===w||void 0===w?void 0:w.content)}))}),[t,w]),L=(0,d.useMemo)((function(){return!(!(0,c.isArray)(t)||0===t.length||1===t.length)&&(null===t||void 0===t?void 0:t.findIndex((function(e){return e.content===(null===w||void 0===w?void 0:w.content)})))!==t.length-1}),[t,w]),D=(0,d.useCallback)((function(e){null===e||void 0===e||e.stopPropagation();var n=null===t||void 0===t?void 0:t.findIndex((function(e){return e.content===(null===w||void 0===w?void 0:w.content)})),r=t[n-1];I(r)}),[t,w]),E=(0,d.useCallback)((function(e){null===e||void 0===e||e.stopPropagation();var n=null===t||void 0===t?void 0:t.findIndex((function(e){return e.content===(null===w||void 0===w?void 0:w.content)})),r=t[n+1];I(r)}),[t,w]),U=(0,s.T)({selector:u.TV}).setIsUploadingState;(0,d.useEffect)((function(){return U(!!y),function(){U(!1)}}),[y,U]);var B=(0,d.useMemo)((function(){return{files:t,setFiles:p,addFiles:C,selectedFiles:v,unselectFile:A,selectFile:R,selectAllFiles:N,checkIfSelected:M,handleRemoveFile:k,handleRemoveAllFiles:P,unselectAllFiles:z,findBySrcAndReplaceFile:F,loading:y,setLoading:Z,allImages:m,ePlatformStoreId:g,getOriginalImages:_,getSingleOriginalImage:T,hasPrevImage:O,hasNextImage:L,onPrevImage:D,onNextImage:E,imageInPreview:w,setImageInPreview:I}}),[t,v,y,m,g,O,L,D,E,w]);return(0,a.jsx)(f.Provider,{value:B,children:n})},m=function(){var e=(0,d.useContext)(f);if(void 0===e)throw new Error("useImageUploader can only be used inside ImageUploaderProvider");return e}},99751:function(e,n,t){t.d(n,{Z:function(){return p}});var r=t(26042),i=t(69396),o=t(85893),a=t(62126),l=t(68690),s=t(67294),u=s.createContext(void 0),c=function(e){var n=e.children,t=e.files,r=e.setFiles,i=e.allImages,a=r,l=(0,s.useState)(!1),c=l[0],d=l[1],f=function(e){a(e)},p=function(){a(null)},m=function(){a(null)},g=function(e,n,t){a(n)},h=(0,s.useMemo)((function(){return{files:t,setFiles:a,addFiles:f,handleRemoveFile:p,handleRemoveAllFiles:m,loading:c,setLoading:d,findBySrcAndReplaceFile:g}}),[t,c,i]);return(0,o.jsx)(u.Provider,{value:h,children:n})},d=t(3334),f=function(e){var n=function(){var e=(0,s.useContext)(u);if(void 0===e)throw new Error("useSingleImageUploader can only be used inside SingleImageUploaderProvider");return e}(),t=n.files,a=n.setFiles,l=n.addFiles,c=n.loading,f=n.setLoading,p=n.allImages,m=n.handleRemoveAllFiles,g=n.handleRemoveFile,h=n.findBySrcAndReplaceFile;return(0,o.jsx)(d.Z,(0,i.Z)((0,r.Z)({mode:"single"},e),{files:t,setFiles:a,addFiles:l,loading:c,setLoading:f,allImages:p,handleRemoveAllFiles:m,handleRemoveFile:g,findBySrcAndReplaceFile:h}))},p=function(e){var n=e.acceptedFileExtensions||{"image/*":[".png",".jpg",".jpeg",".webp"]};e.files,e.setFiles;return(0,o.jsx)(l.Ej,(0,i.Z)((0,r.Z)({},e),{children:(0,o.jsx)(c,(0,i.Z)((0,r.Z)({},e),{children:(0,o.jsx)(a.Z,{children:(0,o.jsx)(f,(0,i.Z)((0,r.Z)({},e),{acceptedFileExtensions:n,numOfFiles:1}))})}))}))}},93129:function(e,n,t){var r=t(85893),i=t(44414),o=t(13264),a=t(18377),l=t(25675),s=t.n(l),u=t(67294),c=(0,o.Z)(s())((function(e){return{borderRadius:e.theme.shape.borderRadius}})),d=(0,o.Z)(a.Z)((function(e){return{borderRadius:e.theme.shape.borderRadius}}));n.Z=function(e){var n=e.src,t=e.alt,o=e.width,l=void 0===o?120:o,s=e.actions,f=e.className,p=void 0===f?"":f,m=e.style,g=e.disableMask,h=void 0!==g&&g,v=(0,u.useState)(!1),x=v[0],b=v[1],y=n,Z=(0,i.R)(n);return(0,i.y)(n)||(y="/assets/images/imageNotFound.png"),(0,r.jsxs)(a.Z,{className:"".concat(p," relative"),component:"div",onMouseOver:function(){h||b(!0)},onMouseOut:function(){h||b(!1)},sx:{width:"120px",height:"120px"},children:[x&&(0,r.jsx)(a.Z,{className:"absolute z-10 flex h-full w-full items-center justify-center rounded-md",sx:{backgroundColor:"rgb(71, 85, 105, 0.6)"},children:s}),Z?(0,r.jsx)(c,{src:y,alt:t,width:l,height:l,style:m}):(0,r.jsx)(d,{src:y,alt:t,width:l,height:l,component:"img",sx:m})]})}},31753:function(e,n,t){t.d(n,{ai:function(){return O},ZP:function(){return D}});var r=t(85893),i=t(20986),o=t(87811),a=t(57891),l=t(54225),s=t(92096),u=t(80562),c=t(13264),d=t(18377),f=t(85518),p=t(89479),m=t(44414),g=t(17575),h=t(9942),v=t(25675),x=t.n(v),b=t(6
17294),y=t(19248),Z=t(30120),j=function(e){var n=(0,b.useState)(!1),t=n[0],i=n[1],o=e.src,a=(e.width,e.alt,e.style,e.className),l=e.closeTooltip,s=e.openPreview,c=o;return(0,m.y)(o)||(c="/assets/images/imageNotFound.png"),(0,r.jsxs)(Z.Z,{className:"".concat(a," relative min-w-fit max-w-fit"),onMouseOver:function(){return i(!0)},onMouseLeave:function(){return i(!1)},children:[t&&(0,r.jsx)(Z.Z,{className:"absolute z-10 flex h-full w-full items-center justify-center rounded-md",sx:{backgroundColor:"rgb(71, 85, 105, 0.6)"},children:(0,r.jsxs)(u.Z,{className:"h-full w-full",disableRipple:!0,size:"small",onClick:function(e){s&&s(),l&&l(),e.stopPropagation()},children:[(0,r.jsx)(y.Z_,{className:"text-gray-300"}),(0,r.jsx)("span",{className:"text-gray-300",children:"Preview"})]})}),(0,r.jsx)(Z.Z,{component:"img",alt:"",style:{maxHeight:"25vh",minHeight:"15vh",maxWidth:"25vw",minWidth:"8vw"},id:"hover-image-rounded",className:"rounded-lg",src:c})]})},w=t(96486),I=(0,b.createContext)(void 0),C=function(e){var n=e.children,t=e.imgArray,i=e.imageSize,o=e.disablePreview,a=(e.futureProp,(0,b.useState)(!1)),l=a[0],s=a[1],u=(0,b.useState)(void 0),c=u[0],d=u[1],f=(0,b.useState)(t),p=f[0],m=f[1],g=(0,b.useState)(null!==i&&void 0!==i?i:54),h=g[0],v=g[1],x=(0,b.useMemo)((function(){return 0!==p.length&&1!==p.length&&0!==p.findIndex((function(e){return e.content===(null===c||void 0===c?void 0:c.content)}))}),[p,c]),y=(0,b.useMemo)((function(){return 0!==p.length&&1!==p.length&&p.findIndex((function(e){return e.content===(null===c||void 0===c?void 0:c.content)}))!==p.length-1}),[p,c]),Z=(0,b.useCallback)((function(e){null===e||void 0===e||e.stopPropagation();var n=p.findIndex((function(e){return e.content===(null===c||void 0===c?void 0:c.content)})),t=p[n-1];d(t)}),[p,c]),j=(0,b.useCallback)((function(e){null===e||void 0===e||e.stopPropagation();var n=p.findIndex((function(e){return e.content===(null===c||void 0===c?void 0:c.content)})),t=p[n+1];d(t)}),[p,c]),C=(0,b.useCallback)((function(e){o||s(e)}),[o]);(0,b.useEffect)((function(){(0,w.isEqual)(p,t)||m(t)}),[t]);var k=(0,b.useMemo)((function(){return{images:p,imageInPreview:c,setImageInPreview:d,previewOpen:l,handlePreview:C,setImages:m,hasPrevImage:x,hasNextImage:y,onPrevImage:Z,onNextImage:j,imageSize:h,setImageSize:v,disablePreview:o}}),[p,c,l,x,y,Z,j,h,C,o]);return(0,r.jsx)(I.Provider,{value:k,children:n})},k=function(){var e=(0,b.useContext)(I);if(!e)throw new Error("No Context.Provider found when calling useContext.");return e},P=(0,c.Z)(d.Z)((function(e){return{borderRadius:e.theme.shape.borderRadius,objectFit:"contain",border:"1px solid rgb(102 108 255)"}})),S=(0,c.Z)(x())((function(e){var n=e.theme;return{borderRadius:n.shape.borderRadius,objectFit:"contain",backgroundColor:n.palette.background.paper,border:"1px solid rgb(102 108 255) !important"}})),F=function(e){var n,t=k(),i=t.handlePreview,o=t.setImageInPreview,a=t.imageSize,l=t.disablePreview,s=e.index,u=e.img,c=e.alt,f=void 0===c?"":c,v=(0,b.useState)(!1),x=v[0],y=v[1],Z=function(){return y(!1)},w=null!==(n=null===u||void 0===u?void 0:u.thumbnail)&&void 0!==n?n:null===u||void 0===u?void 0:u.content,I=null===u||void 0===u?void 0:u.content,C=(0,m.R)(w);return(0,m.y)(w)||(w="/assets/images/imageNotFound.png"),(0,r.jsx)(g.Z,{open:x,onOpen:function(){l||y(!0)},onClose:function(){return Z()},componentsProps:{tooltip:{sx:{padding:"0px"}}},onClick:p.UW,TransitionComponent:h.Z,enterDelay:0,leaveDelay:.05,placement:"top",color:"transparent",title:(0,r.jsx)(j,{alt:"",style:{maxHeight:"25vh",minHeight:"15vh",maxWidth:"25vw",minWidth:"8vw"},className:"rounded-lg",src:I,closeTooltip:Z,openPreview:function(){o(u),i(!0)}}),children:C?(0,r.jsx)(d.Z,{className:"flex items-center",children:(0,r.jsx)(S,{src:w,alt:f,height:a,width:a})}):(0,r.jsx)(P,{component:"img",src:w,alt:f,sx:{height:a,width:a}})},s)},N=t(23926),R=(0,c.Z)(d.Z)((function(e){return{marginRight:"0.25rem",borderRadius:e.theme.shape.borderRadius,objectFit:"contain",border:"1px solid rgb(102 108 255)"}})),A=(0,c.Z)(x())((function(e){var n=e.theme;return{borderRadius:n.shape.borderRadius,objectFit:"contain",backgroundColor:n.palette.background.paper,border:"1px solid rgb(102 108 255) !important"}})),z=function(e){var n,t=k(),i=t.handlePreview,o=t.setImageInPreview,a=t.imageSize,l=e.index,s=e.img,u=e.alt,c=void 0===u?"":u,f=(0,b.useState)(!1),p=f[0],v=f[1],x=function(){return v(!1)},y=null!==(n=null===s||void 0===s?void 0:s.thumbnail)&&void 0!==n?n:null===s||void 0===s?void 0:s.content,Z=null===s||void 0===s?void 0:s.content,w=(0,m.R)(y);return(0,m.y)(y)||(y="/assets/images/imageNotFound.png"),(0,r.jsx)(N.Z,{onClickAway:x,children:(0,r.jsx)("div",{children:(0,r.jsx)(g.Z,{PopperProps:{disablePortal:!0},disableFocusListener:!0,disableHoverListener:!0,disableTouchListener:!0,open:p,onClick:function(){return v(!0)},onClose:function(){return x()},componentsProps:{tooltip:{sx:{padding:"0px"}}},TransitionComponent:h.Z,placement:"top",color:"transparent",title:(0,r.jsx)(j,{alt:"",style:{maxHeight:"25vh",minHeight:"15vh",maxWidth:"25vw",minWidth:"8vw"},className:"rounded-lg",src:Z,closeTooltip:x,openPreview:function(){o(s),i(!0)}}),children:w?(0,r.jsx)(d.Z,{className:"mr-3 flex items-center",children:(0,r.jsx)(A,{src:y,alt:c,height:a,width:a})}):(0,r.jsx)(R,{component:"img",src:y,alt:c,sx:{height:a,width:a,mr:"0.75rem"}})},l)})})},M=(0,c.Z)(d.Z)((function(e){e.theme;return{position:"fixed",zIndex:2,width:"100%",backgroundColor:"rgba(0, 0, 0, 0.5)",display:"flex",justifyContent:"end",alignItems:"end",flexDirection:"column",padding:"0.25rem"}})),_=(0,c.Z)(d.Z)((function(e){e.theme;return{position:"fixed",zIndex:1,width:"3rem",height:"100%",display:"flex",justifyContent:"center",alignItems:"center",flexDirection:"column",padding:"0.25rem"}})),T=(0,c.Z)(l.Z)((function(e){var n=e.theme,t=e.color;return{backgroundColor:n.palette["".concat(t)].main,color:n.palette["".concat(t)].contrastText,"&:hover":{backgroundColor:"".concat(n.palette["".concat(t)].dark," !important"),color:"".concat(n.palette["".concat(t)].light," !important")}}})),O=function(e){var n=e.previewOpen,t=e.handleClose,a=e.imageInPreview,l=e.onPrevImage,c=e.onNextImage,f=e.hasPrevImage,p=e.hasNextImage;return(0,r.jsx)(s.Z,{open:n,onClose:t,"aria-labelledby":"modal-modal-title","aria-describedby":"modal-modal-description",sx:{zIndex:1501},children:(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(M,{children:(0,r.jsx)(u.Z,{onClick:t,children:(0,r.jsx)(i.Tw,{className:"text-gray-300"})})}),(0,r.jsx)(_,{sx:{left:0},children:(0,r.jsx)(T,{color:"secondary",onClick:l,disabled:!f,children:(0,r.jsx)(o.qg,{size:25})})}),(0,r.jsx)(_,{sx:{right:0},children:(0,r.jsx)(T,{color:"secondary",onClick:c,disabled:!p,children:(0,r.jsx)(o.AD,{size:25})})}),(0,r.jsx)(d.Z,{className:"flex h-full flex-col items-center justify-center",onClick:t,children:(0,r.jsx)("img",{src:null===a||void 0===a?void 0:a.content,alt:"expanded-preview",style:{maxHeight:"85%",maxWidth:"90%"},onClick:function(e){return e.stopPropagation()}})})]})})},L=function(e){var n=e.className,t=k(),i=t.images,o=t.previewOpen,l=t.handlePreview,s=t.imageInPreview,u=t.hasPrevImage,c=t.hasNextImage,d=t.onNextImage,p=t.onPrevImage,m=f.nI?F:z;return(0,r.jsxs)("div",{id:"hover-preview",className:"flex flex-wrap gap-1 ".concat(n),children:[(0,r.jsx)(O,{previewOpen:o,handleClose:function(e){l(!1),e&&!(0,a.Q)(e)&&(null===e||void 0===e||e.stopPropagation())},imageInPreview:s,onNextImage:d,onPrevImage:p,hasPrevImage:u,hasNextImage:c}),null===i||void 0===i?void 0:i.map((function(e,n){return(0,r.jsx)(m,{index:n,img:e,alt:"Array ".concat(n)},n)}))]})},D=function(e){var n=e.className,t=void 0===n?"":n,i=e.imgArray,o=e.numOfImages,a=void 0===o?3:o,l=e.imageSize,s=e.disablePreview,u=void 0!==s&&s;if(!i||0===i.length)return null;var c=i.slice(0,a);return(0,r.jsx)(C,{imgArray:c,imageSize:l,disablePreview:u,children:(0,r.jsx)(L,{className:t})})}},13267:function(e,n,t){t.d(n,{$i:function(){return h},Af:function(){return I},Ai:function(){return b},Aj:function(){return w},As:function(){return g},BQ:function(){return d},CN:function(){return C},D0:function(){return v},Hj:function(){return j},OF:function(){return m},Po:function(){return s},R3:function(){return c},kJ:function(){return p},kb:function(){return y},m5:function(){return f},oJ:function(){return u},oi:function(){return Z},u5:function(){return x}});var r,i=t(14924),o=t(96277),a=t(19223),l=t(74231),s=/((https?):\/\/)?(www.)?[a-z0-9]+(\.[a-z]{2,}){1,3}(#?\/?[a-zA-Z0-9#]+)*\/?(\?[a-zA-Z0-9-_]+=[a-zA-Z0-9-%]+&?)?$/,u=/^[a-zA-Z0-9]+$/i,c=/^[a-zA-Z]+$/i,d=/^[0-9]+$/i,f=/^[a-z0-9]+$/g,p=/^(?=.*[a-z])(?=.*[A-Z])(?=.*\d)(?=.*[^\da-zA-Z]).{8,}$/,m=/^(?!.*(.)\1\1.*).*$/,g=/\d/g,h="Length (cm)",v="Width (cm)",x="Height (cm)",b="Weight (kg)",y={address1:"",address2:"",city:"",country:"",postcode:"",state:""},Z=(r={},(0,i.Z)(r,o.Au2.Deposit,o.Au2.Deposit),(0,i.Z)(r,o.Au2.Balance,o.Au2.Balance),r),j=l.Ry().shape({amount:l.Rx(),currency:l.Z_()}).nullable(),w=l.Ry().shape({companyName:l.Z_().nullable(),address1:l.Z_().required("Address is required"),address2:l.Z_().nullable(),city:l.Z_().required("City is required"),
1country:l.Z_().required("Country is required"),postcode:l.Z_().required("Postcode is required"),state:l.Z_().required("State is required")}),I=l.Ry().shape({address1:l.Z_().nullable(),address2:l.Z_().nullable(),city:l.Z_().nullable(),country:l.Z_().nullable(),postcode:l.Z_().nullable(),state:l.Z_().nullable(),companyName:l.Z_().nullable()}).nullable(),C=l.Ry().shape({length:(0,a.r)().required("Length is required"),width:(0,a.r)().required("Width is required"),height:(0,a.r)().required("Height is required"),weight:(0,a.r)().required("Weight is required")})},16563:function(e,n,t){t.d(n,{A:function(){return d},I:function(){return p}});var r,i,o=t(47568),a=t(70655),l=t(54692),s=t(96277),u=t(43085),c=t(96486),d=(null!==(i=null===(r="https://ecom-backend-dev-v2-477837510626.asia-southeast1.run.app/graphql")?void 0:r.replace("/graphql",""))&&void 0!==i?i:"").replace(/\/+$/,""),f="".concat(d,"/upload/mulFiles"),p=function(){var e=(0,o.Z)((function(e,n){var t,r;return(0,a.__generator)(this,(function(i){return e?(t=new FormData,e.forEach((function(e,r){t.append(n,e,e.name)})),r={method:"POST",body:t,headers:{Authorization:(0,l.LP)()}},[2,fetch(f,r).then((function(e){return e.json()})).then((function(e){var n;if(!Array.isArray(null===e||void 0===e?void 0:e.data))throw new Error(null!==(n=null===e||void 0===e?void 0:e.message)&&void 0!==n?n:"Upload failed");return e.data.map((function(e){var n=(0,c.get)(e,"type");if(n===s.Tv5.Image){var t=e;return{thumbnail:t.thumbnail,content:t.fullSize,type:t.type}}if(n===s.Tv5.Document){var r=e;return{content:r.content,type:r.type}}return{}}))})).catch((function(e){(0,u._N)("".concat(e))}))]):[2,void 0]}))}));return function(n,t){return e.apply(this,arguments)}}()},9887:function(e,n,t){t.d(n,{CG:function(){return o},TL:function(){return i}});t(67294);var r=t(9473),i=function(){return(0,r.I0)()},o=r.v9},63015:function(e,n,t){t.d(n,{T:function(){return a}});var r=t(9887),i=t(67294),o=t(11767),a=function(e){var n=e.selector,t=(0,r.TL)(),a=(0,r.CG)(n),l=(0,i.useCallback)((function(e){t((0,o.kP)(e))}),[t]);return(0,i.useEffect)((function(){return function(){l(!1)}}),[l]),{isUploadingState:a,setIsUploadingState:l}}},50505:function(e,n,t){t.d(n,{Li:function(){return m},lZ:function(){return p}});var r=t(47568),i=t(82670),o=t(70655),a=["image/png","image/jpeg","image/jpg","image/gif","image/webp","image/bmp"],l=function(e,n){var t=function(e){var n,t,r,i=null!==(r=(null!==(t=null===(n=e.split(";")[0])||void 0===n?void 0:n.trim().toLowerCase())&&void 0!==t?t:"image/png").split("/")[1])&&void 0!==r?r:"png";return"jpeg"===i?"jpg":i}(n);return new File([e],"clipboard-".concat(Date.now(),".").concat(t),{type:n})},s=function(e,n){var t=/^data:([a-z0-9+.\-/]+)((?:;[^,]*)*),(.*)$/i.exec(e),r=null===t||void 0===t?void 0:t[1];if(!r)return null;var i,o=r.toLowerCase();if(!a.includes(o))return null;if(!n(o))return null;var s,u=null!==(i=null===t||void 0===t?void 0:t[2])&&void 0!==i?i:"",c=null!==(s=null===t||void 0===t?void 0:t[3])&&void 0!==s?s:"",d=/(?:^|;)base64(?:;|$)/i.test(u);try{var f;if(d){var p=atob(c);f=new Uint8Array(p.length);for(var m=0;m<p.length;m+=1)f[m]=p.charCodeAt(m)}else f=(new TextEncoder).encode(decodeURIComponent(c));return l(new Blob([f],{type:o}),o)}catch(g){return console.warn("[readImageFromClipboard] data URL decode failed",g),null}},u=function(e){if(!e)return{kind:"none"};var n=e.trim();if(!n)return{kind:"none"};if(function(e){return/^data:image\/[a-z0-9+.-]+[;,]/i.test(e)}(n))return{kind:"data",value:n};if(function(e){return/^https?:\/\/\S+$/i.test(e)}(n)||function(e){return/^blob:https?:\/\/\S+$/i.test(e)}(n))return{kind:"url",value:n};if(function(e){return/^(\/\/|\/|\.{1,2}\/)[^\s]+\.(png|jpe?g|gif|webp|bmp|svg)(\?\S*)?$/i.test(e)}(n)){var t=function(e){try{return new URL(e,window.location.origin).toString()}catch(n){return null}}(n);return t?{kind:"url",value:t}:{kind:"none"}}return{kind:"none"}},c=function(){var e=(0,r.Z)((function(e,n){var t,r;return(0,o.__generator)(this,(function(i){switch(i.label){case 0:return i.trys.push([0,2,,3]),[4,e.getType(n)];case 1:return t=i.sent(),[2,l(t,n)];case 2:return r=i.sent(),console.warn("[readImageFromClipboard] getType failed",n,r),[2,null];case 3:return[2]}}
1))}));return function(n,t){return e.apply(this,arguments)}}(),d=function(){var e=(0,r.Z)((function(e,n){var t;return(0,o.__generator)(this,(function(r){switch(r.label){case 0:if(!e.types.includes(n))return[2,null];r.label=1;case 1:return r.trys.push([1,4,,5]),[4,e.getType(n)];case 2:return[4,r.sent().text()];case 3:return[2,r.sent().trim()];case 4:return t=r.sent(),console.warn("[readImageFromClipboard] text read failed",n,t),[2,null];case 5:return[2]}}))}));return function(n,t){return e.apply(this,arguments)}}(),f=function(){var e=(0,r.Z)((function(e,n){var t,r,a,s,u,c,d,f;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:return o.trys.push([0,3,,4]),[4,fetch(e,{credentials:"omit"})];case 1:return(r=o.sent()).ok?(s=(null!==(a=r.headers.get("content-type"))&&void 0!==a?a:"").toLowerCase(),(c=null!==(u=null===(t=s.split(";")[0])||void 0===t?void 0:t.trim())&&void 0!==u?u:"").startsWith("image/")&&n(c)?[4,r.blob()]:[2,{kind:"not_image"}]):[2,{kind:"error",err:new Error("HTTP ".concat(r.status))}];case 2:return d=o.sent(),[2,{kind:"ok",file:l(d,c||d.type||"image/png")}];case 3:return f=o.sent(),[2,{kind:(0,i.Z)(f,TypeError)?"cors":"error",err:f}];case 4:return[2]}}
1))}));return function(n,t){return e.apply(this,arguments)}}(),p=function(){var e=(0,r.Z)((function(e){var n,t,r,l,p,m,g,h,v,x,b,y,Z,j,w,I,C,k,P,S,F,N,R,A,z,M,_,T,O,L,D,E,U,B,W,q,V,H;return(0,o.__generator)(this,(function(o){switch(o.label){case 0:if("undefined"===typeof navigator||!(null===(n=navigator.clipboard)||void 0===n?void 0:n.read))return[2,{ok:!1,reason:"unsupported",detail:"Your browser doesn't support clipboard image paste. Use Upload or drag & drop."}];o.label=1;case 1:return o.trys.push([1,3,,4]),[4,navigator.clipboard.read()];case 2:return t=o.sent(),[3,4];case 3:return r=o.sent(),l=(0,i.Z)(r,Error)?r.name:"",p=(0,i.Z)(r,Error)?r.message:String(r),"NotAllowedError"===l?[2,{ok:!1,reason:"permission_denied",detail:"Clipboard permission denied. Allow clipboard access in the site settings and try again."}]:[2,{ok:!1,reason:"read_failed",detail:p}];case 4:if(!t||0===t.length)return[2,{ok:!1,reason:"empty"}];m=!0,g=!1,h=void 0,o.label=5;case 5:o.trys.push([5,10,11,12]),v=t[Symbol.iterator](),o.label=6;case 6:return(m=(x=v.next()).done)?[3,9]:(b=x.value,y=function(e,n){return e.find((function(e){return e.startsWith("image/")&&a.includes(e)&&n(e)}))}(b.types,e),y?[4,c(b,y)]:[3,8]);case 7:if(Z=o.sent())return[2,{ok:!0,file:Z}];o.label=8;case 8:return m=!0,[3,6];case 9:return[3,12];case 10:return L=o.sent(),g=!0,h=L,[3,12];case 11:try{m||null==v.return||v.return()}finally{if(g)throw h}
1return[7];case 12:j=!1,w=!1,I=null,C=!0,k=!1,P=void 0,o.label=13;case 13:o.trys.push([13,21,22,23]),S=t[Symbol.iterator](),o.label=14;case 14:return(C=(F=S.next()).done)?[3,20]:(N=F.value,[4,d(N,"text/html")]);case 15:return R=o.sent(),A=R?function(e){if("undefined"===typeof DOMParser){var n,t=e.match(/<img[^>]*\ssrc=["']([^"']+)["']/i);return null!==(n=null===t||void 0===t?void 0:t[1])&&void 0!==n?n:null}try{var r,i=null===(r=(new DOMParser).parseFromString(e,"text/html").querySelector("img[src]"))||void 0===r?void 0:r.getAttribute("src");return null!==i&&void 0!==i?i:null}catch(o){return null}}(R):null,z=u(A),"none"!==(M=z).kind?[3,17]:[4,d(N,"text/plain")];case 16:(_=o.sent())&&null===I&&(I=_),M=u(_),o.label=17;case 17:return"none"===M.kind?[3,19]:(j=!0,"data"===M.kind?(T=s(M.value,e))?[2,{ok:!0,file:T}]:[3,19]:[4,f(M.value,e)]);case 18:if("ok"===(O=o.sent()).kind)return[2,{ok:!0,file:O.file}];"cors"===O.kind&&(w=!0),o.label=19;case 19:return C=!0,[3,14];case 20:return[3,23];case 21:return L=o.sent(),k=!0,P=L,[3,23];case 22:try{C||null==S.return||S.return()}finally{if(k)throw P}return[7];case 23:return o.trys.push([23,28,,29]),navigator.clipboard.readText?[4,navigator.clipboard.readText()]:[3,27];case 24:return(D=o.sent().trim())&&null===I&&(I=D),"none"===(E=u(D)).kind?[3,27]:(j=!0,"data"!==E.kind?[3,25]:(U=s(E.value,e))?[2,{ok:!0,file:U}]:[3,27]);case 25:return[4,f(E.value,e)];case 26:if("ok"===(B=o.sent()).kind)return[2,{ok:!0,file:B.file}];"cors"===B.kind&&(w=!0),o.label=27;case 27:return[3,29];case 28:return W=o.sent(),console.warn("[readImageFromClipboard] readText fallback failed",W),[3,29];case 29:return w?[2,{ok:!1,reason:"cors_blocked",detail:'Couldn\'t load the image URL (blocked by CORS). In Chrome, right-click the image and choose "Copy Image" (not "Copy Image Address"), then paste again.'}]:j?[2,{ok:!1,reason:"no_image",detail:"The pasted URL didn't return a supported image."}]:(q=t.flatMap((function(e){return e.types})).filter(Boolean).join(", "),I&&(V=I.startsWith("data:")?"data:\u2026[".concat(I.length," chars, prefix=").concat(I.slice(5,25),"]"):I.slice(0,80),console.info("[readImageFromClipboard] unresolved text/plain \u2014 preview:",V,{length:I.length,types:q})),I&&(($=I).length>0&&$.length<260&&!/[\r\n]/.test($)&&!/^[a-z]+:/i.test($)&&/\.(png|jpe?g|gif|webp|bmp)$/i.test($))?(H=I.length>60?"".concat(I.slice(0,60),"\u2026"):I,[2,{ok:!1,reason:"no_image",detail:'Looks like you copied the file "'.concat(H,"\" from Finder/Desktop \u2014 browsers can't read file contents from that. Click on the upload area and press \u2318V (or Ctrl+V), or drag the file onto it.")}]):[2,{ok:!1,reason:"no_image",detail:q?"Found: ".concat(q,'. Tip: in Chrome, right-click the image and choose "Copy Image".'):void 0}])}var $}))}));return function(n){return e.apply(this,arguments)}}(),m=function(e,n){var t=e.clipboardData;if(!t)return[];var r=[];if(t.items&&t.items.length>0)for(var i=0;i<t.items.length;i+=1){var o=t.items[i];if(o&&"file"===o.kind){var a=o.getAsFile();a&&a.type.startsWith("image/")&&n(a.type)&&r.push(a)}}if(0===r.length&&t.files&&t.files.length>0)for(var l=0;l<t.files.length;l+=1){var s=t.files.item(l);s&&s.type.startsWith("image/")&&n(s.type)&&r.push(s)}return r}},57891:function(e,n,t){t.d(n,{Q:function(){return r}});var r=function(e){var n=!0;return!e||(Object.keys(e).forEach((function(t){var r=e[t];void 0!==r&&("number"===typeof r?Number.isNaN(r)||(n=!1):null!==r&&(n=!1))})),n)}},19223:function(e,n,t){t.d(n,{r:function(){return o}});var r=t(96486),i=t(74231),o=function(){return i.Rx().nullable().transform((function(e,n){return""===n||(0,r.isNil)(n)?null:e}))}}}]);

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.