1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[103],{7720:function(e,s,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/similarity-comparison/response",function(){return a(8428)}])},8428:function(e,s,a){"use strict";a.r(s),a.d(s,{default:function(){return E}});var t,r=a(5893),l=a(5476),i=a(1163),n=a(7294),o=a(9352),c=a(312),d=a(6071),m=a(1664),x=a.n(m);let u=e=>{let{statusCode:s}=e;return(0,r.jsx)("div",{className:"flex min-h-screen items-center justify-center bg-gray-100",children:(0,r.jsxs)("div",{className:"text-center",children:[(0,r.jsx)("h1",{className:"mb-4 text-6xl font-bold text-red-500",children:s}),(0,r.jsx)("h2",{className:"mb-4 text-2xl font-semibold text-gray-700",children:{401:"Unauthorized",403:"Forbidden",404:"Page Not Found",500:"Internal Server Error",502:"Bad Gateway"}[s]||"An unexpected error has occurred"}),(0,r.jsx)("p",{className:"mb-6 text-gray-600",children:"Something went wrong on our end. Our team is working on it. Please try again later."}),(0,r.jsx)(x(),{href:"/",className:"rounded-md bg-blue-500 px-6 py-2 text-white shadow-sm transition duration-200 hover:bg-blue-600",children:"Go Home"})]})})};var h=a(9839),p=a(878),f=a(7314),y=a(4951),j=a(4414),b=a(9286),g=a(6406),v=a(3481),N=a(4637),w=a(9118),_=a(9525),k=a(8866),S=a(7657),C=a(7042);let Z=e=>{let{title:s,name:a,serial_number:l,filed_on:i,classes:o}=e;return(0,r.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,r.jsxs)("div",{className:" flex w-full flex-col space-y-3 rounded-xl px-4 ",children:[(0,r.jsx)("h4",{className:"text-cool-grays-400 text-cool-gray-400 text-sm font-semibold leading-5",children:s}),(0,r.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,r.jsx)("div",{className:"relative flex h-[80px] w-[80px] items-center justify-center rounded-lg bg-white text-white",children:(0,r.jsx)(b.Z,{unoptimized:!0,fill:!0,style:{objectFit:"contain"},alt:a,fallbackSrc:"https://static.trademarkia.com/images/no-image.png",src:"https://static.trademarkia.com/images/".concat(l)})}),(0,r.jsxs)("div",{className:"flex flex-1 flex-col space-y-4",children:[(0,r.jsx)("p",{className:"text-lg font-semibold leading-5 text-white",children:a}),(0,r.jsxs)("div",{className:"flex w-full items-center justify-between space-x-2",children:[(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-cool-gray-400 text-sm font-semibold leading-5",children:"Serial Number"}),(0,r.jsx)("p",{className:"text-success",children:l})]}),(0,r.jsxs)("div",{children:[(0,r.jsx)("p",{className:"text-cool-gray-400 text-sm font-semibold leading-5",children:"Filed On"}),(0,r.jsx)("p",{className:"text-white",children:i})]})]})]})]})]}),(0,r.jsxs)("div",{className:" flex w-full flex-col space-y-3 rounded-xl px-4 ",children:[(0,r.jsx)("h4",{className:"text-cool-gray-400 text-sm font-semibold leading-5",children:"Classes"}),(0,r.jsx)("div",{className:"flex flex-wrap gap-2",children:o.map(e=>{var s;return(0,r.jsx)(v.ClassTag,{class_name:e.class_name,class_number:e.class_number,class_type:e.class_type,id:e.id,Icon:null!==(t=null===(s=d.xt.find(s=>s.id===e.id))||void 0===s?void 0:s.Icon)&&void 0!==t?t:n.Fragment},e.id)})})]})]})};function E(){var e,s,a,t,m,b,E,O,P;let q=(0,i.useRouter)(),{mark1:F,mark2:R,input:T}=q.query,[A,M]=(0,n.useState)(""),[I,z]=(0,n.useState)(null),[B,G]=(0,n.useState)(!1),{prefetchUser:D,userPlan:J}=(0,C.a)(),L=async(e,s)=>{let a={"Content-Type":"application/json",Authorization:"Bearer ".concat(localStorage.getItem("profile_token"))};try{let r=await fetch((0,N.n4)("/trademark/oa_stream"),{method:"POST",headers:a,body:JSON.stringify({serial_numbers:[e,s]})});if("opaque"===r.type||"opaqueredirect"===r.type){console.error("CORS error occurred");return}if(200!==r.status)console.log(r),429===r.status&&G(!0);else{var t;let e=null===(t=r.body)||void 0===t?void 0:t.getReader(),s=new TextDecoder;null==e||e.read().then(async function a(t){let{done:r,value:l}=t;if(r){console.log("Stream complete");return}let i=s.decode(l);return z(e=>e?"".concat(e).concat(i):i),e.read().then(a)})}}catch(e){console.error("Error fetching data:",e)}},[{data:Q,error:X}]=(0,c.G)(async()=>
1{if(!F||!R)return{data:null,error:!1};let e=await (0,w.Sx)({data:{serial_numbers:[parseFloat(F),parseFloat(R)]}});return!e||e.err?{data:null,error:e.err}:{data:e,error:!1}},[F,R],{defaultValue:{data:null,error:!1}});(0,n.useEffect)(()=>{F&&R&&!X&&Q&&L(F,R)},[F,R,X,Q]);let Y=(0,n.useMemo)(()=>{if(!Q)return[];let e=null==Q?void 0:Q.data.search_response[0].body.trademark_classification,s=new Map;for(let a of e){let e=a.primary_code.slice(1),t=d.xt.find(s=>s.class_number.toString()===e);void 0!==t&&s.set(t.class_number,t)}return Array.from(s.values())},[Q]),U=(0,n.useMemo)(()=>{if(!Q)return[];let e=null==Q?void 0:Q.data.search_response[1].body.trademark_classification,s=new Map;for(let a of e){let e=a.primary_code.slice(1),t=d.xt.find(s=>s.class_number.toString()===e);void 0!==t&&s.set(t.class_number,t)}return Array.from(s.values())},[Q]);return((0,n.useEffect)(()=>{D()},[Q]),X)?(0,r.jsx)(u,{statusCode:500}):(console.log(B?"hasLimitReached":"noLimit"),(0,r.jsxs)(h.Z,{children:[(0,r.jsx)(p.Z,{}),B?(0,r.jsx)(S.Z,{noBackDrop:!0,open:B,children:(0,r.jsxs)("div",{className:"rounded-lg bg-white p-10 text-center shadow-lg",children:[(0,r.jsx)("h1",{className:"mb-4 text-2xl font-semibold text-gray-800",children:"You have reached the maximum limit of marks you can search for."}),(0,r.jsx)("p",{className:"mt-2 text-sm text-gray-600",children:"Please upgrade to a Pro account to access the tool with unlimited searches."}),(0,r.jsx)("button",{className:"mt-6",children:(0,r.jsx)(x(),{legacyBehavior:!0,href:"/pricing",children:(0,r.jsx)("a",{className:"rounded bg-blue-500 px-4 py-2 font-bold text-white transition duration-500 ease-in-out hover:bg-blue-700",children:"Upgrade to Pro"})})})]})}):null,(0,r.jsxs)("main",{className:"flex flex-col space-y-12 ".concat(B?"pointer-events-none blur-sm":""),children:[(0,r.jsx)("section",{className:"relative",children:(0,r.jsx)("div",{className:"bg-fill flex items-center justify-between py-4",children:(0,r.jsxs)("form",{className:"container mx-auto flex flex-wrap items-center justify-evenly space-x-4 md:justify-start",onSubmit:e=>{e.preventDefault(),q.push({pathname:"/similarity-comparison/compare",query:{q:A}})},children:[(0,r.jsx)(g.Z,{placeholder:"Search a trademark by name or serial number",startAdornment:(0,r.jsx)(o.Qcu,{className:"h-5 w-5 text-white"}),className:"md:min-w-[350px]",name:"searchQuery",id:"searchQuery",value:A,onChange:e=>M(e.target.value)}),(0,r.jsx)(f.z,{className:"!px-8 !py-[24px] text-sm font-medium",variant:"fill",color:"primary",type:"submit",children:"Search"}),J?"ai_pro"===J.subscription_type?null:(0,r.jsx)(v.SearchCounter,{remainingSearches:51-J.counts.similarity_comparison_count,totalSearches:50}):(0,r.jsx)("div",{className:"text-gray-400",children:"Loading..."})]})})}),(0,r.jsx)("section",{children:(0,r.jsx)("div",{className:"container mx-auto flex items-center justify-between",children:(0,r.jsxs)("div",{className:"flex flex-col items-start space-x-4 md:flex-row md:items-center",children:[(0,r.jsxs)("div",{className:"border-blue-gray-100 flex items-center space-x-4 pr-4 md:border-r",children:[(0,r.jsx)(_.Z,{className:"hidden h-7 w-7 md:block"}),(0,r.jsx)("span",{className:"gradient-span text-md font-semibold leading-6 text-white md:text-[18px]",children:"Trademark Similarity Comparison"})]}),(0,r.jsx)("div",{children:(0,r.jsxs)("div",{className:"text-gray-light border-true-gray-900 bg-fill mt-4 flex items-center space-x-2 rounded-xl border px-4 py-2 font-semibold md:mt-0 ",children:[(0,r.jsx)(k.Z,{className:"h-5 w-5"}),(0,r.jsx)("span",{className:"text-sm font-semibold",children:"Comparison Report"})]})})]})})}),(0,r.jsx)("section",{children:(0,r.jsxs)("div",{className:"container relative mx-auto flex grid-cols-1 flex-col gap-4 px-4 md:grid md:grid-cols-12 md:space-x-6 md:px-0",children:[(0,r.jsx)("section",{className:"col-span-5 flex space-x-12",children:(0,r.jsxs)("div",{className:"sticky top-24 flex h-fit flex-col space-y-4",children:[(0,r.jsxs)(y.Z,{className:"flex-grow",title:(0,r.jsxs)("div",{className:"flex items-center justify-between",children:[(0,r.jsx)("h4",{className:"font-semibold leading-6 text-white",children:"Compare"}),(0,r.jsxs)("button",{onClick:()=>q.push({pathname:"/similarity-comparison/compare",query:{q:T||(null==Q?void 0:Q.data.search_response[0].body.mark_identification)}}),className:"text-secondary flex items-center space-x-1 text-sm font-semibold hover:text-white",children:[(0,r.jsx)(o.Jpt,{className:"h-5 w-5"}),(0,r.jsx)("span",{children:"Reset"})]})]}
1),children:[(0,r.jsx)(Z,{classes:Y,filed_on:(0,l.p6)((null==Q?void 0:null===(e=Q.data)||void 0===e?void 0:null===(s=e.search_response)||void 0===s?void 0:null===(a=s[0])||void 0===a?void 0:null===(t=a.body)||void 0===t?void 0:t.filing_date)||0),name:(null===(m=null==Q?void 0:Q.data.search_response[0])||void 0===m?void 0:null===(b=m.body)||void 0===b?void 0:b.mark_identification)||"",serial_number:(null===(E=null==Q?void 0:Q.data.search_response[0])||void 0===E?void 0:E.body.serial_number)||0,title:"Your Mark"}),(0,r.jsx)(j.Z,{icon:(0,r.jsx)("div",{className:"bg-cool-gray-900 flex h-8 w-8 items-center justify-center rounded-full",children:(0,r.jsx)(o.ZXJ,{className:"h-4 w-4 text-white"})})}),(0,r.jsx)(Z,{classes:U,title:"Comparing Mark",filed_on:(0,l.p6)(1e3*((null==Q?void 0:Q.data.search_response[1].body.filing_date)||0)),name:(null===(O=null==Q?void 0:Q.data.search_response[1])||void 0===O?void 0:null===(P=O.body)||void 0===P?void 0:P.mark_identification)||"",serial_number:(null==Q?void 0:Q.data.search_response[1].body.serial_number)||0})]}),(0,r.jsxs)("div",{className:"text-cool-gray-400 flex items-center space-x-2 text-xs font-semibold",children:[(0,r.jsx)(o.tbY,{className:"text-cool-gray-400 h-5 w-5"}),(0,r.jsx)("span",{children:"Comparison reports are generated based on the marks you have selected against your trademark"})]})]})}),(0,r.jsx)("section",{className:"col-span-7 flex flex-grow flex-col space-y-4",children:(0,r.jsxs)(y.Z,{className:"bg-fill",children:[(0,r.jsx)("div",{className:"border-border-gray-800 flex items-center justify-center rounded-[30px] border bg-[url(/svg/Oabackground.svg)] py-9 ",children:(0,r.jsx)("p",{className:"gradient-span",children:"AI Generated Comparison Report"})}),(0,r.jsx)("p",{className:"whitespace-pre-wrap px-2 py-4 text-white",children:I})]})})]})})]})]}))}}},function(e){e.O(0,[937,0,633,675,332,227,203,832,481,774,888,179],function(){return e(e.s=7720)}),_N_E=e.O()}]);
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.