try{let e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},t=(new e.Error).stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="7baba100-1d9a-4add-873a-287e98091d48",e._sentryDebugIdIdentifier="sentry-dbid-7baba100-1d9a-4add-873a-287e98091d48")}catch(e){}(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9210],{21292:(e,t,a)=>{"use strict";a.d(t,{I:()=>r});var l=a(72797),i=a(12490);let r=()=>{let e=(0,l.Ym)();return{isRtl:(0,i.H)(e),locale:e}}},29982:(e,t,a)=>{"use strict";a.d(t,{XM:()=>i.X,cn:()=>l.cn});var l=a(70263),i=a(56189);a(12490),a(95376),a(33635)},56189:(e,t,a)=>{"use strict";a.d(t,{X:()=>i});var l=a(83007);function i(e){var t;let a=new Set,i=e.filter(e=>{var t;let l=null==(t=e.url)?void 0:t.split("/").pop();return!a.has("".concat(l,"-").concat(e.value))&&(a.add("".concat(l,"-").concat(e.value)),!0)}),[r,s]=null!=(t=null==i?void 0:i.reduce((e,t)=>(e[+!t.url].push(t),e),[[],[]]))?t:[[],[]],n=new Set(r.map(e=>e.value));return{withLinks:Object.values(r.reduce((e,t)=>{let a=t.value;return e[a]||(e[a]=[]),e[a].push(t),e},{})).flatMap(e=>{if(1===e.length)return e;{let t=e.filter(e=>{var t;let a=null==(t=e.url)?void 0:t.split("/").pop();return a&&/\D/.test(a)});if(t.length>0)return t;{let t=[l.x.peopleDataLabs,l.x.nubela,l.x.osintIndustries];return[[...e].sort((e,a)=>{let l=t.indexOf(e.provider),i=t.indexOf(a.provider);return -1===l&&-1===i?0:-1===l?1:-1===i?-1:l-i})[0]]}}}),withoutLinks:s.filter(e=>!n.has(e.value))}}},58310:()=>{},83007:(e,t,a)=>{"use strict";a.d(t,{x:()=>l});let l={nubela:"Nubela",peopleDataLabs:"PeopleDataLabs",leakcheck:"LeakCheck",osintIndustries:"Osint",pipl:"Pipl",linkedin:"Linkedin",snusbase:"Snusbase"}},88357:(e,t,a)=>{"use strict";a.d(t,{ImageInput:()=>z});var l=a(95155),i=a(17652),r=a(55028),s=a(12115),n=a(55702),o=a(1921),c=a(18850),d=a(73403),h=a(14464),u=a(1493),m=a(77347),g=a(42286),p=a(11314),x=a(22100),f=a(21292),w=a(56971),v=a(70263),j=a(60165),b=a(45e3),y=a(15752),k=a(18762),I=a(63367),N=a(4364),S=a.n(N);let _=e=>{let{onTakePhotoAnimationDone:t}=e,a=(0,i.c3)("Search.step-1");return(0,l.jsxs)("div",{children:[(0,l.jsx)("div",{className:"mb-4 px-4 text-center font-semibold",children:a("take-photo")}),(0,l.jsx)(S(),{idealFacingMode:N.FACING_MODES.USER,isDisplayStartCameraError:!1,isSilentMode:!0,onTakePhotoAnimationDone:t})]})};async function F(e){if(!e)throw Error("No file provided");let t=new FormData;t.append("file",e,e.name);let a=await fetch("/api/images",{method:"POST",body:t});if(!a.ok){let e=await a.json();throw console.error("Upload failed:",e),e}let{faces:l}=await a.json();if(0===l.length)throw Error("NO_FACES_FOUND");return l}var E=a(41046),D=a(83580),C=a(1567),P=a(53071);let L=e=>{let{className:t}=e;return(0,l.jsx)("svg",{className:t,fill:"currentColor",tabIndex:-1,viewBox:"0 0 24 24",xmlns:"http://www.w3.org/2000/svg",children:(0,l.jsxs)("g",{children:[(0,l.jsx)("path",{d:"M12 9a3.75 3.75 0 1 0 0 7.5A3.75 3.75 0 0 0 12 9"}),(0,l.jsx)("path",{clipRule:"evenodd",d:"M9.344 3.071a50 50 0 0 1 5.312 0c.967.052 1.83.585 2.332 1.39l.821 1.317c.24.383.645.643 1.11.71q.579.081 1.152.177c1.432.239 2.429 1.493 2.429 2.909V18a3 3 0 0 1-3 3h-15a3 3 0 0 1-3-3V9.574c0-1.416.997-2.67 2.429-2.909q.573-.096 1.151-.178a1.56 1.56 0 0 0 1.11-.71l.822-1.315a2.94 2.94 0 0 1 2.332-1.39M6.75 12.75a5.25 5.25 0 1 1 10.5 0a5.25 5.25 0 0 1-10.5 0m12-1.5a.75.75 0 1 0 0-1.5a.75.75 0 0 0 0 1.5",fillRule:"evenodd"})]})})},R=e=>{let{isDeepSearch:t,setShowCamera:a,handleNextStep:r,setError:n,isLoading:o,isProcessing:c,isFaceDetected:d=!1}=e,h=(0,i.c3)("Search.step-1"),u=(0,i.c3)("Report"),g=(0,w.a8)(),x=(0,s.useCallback)(async(e,a,l)=>{let i="type"in l&&"drop"===l.type?"draganddrop":"upload",s=e[0];if(s){let e=new FileReader;e.onload=function(e){let a=new Image;a.src=e.target.result,a.onload=function(){let e=+(s.size/1024).toFixed(2),l=s.name.split(".").pop().toLowerCase()||s.type||"N/A";j.j.track(p.q.FaceReconitionUploadStarted,{type:i,format:l,width:a.width,height:a.height,weight:e,...t?{is_deep_search:!0}:{}})}},e.readAsDataURL(s),await r(s)}},[r]),f=(0,s.useCallback)(async(e,t)=>{"file-too-large"===e[0].errors[0].code||"file-invalid-type"===e[0].errors[0].code?null==n||n(e[0].errors[0].code):e[0].errors[0].message&&(null==n||n(e[0].errors[0].message))},[]),{getRootProps:b,getInputProps:y}=(0,E.VB)({onDrop:x,onDropRejected:f,maxFiles:1,multiple:!1,disabled:c,maxSize:0xa00000,accept:{"image/*":[".jpeg",".png",".jpg",".webp",".tiff"]}});return(0,l.jsx)("div",{className:"relative",children:(0,l.jsx)("div",{className:(0,v.cn)("lg:min-h-auto z-10 flex h-fit flex-col gap-4 lg:absolute lg:-left-8 lg:-right-0 lg:-top-12 lg:mt-12 lg:block lg:w-[111%] lg:!border-0 lg:pl-8 lg:!outline-none",{"lg:w-[calc(100%+2rem)] lg:pt-12":"/search/image/report"===g,"lg:left-0 lg:mt-12 lg:min-h-0 lg:w-full lg:px-0 lg:!pt-0":t}),...b(),children:(0,l.jsxs)("div",{className:(0,v.cn)("flex cursor-pointer flex-row items-center justify-between gap-0 rounded-medium border-1 border-dashed bg-default-100 duration-150 transition-background",{"h-14":t}),children:[!t&&(0,l.jsx)(D.T,{isIconOnly:!0,className:"min-w-0 rounded-r-none bg-transparent",radius:"sm",size:"lg",onPress:()=>{a(!0)},children:(0,l.jsx)(L,{className:"h-7 w-7 shrink-0 text-[#0066CC]"})}),!t&&(0,l.jsx)(C.y,{className:"h-[52px] bg-gray-300",orientation:"vertical"}),t?(0,l.jsx)("p",{className:"mr-auto pl-3 text-sm subpixel-antialiased opacity-75",children:h("click-to-upload-photo-mobile")}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsx)("p",{className:"mr-auto pl-3 text-sm subpixel-antialiased opacity-75 sm:hidden",children:h("click-to-upload-photo-mobile")}),(0,l.jsx)("p",{className:"mr-auto hidden pl-3 text-sm subpixel-antialiased opacity-75 sm:block",children:h("click-to-upload-photo-desktop")})]}),(0,l.jsx)("input",{...y()}),(0,l.jsx)("div",{className:(0,v.cn)("mr-0.5 flex h-auto max-h-[44px] min-h-12 w-fit flex-row-reverse items-center gap-2 rounded-small bg-[#0066CC] p-3 text-base text-white duration-150 transition-background hover:bg-opacity-80",{"min-w-12 justify-center":t}),children:d?(0,l.jsx)("svg",{"aria-hidden":"true",className:"iconify iconify--lucide",height:"20",role:"img",viewBox:"0 0 24 24",width:"20",xmlns:"http://www.w3.org/2000/svg",xmlnsXlink:"http://www.w3.org/1999/xlink",children:(0,l.jsx)("path",{d:"M20 6L9 17l-5-5",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"2"})}):t?c?(0,l.jsx)(P.o,{color:"white",size:"sm"}):(0,l.jsx)(m.Icon,{height:"20",icon:"lucide:folder-open",width:"20"}):(0,l.jsxs)(l.Fragment,{children:[o&&(0,l.jsx)(P.o,{color:"white",size:"sm"}),(0,l.jsx)("span",{children:o?u("loading"):h("browse-files")})]})})]})})})};var U=a(36545),A=a(66766),O=a(37579),T=a(73706);let M=[127,34,139,11,0,37,232,231,120,72,37,39,128,121,47,232,121,128,104,69,67,175,171,148,157,154,155,118,50,101,73,39,40,9,151,108,48,115,131,194,204,211,74,40,185,80,42,183,40,92,186,230,229,118,202,212,214,83,18,17,76,61,146,160,29,30,56,157,173,106,204,194,135,214,192,203,165,98,21,71,68,51,45,4,144,24,23,77,146,91,205,50,187,201,200,18,91,106,182,90,91,181,85,84,17,206,203,36,148,171,140,92,40,39,193,189,244,159,158,28,247,246,161,236,3,196,54,68,104,193,168,8,117,228,31,189,193,55,98,97,99,126,47,100,166,79,218,155,154,26,209,49,131,135,136,150,47,126,217,223,52,53,45,51,134,211,170,140,67,69,108,43,106,91,230,119,120,226,130,247,63,53,52,238,20,242,46,70,156,78,62,96,46,53,63,143,34,227,173,155,133,123,117,111,44,125,19,236,134,51,216,206,205,154,153,22,39,37,167,200,201,208,36,142,100,57,212,202,20,60,99,28,158,157,35,226,113,160,159,27,204,202,210,113,225,46,43,202,204,62,76,77,137,123,116,41,38,72,203,129,142,64,98,240,49,102,64,41,73,74,212,216,207,42,74,184,169,170,211,170,149,176,105,66,69,122,6,168,123,147,187,96,77,90,65,55,107,89,90,180,101,100,120,63,105,104,93,137,227,15,86,85,129,102,49,14,87,86,55,8,9,100,47,121,145,23,22,88,89,179,6,122,196,88,95,96,138,172,136,215,58,172,115,48,219,42,80,81,195,3,51,43,146,61,171,175,199,81,82,38,53,46,225,144,163,110,246,33,7,52,65,66,229,228,117,34,127,234,107,108,69,109,108,151,48,64,235,62,78,191,129,209,126,111,35,143,163,161,246,117,123,50,222,65,52,19,125,141,221,55,65,3,195,197,25,7,33,220,237,44,70,71,139,122,193,245,247,130,33,71,21,162,153,158,159,170,169,150,188,174,196,216,186,92,144,160,161,2,97,167,141,125,241,164,167,37,72,38,12,145,159,160,38,82,13,63,68,71,226,35,111,158,153,154,101,50,205,206,92,165,209,198,217,165,167,97,220,115,218,133,112,243,239,238,241,214,135,169,190,173,133,171,208,32,125,44,237,86,87,178,85,86,179,84,85,180,83,84,181,201,83,182,137,93,132,76,62,183,61,76,184,57,61,185,212,57,186,214,207,187,34,143,156,79,239,237,123,137,177,44,1,4,201,194,32,64,102,129,213,215,138,59,166,219,242,99,97,2,94,141,75,59,235,24,110,228,25,130,226,23,24,229,22,23,230,26,22,231,112,26,232,189,190,243,221,56,190,28,56,221,27,28,222,29,27,223,30,29,224,247,30,225,238,79,20,166,59,75,60,75,240,147,177,215,20,79,166,187,147,213,112,233,244,233,128,245,128,114,188,114,217,174,131,115,220,217,198,236,198,131,134,177,132,58,143,35,124,110,163,7,228,110,25,356,389,368,11,302,267,452,350,349,302,303,269,357,343,277,452,453,357,333,332,297,175,152,377,384,398,382,347,348,330,303,304,270,9,336,337,278,279,360,418,262,431,304,408,409,310,415,407,270,409,410,450,348,347,422,430,434,313,314,17,306,307,375,387,388,260,286,414,398,335,406,418,364,367,416,423,358,327,251,284,298,281,5,4,373,374,253,307,320,321,425,427,411,421,313,18,321,405,406,320,404,405,315,16,17,426,425,266,377,400,369,322,391,269,417,465,464,386,257,258,466,260,388,456,399,419,284,332,333,417,285,8,346,340,261,413,441,285,327,460,328,355,371,329,392,439,438,382,341,256,429,420,360,364,394,379,277,343,437,443,444,283,275,440,363,431,262,369,297,338,337,273,375,321,450,451,349,446,342,467,293,334,282,458,461,462,276,353,383,308,324,325,276,300,293,372,345,447,382,398,362,352,345,340,274,1,19,456,248,281,436,427,425,381,256,252,269,391,393,200,199,428,266,330,329,287,273,422,250,462,328,258,286,384,265,353,342,387,259,257,424,431,430,342,353,276,273,335,424,292,325,307,366,447,345,271,303,302,423,266,371,294,455,460,279,278,294,271,272,304,432,434,427,272,407,408,394,430,431,395,369,400,334,333,299,351,417,168,352,280,411,325,319,320,295,296,336,319,403,404,330,348,349,293,298,333,323,454,447,15,16,315,358,429,279,14,15,316,285,336,9,329,349,350,374,380,252,318,402,403,6,197,419,318,319,325,367,364,365,435,367,397,344,438,439,272,271,311,195,5,281,273,287,291,396,428,199,311,271,268,283,444,445,373,254,339,263,466,249,282,334,296,449,347,346,264,447,454,336,296,299,338,10,151,278,439,455,292,407,415,358,371,355,340,345,372,390,249,466,346,347,280,442,443,282,19,94,370,441,442,295,248,419,197,263,255,359,440,275,274,300,383,368,351,412,465,263,467,466,301,368,389,380,374,386,395,378,379,412,351,419,436,426,322,373,390,388,2,164,393,370,462,461,164,0,267,302,11,12,374,373,387,268,12,13,293,300,301,446,261,340,385,384,381,330,266,425,426,423,391,429,355,437,391,327,326,440,457,438,341,382,362,459,457,461,434,430,394,414,463,362,396,369,262,354,461,457,316,403,402,315,404,403,314,405,404,313,406,405,421,418,406,366,401,361,306,408,407,291,409,408,287,410,409,432,436,410,434,416,411,264,368,383,309,438,457,352,376,401,274,275,4,421,428,262,294,327,358,433,416,367,289,455,439,462,370,326,2,326,370,305,460,455,254,449,448,255,261,446,253,450,449,252,451,450,256,452,451,341,453,452,413,464,463,441,413,414,258,442,441,257,443,442,259,444,443,260,445,444,467,342,445,459,458,250,289,392,290,290,328,460,376,433,435,250,290,392,411,416,433,341,463,464,453,464,465,357,465,412,343,412,399,360,363,440,437,399,456,420,456,363,401,435,288,372,383,353,339,255,249,448,261,255,133,243,190,133,155,112,33,246,247,33,130,25,398,384,286,362,398,414,362,463,341,263,359,467,263,249,255,466,467,260,75,60,166,238,239,79,162,127,139,72,11,37,121,232,120,73,72,39,114,128,47,233,232,128,103,104,67,152,175,148,173,157,155,119,118,101,74,73,40,107,9,108,49,48,131,32,194,211,184,74,185,191,80,183,185,40,186,119,230,118,210,202,214,84,83,17,77,76,146,161,160,30,190,56,173,182,106,194,138,135,192,129,203,98,54,21,68,5,51,4,145,144,23,90,77,91,207,205,187,83,201,18,181,91,182,180,90,181,16,85,17,205,206,36,176,148,140,165,92,39,245,193,244,27,159,28,30,247,161,174,236,196,103,54,104,55,193,8,111,117,31,221,189,55,240,98,99,142,126,100,219,166,218,112,155,26,198,209,131,169,135,150,114,47,217,224,223,53,220,45,134,32,211,140,109,67,108,146,43,91,231,230,120,113,226,247,105,63,52,241,238,242,124,46,156,95,78,96,70,46,63,116,143,227,116,123,111,1,44,19,3,236,51,207,216,205,26,154,22,165,39,167,199,200,208,101,36,100,43,57,202,242,20,99,56,28,157,124,35,113,29,160,27,211,204,210,124,113,46,106,43,204,96,62,77,227,137,116,73,41,72,36,203,142,235,64,240,48,49,64,42,41,74,214,212,207,183,42,184,210,169,211,140,170,176,104,105,69,193,122,168,50,123,187,89,96,90,66,65,107,179,89,180,119,101,120,68,63,104,234,93,227,16,15,85,209,129,49,15,14,86,107,55,9,120,100,121,153,145,22,178,88,179,197,6,196,89,88,96,135,138,136,138,215,172,218,115,219,41,42,81,5,195,51,57,43,61,208,171,199,41,81,38,224,53,225,24,144,110,105,52,66,118,229,117,227,34,234,66,107,69,10,109,151,219,48,235,183,62,191,142,129,126,116,111,143,7,163,246,118,117,50,223,222,52,94,19,141,222,221,65,196,3,197,45,220,44,156,70,139,188,122,245,139,71,162,145,153,159,149,170,150,122,188,196,206,216,92,163,144,161,164,2,167,242,141,241,0,164,37,11,72,12,144,145,160,12,38,13,70,63,71,31,226,111,157,158,154,36,101,205,203,206,165,126,209,217,98,165,97,237,220,218,237,239,241,210,214,169,140,171,32,241,125,237,179,86,178,180,85,179,181,84,180,182,83,181,194,201,182,177,137,132,184,76,183,185,61,184,186,57,185,216,212,186,192,214,187,139,34,156,218,79,237,147,123,177,45,44,4,208,201,32,98,64,129,192,213,138,235,59,219,141,242,97,97,2,141,240,75,235,229,24,228,31,25,226,230,23,229,231,22,230,232,26,231,233,112,232,244,189,243,189,221,190,222,28,221,223,27,222,224,29,223,225,30,224,113,247,225,99,60,240,213,147,215,60,20,166,192,187,213,243,112,244,244,233,245,245,128,188,188,114,174,134,131,220,174,217,236,236,198,134,215,177,58,156,143,124,25,110,7,31,228,25,264,356,368,0,11,267,451,452,349,267,302,269,350,357,277,350,452,357,299,333,297,396,175,377,381,384,382,280,347,330,269,303,270,151,9,337,344,278,360,424,418,431,270,304,409,272,310,407,322,270,410,449,450,347,432,422,434,18,313,17,291,306,375,259,387,260,424,335,418,434,364,416,391,423,327,301,251,298,275,281,4,254,373,253,375,307,321,280,425,411,200,421,18,335,321,406,321,320,405,314,315,17,423,426,266,396,377,369,270,322,269,413,417,464,385,386,258,248,456,419,298,284,333,168,417,8,448,346,261,417,413,285,326,327,328,277,355,329,309,392,438,381,382,256,279,429,360,365,364,379,355,277,437,282,443,283,281,275,363,395,431,369,299,297,337,335,273,321,348,450,349,359,446,467,283,293,282,250,458,462,300,276,383,292,308,325,283,276,293,264,372,447,346,352,340,354,274,19,363,456,281,426,436,425,380,381,252,267,269,393,421,200,428,371,266,329,432,287,422,290,250,328,385,258,384,446,265,342,386,387,257,422,424,430,445,342,276,422,273,424,306,292,307,352,366,345,268,271,302,358,423,371,327,294,460,331,279,294,303,271,304,436,432,427,304,272,408,395,394,431,378,395,400,296,334,299,6,351,168,376,352,411,307,325,320,285,295,336,320,319,404,329,330,349,334,293,333,366,323,447,316,15,315,331,358,279,317,14,316,8,285,9,277,329,350,253,374,252,319,318,403,351,6,419,324,318,325,397,367,365,288,435,397,278,344,439,310,272,311,248,195,281,375,273,291,175,396,199,312,311,268,276,283,445,390,373,339,295,282,296,448,449,346,356,264,454,337,336,299,337,338,151,294,278,455,308,292,415,429,358,355,265,340,372,388,390,466,352,346,280,295,442,282,354,19,370,285,441,295,195,248,197,457,440,274,301,300,368,417,351,465,251,301,389,385,380,386,394,395,379,399,412,419,410,436,322,387,373,388,326,2,393,354,370,461,393,164,267,268,302,12,386,374,387,312,268,13,298,293,301,265,446,340,380,385,381,280,330,425,322,426,391,420,429,437,393,391,326,344,440,438,458,459,461,364,434,394,428,396,262,274,354,457,317,316,402,316,315,403,315,314,404,314,313,405,313,421,406,323,366,361,292,306,407,306,291,408,291,287,409,287,432,410,427,434,411,372,264,383,459,309,457,366,352,401,1,274,4,418,421,262,331,294,358,435,433,367,392,289,439,328,462,326,94,2,370,289,305,455,339,254,448,359,255,446,254,253,449,253,252,450,252,256,451,256,341,452,414,413,463,286,441,414,286,258,441,258,257,442,257,259,443,259,260,444,260,467,445,309,459,250,305,289,290,305,290,460,401,376,435,309,250,392,376,411,433,453,341,464,357,453,465,343,357,412,437,343,399,344,360,440,420,437,456,360,420,363,361,401,288,265,372,353,390,339,249,339,448,255];a(58310);let q=e=>{var t,a,r,n;let{faceImages:o,setStep:c,handleImageSelectFinish:d,canvasImage:h,setCanvasImage:u,landmarks:m,isDeepSearch:g,onDeepSearchStart:x,shouldStartAnimationImmediately:f}=e,w=(0,i.c3)("Search.step-2"),[b,k]=(0,s.useState)(null==(t=o[0])?void 0:t.image),[I,N]=(0,s.useState)(f),[S,_]=(0,s.useState)(0),[F,E]=(0,s.useState)(0),[C,L]=(0,s.useState)([]),[R,q]=(0,s.useState)(!1),V=(0,s.useRef)(null),W=(0,s.useRef)(null),z=(0,s.useRef)(null),B=(0,s.useRef)(null);(0,s.useEffect)(()=>{var e;if(null==m||null==(e=m.keypoints)?void 0:e.length){let e=m.keypoints.map(e=>[e.x,e.y]),t=[];for(let a=0;ae[t]);t.push(l)}L(t)}},[null==m||null==(a=m.keypoints[0])?void 0:a.x]),(0,s.useEffect)(()=>{var e;if(!(null==m||null==(e=m.keypoints)?void 0:e.length)||!C.length||!h)return;let t=(e,t)=>{let a=document.createElement("canvas");return a.width=e,a.height=t,a},a=t(250,250);a.getContext("2d").drawImage(h,0,0,250,250);let l=new Image;l.src=a.toDataURL(),l.onload=()=>{V.current=l};let i=t(250,250),r=i.getContext("2d");r.drawImage(h,0,0,250,250),m.keypoints.forEach(e=>{r.fillStyle="grey",r.beginPath(),r.arc(e.x,e.y,1,0,2*Math.PI),r.fill()});let s=new Image;s.src=i.toDataURL(),s.onload=()=>{W.current=s};let n=t(250,250),o=n.getContext("2d");o.drawImage(h,0,0,250,250),m.keypoints.forEach(e=>{o.fillStyle="#16855e",o.beginPath(),o.arc(e.x,e.y,1,0,2*Math.PI),o.fill()});let d=new Image;d.src=n.toDataURL(),d.onload=()=>{z.current=d};let u=t(250,250),g=u.getContext("2d");g.drawImage(h,0,0,250,250),C.forEach(e=>{g.strokeStyle="#16855e",g.lineWidth=.3,g.beginPath(),g.moveTo(e[0][0],e[0][1]),g.lineTo(e[1][0],e[1][1]),g.lineTo(e[2][0],e[2][1]),g.closePath(),g.stroke()});let p=new Image;p.src=u.toDataURL(),p.onload=()=>{B.current=p,q(!0),c(2)}},[m,C,h]),(0,s.useEffect)(()=>{let e;if(!I||!R)return;let t=performance.now(),a=l=>{let i=l-t;if(i>=9e3){j.j.track(p.q.ProcessingImageAnimationViewed,{...g?{is_deep_search:!0}:{}}),cancelAnimationFrame(e),d(),g&&(null==x||x());return}let r=Math.max(0,Math.min(Math.floor(i/3e3),2));r!==F&&E(r),_(i%3e3/3e3),e=requestAnimationFrame(a)};return e=requestAnimationFrame(a),()=>{e&&cancelAnimationFrame(e)}},[I,R,d]);let X=(e,t)=>{k(e.image);let a=new Image;a.src=e.image,a.crossOrigin="anonymous",a.width=250,a.height=250,a.style.objectFit="cover",u(a),y.A.setItem(T.r.SelectedImage,{imageUrl:e.imageUrl,totalImages:t,originalImageUrl:e.originalImageUrl,age:e.age})};(0,s.useEffect)(()=>{o.length>0&&(X(o[0],null==o?void 0:o.length),j.j.track(p.q.ProcessingImageFinished,{faces:o.length,...g?{is_deep_search:!0}:{}}))},[o.length]),(0,s.useEffect)(()=>{(null==o?void 0:o.length)===1&&X(o[0],null==o?void 0:o.length)},[null==o?void 0:o.length]);let Y=()=>[e=>250*e,e=>250-250*e,e=>250*e][F](S),H=()=>{let e=Y();return[{clipX:0,clipY:0,clipWidth:250,clipHeight:e},{clipX:0,clipY:e,clipWidth:250,clipHeight:250-e},{clipX:0,clipY:0,clipWidth:250,clipHeight:e}][F]},G=()=>[{base:V.current,overlay:W.current},{base:W.current,overlay:z.current},{base:z.current,overlay:B.current}][F];return(0,l.jsx)("div",{className:"mx-auto flex w-full flex-grow flex-col items-center justify-between px-4 pb-4",children:(0,l.jsxs)("div",{className:"flex w-full max-w-[310px] flex-grow flex-col items-center",children:[(0,l.jsxs)("div",{className:"w-full",children:[I&&(0,l.jsx)(U.P.div,{animate:{opacity:1,y:0},className:"mx-auto max-w-[270px] text-center uppercase",initial:{opacity:0,y:-30},transition:{duration:.4},children:(0,l.jsx)("p",{children:w.rich(F<2?"scanning-face":"mapping-geometry",{br:()=>(0,l.jsx)("br",{})})})}),(0,l.jsxs)("div",{className:(0,v.cn)("mb-4 mt-6 grid max-h-[510px] min-h-[150px] w-full grid-cols-2 gap-3 overflow-auto p-[3px]",{"mx-auto max-w-[250px] !grid-cols-1 items-center justify-center":1===o.length||I,"grid-cols-3":o.length>2,"mt-6 p-0":1===o.length,"!mb-0 !mt-4 overflow-hidden":I}),children:[o.length>1&&(0,l.jsx)(l.Fragment,{children:I?(0,l.jsx)(U.P.div,{animate:{opacity:1,width:250,height:250,scale:1},className:"mx-auto flex items-center justify-center overflow-hidden rounded-small text-center",initial:{opacity:0,width:150,height:150,scale:.9},transition:{duration:.4},children:R?(0,l.jsxs)(O.BI,{height:250,width:250,children:[(0,l.jsx)(O.Wd,{children:(0,l.jsx)(O._V,{height:250,image:G().base||h,width:250})}),(0,l.jsxs)(O.Wd,{children:[(0,l.jsx)(O.YJ,{...H(),children:(0,l.jsx)(O._V,{height:250,image:G().overlay||h,width:250})}),(0,l.jsx)(O.N1,{points:[0,Y(),250,Y()],stroke:"#16855e",strokeWidth:1})]})]}):(0,l.jsx)(O.BI,{height:250,width:250,children:(0,l.jsx)(O.Wd,{children:(0,l.jsx)(O._V,{height:250,image:h,width:250})})})}):o.map((e,t)=>(0,l.jsx)(D.T,{className:(0,v.cn)("h-full max-h-[150px] w-full max-w-[150px] shrink-0 flex-grow overflow-hidden rounded-small border-3 border-transparent bg-transparent p-0 hover:bg-transparent",{"outline-[2.5px] outline-offset-[0.5px] outline-blue-500":b===e.image}),onPress:()=>X(e,null==o?void 0:o.length),children:(0,l.jsx)("div",{className:(0,v.cn)("aspect-square h-full max-h-[150px] w-full max-w-[150px] shrink-0 overflow-hidden"),children:(0,l.jsx)("img",{alt:"Preview multiple faces",className:"h-full w-full object-cover",height:150,src:e.imageUrl,width:150})})},t))}),1===o.length&&(0,l.jsx)(l.Fragment,{children:I?(0,l.jsx)("div",{className:"min-h-[250px] min-w-[250px] overflow-hidden rounded-small",children:R?(0,l.jsxs)(O.BI,{className:"animate-scale-up",height:250,width:250,children:[(0,l.jsx)(O.Wd,{children:(0,l.jsx)(O._V,{height:250,image:G().base||h,width:250})}),(0,l.jsxs)(O.Wd,{children:[(0,l.jsx)(O.YJ,{...H(),children:(0,l.jsx)(O._V,{height:250,image:G().overlay||h,width:250})}),(0,l.jsx)(O.N1,{points:[0,Y(),250,Y()],stroke:"#16855e",strokeWidth:1})]})]}):(0,l.jsx)("img",{alt:"Preview solo faces",className:"h-[250px] w-[250px] object-cover",decoding:"sync",height:250,loading:"eager",src:null==(r=o[0])?void 0:r.imageUrl,width:250})}):(0,l.jsx)("div",{className:"animate-fade-in mx-auto min-h-[200px] min-w-[200px] overflow-hidden rounded-small text-center",children:(0,l.jsx)(A.default,{priority:!0,alt:"Preview one faces",className:"h-[200px] w-[200px] object-cover",height:200,loading:"eager",quality:75,src:null==(n=o[0])?void 0:n.imageUrl,width:200})})})]})]}),!I&&(0,l.jsx)("div",{className:"flex w-full flex-col items-center",children:(0,l.jsx)(D.T,{className:(0,v.cn)("mx-auto min-h-8 w-full text-wrap bg-primary_cta py-1",{"w-fit min-w-[206px] max-w-40 px-2":1===o.length}),isDisabled:!1,isLoading:!1,radius:"sm",size:"lg",spinner:(0,l.jsx)(P.o,{color:"white",size:"sm"}),style:{color:"white",wordBreak:"break-word"},type:"button",onPress:()=>{g&&(null==x||x()),c(3),N(!0),j.j.track(p.q.StartImageSearchClicked,{...g?{is_deep_search:!0}:{}})},children:w.rich(o.length>1?"select-image-start-search":"start-face-search",{br:()=>(0,l.jsx)("br",{})})})})]})})};a(21104);let V=(0,r.default)(()=>Promise.all([a.e(3078),a.e(3742)]).then(a.bind(a,23742)).then(e=>e.ProcessingImageStep),{loadableGenerated:{webpack:()=>[23742]},ssr:!1}),W=e=>{let t="/_next/image?url=".concat(encodeURIComponent(e),"&w=640&q=75");return new Promise(e=>{let a=new Image;a.onload=()=>e(a),a.onerror=()=>e(a),a.src=t})},z=e=>{let{isLoading:t,forceUpdate:r,handleImageSelect:N,handleClose:S,handleImageProcessed:E,isDeepSearch:D,isDeepSearchExitPopup:C,onClick:P,onDeepSearchStart:L,setShouldShowProgressBar:U,onFaceDetect:A}=e,O=(0,i.c3)("Search.step-1"),T=(0,i.c3)("ToastListener"),[M,z]=(0,s.useState)(!1),{isRtl:B}=(0,f.I)(),{user:X}=(0,x.A)(),{onClose:Y}=(0,c.j)(),H=(0,w.rd)(),G=(0,w.a8)(),[J,K]=(0,s.useState)(0),[Q,Z]=(0,s.useState)(!1),[$,ee]=(0,s.useState)(""),[et,ea]=(0,s.useState)(!1),[el,ei]=(0,s.useState)(!1),[er,es]=(0,s.useState)(!1),[en,eo]=(0,s.useState)([]),[ec,ed]=(0,s.useState)(null),[eh,eu]=(0,s.useState)(null),em=(0,o.mf)(),eg="/search/image/report"===G,{predictions:ep,isDetectedFace:ex}=function(e){let{detectFaces:t,predictions:l,isModelLoaded:i}=(()=>{let[e,t]=(0,s.useState)(!1),[l,i]=(0,s.useState)(null),[r,n]=(0,s.useState)(null);return(0,s.useEffect)(()=>{let e=new Worker(a.tu(new URL(a.p+a.u(6786),a.b)),{type:void 0});return i(e),e.onmessage=e=>{let{status:a,predictions:l}=e.data;"modelLoaded"===a?t(!0):"success"===a&&n(l)},e.postMessage({action:"loadModel"}),()=>{e.terminate(),i(null)}},[]),{isModelLoaded:e,detectFaces:(0,s.useCallback)(e=>{l&&l.postMessage({action:"detectFaces",imageData:e})},[l]),predictions:r}})();(0,s.useEffect)(()=>{if(e&&i){let a=()=>{let a=document.createElement("canvas");a.width=e.naturalWidth||e.width,a.height=e.naturalHeight||e.height;let l=a.getContext("2d");if(l&&a.width>0&&a.height>0)try{l.drawImage(e,0,0);let i=l.getImageData(0,0,a.width,a.height);t(i)}catch(e){console.error("Error processing image:",e)}};if(e.complete&&(e.naturalWidth>0||e.width>0))a();else{let t=()=>{a()},l=()=>{console.error("Image failed to load")};return e.addEventListener("load",t),e.addEventListener("error",l),()=>{e.removeEventListener("load",t),e.removeEventListener("error",l)}}}},[e,i,t]);let r=e&&l&&(null==l?void 0:l.length)!==0;return{predictions:null==l?void 0:l[0],canvasImage:e,isDetectedFace:r,isModelLoaded:i}}(ec),ef=async e=>{Z(!1),eh.getTracks().forEach(e=>{e.stop()}),eu(null);let t=((e,t)=>{let a=e.split(","),l=a[0].match(/:(.*?);/)[1],i=atob(a[1]),r=i.length,s=new Uint8Array(r);for(;r--;)s[r]=i.charCodeAt(r);return new File([s],t,{type:l})})(e,"image.png");if(t){let e=new FileReader;e.onload=function(e){let a=new Image;a.src=e.target.result,a.onload=function(){let e=+(t.size/1024).toFixed(2),l=t.name.split(".").pop().toLowerCase()||t.type||"N/A";j.j.track(p.q.FaceReconitionUploadStarted,{type:"camera",format:l,width:a.width,height:a.height,weight:e,...D?{is_deep_search:!0}:{}})}},e.readAsDataURL(t),await ew(t)}};(0,w.a8)();let ew=async e=>{if(null==N||N(),ea(!0),ee(""),K(1),e)try{let t=await F(e),a=t.map(e=>e.imageUrl);if(await Promise.all(a.map(W)),eo(t),j.j.track(p.q.FacesIdentified,{count:t.length}),1===t.length){let e=new Image;e.src=t[0].image,em&&await em.setAttributes({...em.getAttributes(),image_upload_faces_count:t.length}),D?(K(3),ed(e)):(ed(e),K(3),z(!0))}y.A.setItem("images",JSON.stringify(t)),A&&setTimeout(()=>{null==A||A(),ea(!1)},500)}catch(e){K(0),ee(e.errorCode),ea(!1)}finally{A||ea(!1)}},ev=async()=>{try{var e,t;let a=await (null===k.V||void 0===k.V||null==(t=k.V.getNavigator())||null==(e=t.mediaDevices)?void 0:e.getUserMedia({video:!0}));eu(a),ej()}catch(e){es(!1),Z(!1)}},ej=async()=>{try{var e,t;let a=await (null===k.V||void 0===k.V||null==(t=k.V.getNavigator())||null==(e=t.permissions)?void 0:e.query({name:"camera"}));es((null==a?void 0:a.state)!=="denied"),Z((null==a?void 0:a.state)!=="denied"),a.onchange=()=>{es("denied"!==a.state),Z("denied"!==a.state)}}catch(e){es(!1),Z(!1)}};return(0,s.useEffect)(()=>{Q?ev():eh&&(null==eh||eh.getTracks().forEach(e=>{e.stop()}),eu(null))},[Q]),(0,l.jsxs)(l.Fragment,{children:[el&&(0,l.jsx)(g.p,{handleSuccess:()=>{if(ei(!1),null==E||E(),D){window.scrollTo(0,0),null==U||U(!0);return}if(eg){Y(),K(0),r({});return}P?(null==P||P(),Y(),K(0)):(K(0),H.push("/search/image/report"))},isOpen:el,onOpenChange:ei}),(0,l.jsx)(d.Y,{className:(0,v.cn)("image-input-modal w-fit min-w-[200px]",{"max-w-[22rem]":!n.Fr,"min-h-[320px] min-w-[238px]":1===J}),hideCloseButton:1===J||3===J,isDismissable:!1,isKeyboardDismissDisabled:!0,isOpen:Q&&er||J>0&&!D||J>1&&D&&1===en.length&&ep&&!et||J>=1&&D&&en.length>1&&!et,placement:"center",size:"sm",onClose:()=>{Z(!1),Y(),null==S||S(),K(0),eo([]),j.j.track(p.q.ImageFlowClosed,{})},children:(0,l.jsx)(h.g,{children:(0,l.jsx)(u.h,{className:(0,v.cn)("mx-auto w-full gap-0 px-0 pb-0 pt-4"),children:Q&&er?(0,l.jsx)(_,{onTakePhotoAnimationDone:ef}):(0,l.jsxs)(l.Fragment,{children:[et&&!D&&(0,l.jsx)(V,{}),!et&&(0,l.jsx)(q,{canvasImage:ec,faceImages:en,handleImageSelectFinish:()=>{if(I.R.removeItem("reportData.image"),X){if(0===X.credits){(0,b.P)("info",T("messages.no-credits")),ei(!0),Y(),K(0);return}else if(X.credits>0&&!eg){if(P)null==P||P(),Y(),K(0);else{if(!D)return void H.push("/search/image/report");null==E||E(),D&&(null==P||P(),Y(),K(0),window.scrollTo(0,0))}return}else if(X.credits>0&&eg){null==P||P(),Y(),K(0),null==r||r({});return}}H.push("/search/image/step-3")},isDeepSearch:D,landmarks:ep,setCanvasImage:ed,setStep:K,shouldStartAnimationImmediately:M,onDeepSearchStart:L})]})})})}),(0,l.jsxs)("div",{className:(0,v.cn)("w-full scroll-mt-20",{"mb-6 lg:mb-6":eg,"pointer-events-none opacity-80":t}),id:"hero-input",children:[(0,l.jsx)(R,{handleNextStep:ew,isDeepSearch:D,isFaceDetected:ex,isLoading:t,isProcessing:et,setError:ee,setShowCamera:Z}),(0,l.jsxs)("div",{className:(0,v.cn)("lg:pt-[3.5rem]",{"lg:pt-[6.5rem]":eg}),children:[$&&(0,l.jsx)("p",{className:(0,v.cn)("mt-1 text-left text-xs text-red-600",{"lg:text-right":B,"px-2":eg,"px-2 text-right":B&&eg}),children:(()=>{switch($){case"file-too-large":case"FILE_TOO_LARGE":return O("file-too-large");case"FORMAT_NOT_SUPPORTED":case"UNSUPPORTED_FILE_FORMAT":case"file-invalid-type":return O("format-not-supported");case"NO_FACES_FOUND":return O("face-not-recognized");default:return O("default")}})()}),(0,l.jsx)("p",{className:(0,v.cn)("mt-1.5 text-xs opacity-75 lg:text-left",{"lg:text-right":B,"px-2 text-left":eg,"px-2 text-right":B&&eg}),children:O("image-disclaimer")}),C&&(0,l.jsx)("p",{className:(0,v.cn)("mt-1.5 text-xs opacity-75 lg:text-left",{"lg:text-right":B,"px-2 text-left":eg,"px-2 text-right":B&&eg}),children:(0,l.jsxs)("span",{className:"flex gap-0.5",children:[(0,l.jsx)(m.Icon,{className:"mt-0.5 h-3 w-3 shrink-0",icon:"carbon:security"})," ",O("image-disclaimer2")]})})]})]})]})}}}]);