1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[1023],{11031:function(e,t,s){var a=s(85893),r=s(67294),l=s(11163),i=s(37351),n=s(85574),c=s(82940),o=s(68015),d=s(96486),h=s(87066),u=s(89583),m=s(21876).Buffer;let x=e=>{var t;let{isOpen:s,onClose:l,searchResults:i,isSearching:n}=e,[c,o]=(0,r.useState)(0),[d,h]=(0,r.useState)({}),[m,x]=(0,r.useState)(!0),[g,p]=(0,r.useState)(!1),f=i.filter(e=>!e.isLoading&&1===e.availability),b=e=>{h(t=>({...t,[e]:!0}))},v=(e,t)=>{if(null==d?void 0:d[t])return"/images/placeholder-product.png";if(e.images&&"object"==typeof e.images){let s=Object.keys(e.images);if(s.length>0){let a=e.images[s[0]];return a&&!a.startsWith("http")&&(a="https://search.ta4.in".concat(a)),a}}let r=e.image_url||e.image_path||e.url||e.image||e.thumbnail_url||e.main_image;return r&&!r.startsWith("http")&&(r="https://search.ta4.in".concat(r)),r||"/images/placeholder-product.png"},y=e=>{o(e),x(!1)},j=()=>{o(e=>e<f.length-1?e+1:0)},w=()=>{o(e=>e>0?e-1:f.length-1)},N=()=>{let e=f[c];if(null==e?void 0:e.product_url){let t=e.product_url.startsWith("http")?e.product_url:"https://www.darjewellery.com".concat(e.product_url);window.open(t,"_blank")}},k=()=>{x(!0)};if(!s)return null;let C=f[c];return(0,a.jsx)("div",{className:"fixed inset-0 min-h-screen max-h-screen bg-black bg-opacity-90 z-[9999] flex items-start justify-center pt-8 pb-4 px-4 overflow-y-auto",children:m?(0,a.jsxs)("div",{className:"w-full max-w-md bg-white rounded-lg flex flex-col shadow-2xl",style:{height:"85vh",maxHeight:"85vh"},children:[(0,a.jsx)("div",{className:"p-4 border-b border-gray-200 bg-gray-50 flex-shrink-0",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("h2",{className:"text-lg font-semibold text-gray-800",children:["Similar Products (",f.length," available)"]}),(0,a.jsx)("button",{onClick:l,className:"text-gray-500 hover:text-gray-700 p-2 rounded-full hover:bg-gray-100",children:(0,a.jsx)(u.aHS,{size:20})})]})}),(0,a.jsx)("div",{className:"flex-1 overflow-y-auto",style:{WebkitOverflowScrolling:"touch"},children:n?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center h-64 p-8",children:[(0,a.jsx)(u.fCD,{className:"animate-spin text-blue-500 mb-4",size:40}),(0,a.jsx)("span",{className:"text-gray-600 text-center",children:"Finding available products..."})]}):0===f.length?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center h-64 p-8",children:[(0,a.jsx)("div",{className:"text-gray-400 mb-2 text-center",children:"No available products found"}),(0,a.jsx)("div",{className:"text-sm text-gray-500 text-center",children:"All products are currently out of stock"})]}):(0,a.jsx)("div",{className:"p-4",children:(0,a.jsx)("div",{className:"grid grid-cols-2 gap-3",style:{paddingBottom:"120px"},children:f.map((e,t)=>(0,a.jsxs)("div",{className:"border border-gray-200 rounded-xl overflow-hidden cursor-pointer bg-white hover:shadow-lg transition-all duration-300 transform hover:scale-[1.02]",onClick:()=>y(t),children:[(0,a.jsx)("div",{className:"aspect-square relative",children:(0,a.jsx)("img",{src:v(e,t),alt:e.product_name||e.tag_label,className:"w-full h-full object-cover",onError:()=>b(t)})}),(0,a.jsxs)("div",{className:"p-3",children:[C.sku_id&&(0,a.jsx)("p",{className:"text-sm text-gray-800 truncate font-medium",children:C.sku_id}),e.special_price&&(0,a.jsx)("p",{className:"text-xs text-green-600 font-semibold mt-1",children:(null==e?void 0:e.special_price)||""})]})]},t))})})})]}):(0,a.jsxs)("div",{className:"w-full max-w-md bg-white rounded-lg flex flex-col overflow-hidden shadow-2xl max-h-[calc(100vh-8rem)]",children:[(0,a.jsx)("div",{className:"p-4 border-b border-gray-200 bg-gray-50 flex-shrink-0",children:(0,a.jsx)("div",{className:"flex items-center justify-between",children:(0,a.jsxs)("button",{onClick:k,className:"flex items-center text-blue-600 hover:text-blue-700 font-medium",children:[(0,a.jsx)(u.x_l,{className:"mr-2",size:16}),"Back to Results"]})})}),(0,a.jsx)("div",{className:"overflow-y-auto flex-grow",children:C&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("div",{className:"relative bg-gray-100 max-h-[400px] sm:max-h-[400px] w-full overflow-hidden z-10",children:[(0,a.jsx)("div",{className:"flex items-center justify-center h-full w-full p-4",children:(0,a.jsx)("img",{src:v(C,"main"),alt:C.product_name||C.tag_label,className:"max-h-full max-w-full object-contain rounded-lg shadow-lg",onError:()=>b("main")})}),f.length>1&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("button",{onClick:w,className:"absolute left-3 top-1/2 transform -translate-y-1/2 bg-white bg-opacity-90 backdrop-blur-sm text-gray-700 p-3 rounded-full shadow-lg hover:bg-white hover:scale-110 transition-all",children:(0,a.jsx)(u.bUI,{size:16})}),(0,a.jsx)("button",{onClick:j,className:"absolute right-3 top-1/2 transform -translate-y-1/2 bg-white bg-opacity-90 backdrop-blur-sm text-gray-700 p-3 rounded-full shadow-lg hover:bg-white hover:scale-110 transition-all",children:(0,a.jsx)(u.Dli,{size:16})})]}),(0,a.jsxs)("div",{className:"absolute bottom-3 left-1/2 transform -translate-x-1/2 bg-white bg-opacity-90 backdrop-blur-sm text-gray-700 px-4 py-2 rounded-full text-sm font-medium shadow-lg",style:{bottom:"-10px"},children:[c+1," / ",f.length]})]}),(0,a.jsx)("div",{className:"bg-white border-t border-gray-100 flex-shrink-0",children:(0,a.jsxs)("div",{className:"p-4 space-y-3",children:[(0,a.jsxs)("div",{children:[C.product_name&&(0,a.jsx)("h2",{className:"text-lg font-bold text-gray-800 mb
1-2",children:C.product_name}),(0,a.jsxs)("div",{className:"inline-flex items-center px-3 py-1 rounded-full text-sm font-medium ".concat(1===C.Availability?"bg-green-100 text-green-800":"bg-orange-100 text-orange-800"),children:[(0,a.jsx)("div",{className:"w-2 h-2 rounded-full mr-2 ".concat(1===C.Availability?"bg-green-500":"bg-orange-500")}),1===C.Availability?"In Stock":"Make Order"]})]}),(0,a.jsxs)("div",{className:"bg-gray-50 rounded-lg p-3 space-y-2",children:[C.sku_id&&(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)("span",{className:"text-gray-600",children:"SKU:"}),(0,a.jsx)("span",{className:"font-medium text-sm",children:C.sku_id})]}),(null===(t=C.json)||void 0===t?void 0:t.weight)&&C.json.weight>0&&(0,a.jsx)("div",{className:"border-t border-gray-200 pt-2",children:(0,a.jsxs)("div",{className:"flex justify-between items-center",children:[(0,a.jsx)("span",{className:"text-gray-600 text-sm",children:"Weight:"}),(0,a.jsxs)("span",{className:"font-medium text-sm text-blue-600",children:[C.json.weight,"g"]})]})}),(null==C?void 0:C.special_price)&&(0,a.jsxs)("div",{className:"flex justify-between items-center border-t border-gray-200 pt-2",children:[(0,a.jsx)("span",{className:"text-gray-600 text-sm",children:"Price:"}),(0,a.jsx)("span",{className:"font-bold text-lg text-green-600",children:(null==C?void 0:C.special_price)||""})]})]}),(0,a.jsx)("button",{onClick:N,className:"w-full bg-blue-600 text-white py-3 px-4 rounded-lg hover:bg-blue-700 transition font-medium",children:"View Full Product Details"})]})})]})})]})})};t.Z=function(e){let t,{setClose:s=()=>!1}=e,[g,p]=(0,r.useState)(""),{featureCustomizations:f,metalCategories:b,menuJsonApp:v}=(0,r.useContext)(n.UserContext),[y,j]=(0,r.useState)(["1","2","3"]),[w,N]=(0,r.useState)(0),[k,C]=(0,r.useState)(!1),S=(0,l.useRouter)(),_=(0,r.useContext)(i.ThemeContext),E=(0,c.b)(),[z,L]=(0,r.useState)([]),[M,B]=(0,r.useState)(!1),{jboId:F}=(0,o.useJobId)(),T=(0,r.useRef)((0,d.debounce)(e=>ej(e),300)).current,[O,H]=(0,r.useState)(!1),[U,I]=(0,r.useState)(""),[R,D]=(0,r.useState)(!1),[W,A]=(0,r.useState)(!1),[P,Y]=(0,r.useState)(null),[X,V]=(0,r.useState)(null),[Z,G]=(0,r.useState)(!1),[J,q]=(0,r.useState)(!1),[K,Q]=(0,r.useState)([]),[$,ee]=(0,r.useState)(!1),[et,es]=(0,r.useState)(null),ea=(0,r.useRef)(null),er=(0,r.useRef)(null),el=(0,r.useRef)(null),ei=(0,r.useRef)(null);{let en=window.location.hostname;t="https://".concat(en,"/api")}let ec=()=>{H(!0),D(!1),I(""),A(!1),Y(null),V(null),es(null),Q([])},eo=e=>{I(e),D(!0)},ed=()=>{eA(!0),D(!1),I(""),A(!1),Y(null),V(null),es(null),Q([]),ex()},eh=()=>{if(document.body.classList.remove("camera-open"),eH){let e=eH.getTracks();e.forEach(e=>e.stop()),eU(null)}ea.current&&(ea.current.srcObject=null),A(!1),e_(1),eO(!1)},eu=()=>{if(document.body.classList.remove("camera-open"),eH){let e=eH.getTracks();e.forEach(e=>e.stop()),eU(null)}ea.current&&(ea.current.srcObject=null),A(!1),H(!1),e_(1),eO(!1),eA(!0)},em=async()=>{try{if(A(!0),ea.current&&ea.current.srcObject){let e=ea.current.srcObject.getTracks();e.forEach(e=>e.stop())}document.body.classList.add("camera-open");let t=await navigator.mediaDevices.getUserMedia({video:{facingMode:eI,width:{ideal:1280},height:{ideal:720}}});ea.current&&(ea.current.srcObject=t,eU(t),eA(!1),A(!0),e_(1),eO(!1))}catch(s){console.error("Error accessing camera:",s),alert("Could not access camera. Please check permissions.")}},ex=()=>{ei.current&&(ei.current.getTracks().forEach(e=>e.stop()),ei.current=null)},eg=async e=>{let{files:s}=e.target;if(s.length>0){let a=s[0],r=new FormData;r.append("pan_upload",a);try{G(!0);let l=await h.Z.post("".concat(t,"/upload"),r,{headers:{"Content-Type":"multipart/form-data"}}),i=l.data.pan_upload.imageUrl;V(i)}catch(n){console.error(n)}finally{G(!1)}}},ep=async()=>{async function e(e){return m.from(e).toString("base64")}let t=await e(X),s=U.toUpperCase();H(!1),S.push("/search/aisearch?i=".concat(t,"&&c=").concat(s))},ef=()=>{var e;null===(e=el.current)||void 0===e||e.click()};(0,r.useEffect)(()=>()=>{ex()},[]);let eb=e=>{if(e.preventDefault(),!g.trim()){p("");return}let t=g.trim()||"",a=0===_.siteStatus?"/search/".concat(t,"?pid=").concat(_.token):"/search/".concat(t);window.location.href=a,p(""),s(!1)};(0,r.useEffect)(()=>{f&&1==f.is_search_key_enabled&&f.search_key?j(f.search_key):ev(b)},[f,b]);let ev=e=>{var t=[];
1Array.isArray(e)&&(e.forEach(e=>{t.push(e.name),e.child&&e.child.forEach(e=>{t.push(e.name),e.child&&e.child.forEach(e=>{t.push(e.name)})})}),j(t))},ey=()=>{N(Math.floor(Math.random()*y.length))};(0,r.useEffect)(()=>{let e=setInterval(ey,2e3);return()=>clearInterval(e)},[y]),(0,r.useEffect)(()=>{let e=setTimeout(()=>{C(!0)},3e3);return()=>clearTimeout(e)},[]);let ej=async e=>{if(!e.trim()){B(!1),L([]);return}try{let t=await E.post("product/searchSuggestions",{search_keyword:e});t.data&&t.data.suggestions.length>0?(L(t.data.suggestions),B(!0)):L([])}catch(s){"CanceledError"!==s.name&&(console.error("Suggestion fetch error:",s),L([]))}},ew=e=>{let t=e.target.value;p(t),233===F&&t.trim()?T(t.trim()):(T.cancel(),L([]),B(!1))};(0,r.useEffect)(()=>{g.trim()||233!=F||(T.cancel(),L([]))},[M]);let eN=e=>{B(!1),S.push(e||"/")},ek=()=>{setTimeout(()=>{233==F&&B(!1)},200)},eC=()=>{g.trim()&&233==F&&B(!0)},[eS,e_]=(0,r.useState)(1),[eE,ez]=(0,r.useState)(3),[eL,eM]=(0,r.useState)(1),[eB,eF]=(0,r.useState)(!1),[eT,eO]=(0,r.useState)(!1),[eH,eU]=(0,r.useState)(null),[eI,eR]=(0,r.useState)("environment"),eD=()=>{e_(e=>Math.min(e+.2,eE))},eW=()=>{e_(e=>Math.max(e-.2,eL))},eA=function(){let e=!(arguments.length>0)||void 0===arguments[0]||arguments[0],t=document.getElementById("tidio-chat-iframe");t&&(t.style.visibility=e?"visible":"hidden")},eP=async()=>{try{if(!ea.current||!eH){alert("Camera not available");return}let e=eH.getVideoTracks()[0];if(e&&e.getCapabilities){let t=e.getCapabilities();if(t.torch){let s=!eT;await e.applyConstraints({advanced:[{torch:s}]}),eO(s),console.log("Flash ".concat(s?"ON":"OFF")),s&&navigator.vibrate&&navigator.vibrate(100)}else alert("Flash/Torch not supported on this device or browser. Try using a mobile device with a physical camera flash.")}else alert("Camera capabilities not available")}catch(a){console.error("Flash toggle error:",a),alert("Could not toggle flash. Make sure you are using a device with flash support.")}},eY=async()=>{try{if(eH){let e=eH.getTracks();e.forEach(e=>e.stop())}let t="environment"===eI?"user":"environment",s=await navigator.mediaDevices.getUserMedia({video:{facingMode:t,width:{ideal:1280},height:{ideal:720}}});ea.current&&(ea.current.srcObject=s,eU(s),eR(t),eO(!1),e_(1),console.log("Switched to ".concat("environment"===t?"back":"front"," camera")))}catch(a){console.error("Camera switch error:",a),alert("Could not switch camera")}};(0,r.useEffect)(()=>{let e=0,t=1,s=s=>{2===s.touches.length&&(e=Math.hypot(s.touches[0].pageX-s.touches[1].pageX,s.touches[0].pageY-s.touches[1].pageY),t=eS,eF(!0),setTimeout(()=>eF(!1),2e3))},a=s=>{if(2===s.touches.length){s.preventDefault();let a=Math.hypot(s.touches[0].pageX-s.touches[1].pageX,s.touches[0].pageY-s.touches[1].pageY),r=a/e,l=Math.max(eL,Math.min(eE,t*r));e_(l)}},r=ea.current;if(r&&W)return r.addEventListener("touchstart",s,{passive:!1}),r.addEventListener("touchmove",a,{passive:!1}),()=>{r.removeEventListener("touchstart",s),r.removeEventListener("touchmove",a)}},[W,eS,eL,eE]),(0,r.useEffect)(()=>{W&&(e_(1),eF(!0),setTimeout(()=>eF(!1),3e3))},[W]);let eX=async e=>{let s=new FormData;s.append("pan_upload",e);try{let a=await h.Z.post("".concat(t,"/upload"),s,{headers:{"Content-Type":"multipart/form-data"}}),r=a.data.pan_upload.imageUrl;V(r)}catch(l){console.error(l)}},eV=()=>{if(!ea.current||!er.current)return;let e=ea.current,t=er.current,s=t.getContext("2d"),a=e.videoWidth,r=e.videoHeight;t.width=a,t.height=r;let l=a/eS,i=r/eS;s.clearRect(0,0,a,r),s.drawImage(e,(a-l)/2,(r-i)/2,l,i,0,0,a,r),t.toBlob(t=>{if(t){let s=URL.createObjectURL(t);if(es(s),Y(t),eX(t),A(!1),e.srcObject){let a=e.srcObject.getTracks();a.forEach(e=>e.stop()),e.srcObject=null}document.body.classList.remove("camera-open")}},"image/jpeg",.8)};return(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("div",{className:"bg-white shadow-sm flex items-center",children:(0,a.jsx)("div",{className:"w-full mx-auto p-2",children:(0,a.jsxs)("div",{className:"relative flex items-center",children:[(0,a.jsxs)("div",{className:"w-full flex relative",children:[(0,a.jsx)("span",{className:"absolute left-4 top-1/2 transform -translate-y-1/2 text-lg text-primary z-10",children:(0,a.jsx)("i",{className:"fas fa-search"})}),(0,a.jsx)("input",{id:"search_field",name:"search_field",className:"block w-full h-10 pl-12 pr-20 py-2 border border-primary bg-white text-sm placeholder-gray-500 focus:outline-none focus:placeholder-gray-400 focus:ring-1 focus:ring-primary focus:border-primary min-h-[40px]",placeholder:k&&y[w]?"Search for ".concat(y[w]):"Search",type:"search",value:g,onChange:ew,onBlur:ek,onFocus:eC}),(null==v?void 0:v.image_search_status)==1&&(0,a.jsx)("button",{type:"button",className:"absolute right-[5rem] top-1/2 transform -translate-y-1/2 text-primary hover:text-primary-dark z-20 p-1",onClick:ec,title:"Search by Image",children:(0,a.jsx)("img",{src:"/images/google-lens.svg",alt:"Google Lens Icon",className:"w-5 h-5"})}),(0,a.jsx)("button",{type:"submit",onClick:eb,className:"absolute right-0 top-0 bottom-0 bg-primary border border-primary text-white px-3 text-sm font-medium hover:bg-transparent hover:text-primary transition",disabled:!g,children:"Search"})]}),M&&(0,a.jsx)("ul",{className:"absolute top-full left-0 z-50 w-full bg-white border border-primary border-t-0 shadow-lg max-h-60 overflow-y-auto",children:z.length>0?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("li",{className:"px-4 py-2 bg-gray-100 text-xs text-gray-700 font-semibold select-none",children:"Recommended Suggestions"}),z.map(e=>(0,a.jsx)("li",{onClick:()=>eN(e.redirect_link),className:"px-4 py-2 cursor-pointer hover:bg-primary hover:text-white transition",children:e.product_category},e.search_suggestion_id))]}):(0,a.jsx)("li",{className:"px-4 py-2 text-gray-500 text-center select-none",children:"No suggestions foun
1d"})})]})})}),O&&(0,a.jsx)("div",{className:"fixed inset-0 bg-black bg-opacity-90 z-50 flex flex-col",children:R||W?R&&!W?(0,a.jsxs)("div",{className:"flex-1 bg-white",children:[(0,a.jsx)("div",{className:"p-4 border-b border-gray-200",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)("button",{onClick:ed,className:"flex items-center text-primary",children:[(0,a.jsx)(u.x_l,{className:"mr-2"}),"Back"]}),(0,a.jsx)("h2",{className:"text-lg font-semibold",children:U}),(0,a.jsx)("button",{onClick:eu,className:"text-gray-500",children:(0,a.jsx)(u.aHS,{size:24})})]})}),X&&(0,a.jsxs)("div",{className:"p-4",children:[(0,a.jsxs)("div",{className:"mb-4 flex flex-col items-center",children:[(0,a.jsx)("div",{className:"w-full max-w-xs mx-auto rounded-lg overflow-hidden border-2 transition \n ".concat(Z?"border-primary bg-gray-50":"border-gray-200 bg-gray-100"),style:{minHeight:"12rem"},children:Z?(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center h-48",children:[(0,a.jsxs)("svg",{className:"animate-spin h-8 w-8 text-primary mb-2",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),(0,a.jsx)("p",{className:"text-gray-600 text-sm",children:"Uploading..."})]}):X?(0,a.jsx)("img",{src:X,alt:"Preview",className:"w-full h-48 object-contain"}):(0,a.jsx)("div",{className:"flex items-center justify-center h-48",children:(0,a.jsx)("p",{className:"text-gray-400 text-sm",children:"No image uploaded yet"})})}),!Z&&X&&(0,a.jsxs)("p",{className:"text-center text-sm text-gray-600 mt-2",children:["â Image uploaded successfully for ",U]})]}),(0,a.jsxs)("div",{className:"space-y-3",children:[(0,a.jsx)("button",{type:"button",onClick:ep,disabled:Z,className:"w-full bg-blue-600 text-white py-3 px-4 rounded-lg hover:bg-blue-700 transition font-medium disabled:opacity-50 flex items-center justify-center",children:"Search Similar Products"}),(0,a.jsxs)("div",{className:"flex gap-2",children:[(0,a.jsx)("button",{onClick:()=>{es(null),Y(null),V(null),em()},className:"flex-1 bg-gray-500 text-white py-2 px-4 rounded-lg hover:bg-gray-600 transition",children:"Retake"}),(0,a.jsx)("button",{onClick:ef,className:"flex-1 bg-green-600 text-white py-2 px-4 rounded-lg hover:bg-green-700 transition",children:"Choose Different"})]})]})]}),!X&&(0,a.jsxs)("div",{className:"p-4 space-y-4",children:[(0,a.jsxs)("button",{onClick:em,className:"w-full flex items-center justify-center p-4 border-2 border-dashed border-gray-300 rounded-lg hover:border-primary transition",children:[(0,a.jsx)(u.JAc,{className:"mr-3 text-2xl text-primary"}),(0,a.jsx)("span",{className:"text-lg",children:"Take Photo"})]}),(0,a.jsx)("button",{onClick:Z?void 0:ef,disabled:Z,className:"w-full flex items-center justify-center p-4 border-2 border-dashed rounded-lg transition\n ".concat(Z?"border-primary bg-gray-50 cursor-not-allowed":"border-gray-300 hover:border-primary"),children:Z?(0,a.jsxs)(a.Fragment,{children:[(0,a.jsxs)("svg",{className:"animate-spin h-5 w-5 text-primary mr-3",xmlns:"http://www.w3.org/2000/svg",fill:"none",viewBox:"0 0 24 24",children:[(0,a.jsx)("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),(0,a.jsx)("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8v4a4 4 0 00-4 4H4z"})]}),(0,a.jsx)("span",{className:"text-lg text-gray-600",children:"Uploading..."})]}):(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)(u.DUB,{className:"mr-3 text-2xl text-primary"}),(0,a.jsx)("span",{className:"text-lg",children:"Upload from Gallery"})]})})]}),(0,a.jsx)("input",{ref:el,type:"file",accept:"image/*",onChange:eg,className:"hidden"})]}):W?(0,a.jsxs)("div",{className:"fixed inset-0 bg-black z-[9999] w-screen h-screen",style:{position:"fixed",top:0,left:0,right:0,bottom:0,width:"100vw",height:"100vh",zIndex:9999},children:[(0,a.jsx)("div",{className:"absolute top-0 left-0 right-0 z-20 bg-gradient-to-b from-black/70 to-transparent",children:(0,a.jsxs)("div",{className:"flex items-center justify-between text-white p-4 pt-8",children:[(0,a.jsxs)("button",{onClick:eh,className:"flex items-center bg-black/50 px-3 py-2 rounded-lg backdrop-blur-sm",children:[(0,a.jsx)(u.x_l,{className:"mr-2"}),"Back"]}),(0,a.jsxs)("h2",{className:"text-lg font-semibold",children:["Capture ",U]}),(0,a.jsx)("button",{onClick:eu,className:"bg-black/50 p-2 rounded-lg backdrop-blur-sm",children:(0,a.jsx)(u.aHS,{size:20})})]})}),(0,a.jsxs)("div",{className:"w-full h-full relative overflow-hidden",style:{width:"100vw",height:"100vh"}
1,children:[(0,a.jsx)("video",{ref:ea,autoPlay:!0,playsInline:!0,muted:!0,className:"w-full h-full object-cover",style:{width:"100%",height:"100%",objectFit:"cover",transform:"scale(".concat(eS,")"),transformOrigin:"center",transition:"transform 0.2s ease-out"}}),(0,a.jsx)("div",{className:"absolute right-4 top-1/2 transform -translate-y-1/2 z-20",style:{position:"absolute",right:"1rem",top:"50%",transform:"translateY(-50%)"},children:(0,a.jsxs)("div",{className:"flex flex-col space-y-3 bg-black/50 rounded-full p-2 backdrop-blur-sm",children:[(0,a.jsx)("button",{onClick:eD,className:"w-12 h-12 bg-white/20 rounded-full flex items-center justify-center text-white hover:bg-white/30 transition-colors disabled:opacity-50",disabled:eS>=eE,children:(0,a.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 6v6m0 0v6m0-6h6m-6 0H6"})})}),(0,a.jsx)("div",{className:"w-12 flex items-center justify-center",children:(0,a.jsxs)("div",{className:"text-white text-xs font-medium bg-black/50 px-2 py-1 rounded",children:[Math.round(10*eS)/10,"x"]})}),(0,a.jsx)("button",{onClick:eW,className:"w-12 h-12 bg-white/20 rounded-full flex items-center justify-center text-white hover:bg-white/30 transition-colors disabled:opacity-50",disabled:eS<=eL,children:(0,a.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M18 12H6"})})})]})})]}),(0,a.jsxs)("div",{className:"absolute bottom-0 left-0 right-0 z-30",style:{position:"absolute",bottom:"140px",left:0,right:0},children:[(0,a.jsx)("div",{className:"flex justify-center items-center mb-4",style:{display:"flex",justifyContent:"center",alignItems:"center",marginBottom:"1rem"},children:(0,a.jsxs)("button",{onClick:eV,className:"relative w-20 h-20 bg-white rounded-full flex items-center justify-center shadow-2xl transform active:scale-95 transition-transform duration-150",children:[(0,a.jsx)("div",{className:"w-16 h-16 bg-gray-100 rounded-full flex items-center justify-center border-4 border-gray-300",children:(0,a.jsx)(u.Dmm,{className:"text-gray-600 text-2xl"})}),(0,a.jsx)("div",{className:"absolute inset-0 bg-white rounded-full animate-pulse opacity-30"})]})}),(0,a.jsxs)("div",{className:"flex justify-between items-center px-8",children:[(0,a.jsxs)("button",{onClick:eP,className:"w-12 h-12 rounded-full flex items-center justify-center backdrop-blur-sm transition-all duration-300 ".concat(eT?"bg-yellow-500 shadow-lg shadow-yellow-500/50 scale-110":"bg-white/20 hover:bg-white/30"),children:[(0,a.jsx)("svg",{className:"w-6 h-6 transition-colors ".concat("text-white"),fill:eT?"currentColor":"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M13 10V3L4 14h7v7l9-11h-7z"})}),eT&&(0,a.jsx)("div",{className:"absolute -top-1 -right-1 w-3 h-3 bg-yellow-300 rounded-full animate-pulse"})]}),(0,a.jsx)("div",{className:"w-12"}),(0,a.jsxs)("button",{onClick:eY,className:"w-12 h-12 bg-white/20 hover:bg-white/30 rounded-full flex items-center justify-center backdrop-blur-sm transition-all duration-300 hover:scale-105",children:[(0,a.jsx)("svg",{className:"w-6 h-6 text-white",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24",children:(0,a.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M4 4v5h.582m15.356 2A8.001 8.001 0 004.582 9m0 0H9m11 11v-5h-.581m0 0a8.003 8.003 0 01-15.357-2m15.357 2H15"})}),(0,a.jsx)("div",{className:"absolute -bottom-1 -right-1 text-[8px] text-white bg-black/50 px-1 rounded",children:"environment"===eI?"B":"F"})]})]})]}),(0,a.jsx)("canvas",{ref:er,className:"hidden"})]}):null:(0,a.jsxs)("div",{className:"flex-1 bg-white",children:[(0,a.jsx)("div",{className:"p-4 border-b border-gray-200",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsx)("h2",{className:"text-lg font-semibold",children:"Select Category"}),(0,a.jsx)("button",{onClick:eu,className:"text-gray-500",children:(0,a.jsx)(u.aHS,{size:24})})]})}),(0,a.jsx)("div",{className:"p-4 space-y-3",children:["Bangle","Haram","Earring","Chain"].map(e=>(0,a.jsx)("button",{onClick:()=>eo(e),className:"w-full p-4 text-left hover:bg-primary hover:text-white transition rounded-lg border border-gray-200 text-lg",children:e},e))})]})}),(0,a.jsx)(x,{isOpen:$,onClose:()=>{ee(!1),eA(!0)},searchResults:K,isSearching:J})]})}}}]);
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.