1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[107],{299:(e,t,n)=>{n.d(t,{t:()=>l});var r=n(14351),i=n(57056),o=n(96930),a=n(70467);function l(){var e;let t=(0,o.Xs)(null!=(e=(0,i.usePathname)())?e:"");return(0,r.useCallback)(e=>(0,a.qo)(t,e),[t])}},11926:(e,t,n)=>{n.d(t,{_:()=>l});var r=n(60556),i=n(98834),o=n(99264);let a=(0,r.createBrowserClient)((()=>{let e="https://vmhufterblyhurbkgzky.supabase.co";return e.includes("host.docker.internal")?e.replace(/http:\/\/host\.docker\.internal/g,"http://localhost"):e})(),"eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZtaHVmdGVyYmx5aHVyYmtnemt5Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3MjA3MjQ3MDgsImV4cCI6MjAzNjMwMDcwOH0.btkvmZG3Jxdw17DHAPNsHdriHjnBT7zav8o04jkVr5M",{global:{fetch:async function(e){var t,n;let r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},a="https://vmhufterblyhurbkgzky.supabase.co",l="eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6InZtaHVmdGVyYmx5aHVyYmtnemt5Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3MjA3MjQ3MDgsImV4cCI6MjAzNjMwMDcwOH0.btkvmZG3Jxdw17DHAPNsHdriHjnBT7zav8o04jkVr5M";if(!a||!l||""===a.trim()||""===l.trim())throw Error("Supabase configuration is missing or empty. Please check NEXT_PUBLIC_SUPABASE_URL and NEXT_PUBLIC_SUPABASE_ANON_KEY environment variables.");let c=0;for(;!(null==(t=window.Clerk)?void 0:t.session)&&c<10;)await new Promise(e=>setTimeout(e,200)),c++;if(!(null==(n=window.Clerk)?void 0:n.session))throw console.error("Clerk session not available after multiple retries."),Error("Authentication session is not available. Please ensure you are signed in.");try{let t=(0,o.Y)(window.Clerk.organization,window.location.pathname);if(!t.inSync)throw console.error("[supabaseClient] Clerk org does not match the URL org",t),Error(o.u);let n=window.Clerk.session,a=await (0,i.C)({template:"supabase",expectedOrgId:t.orgId,mint:e=>n.getToken({template:"supabase",skipCache:e}),reassert:()=>n.touch()});if(!a)throw Error("Failed to get Supabase token from Clerk session.");let l=new Headers(null==r?void 0:r.headers);l.set("Authorization","Bearer ".concat(a));let c="string"==typeof e?e:e.toString();return c.includes("host.docker.internal")&&(c=c.replace(/http:\/\/host\.docker\.internal/g,"http://localhost")),await fetch(c,{...r,headers:l})}catch(e){throw console.error("Error in Supabase fetch:",e),e}}}}),l=()=>a},43870:(e,t,n)=>{n.d(t,{$:()=>s,r:()=>c});var r=n(51015),i=n(14351),o=n(32207),a=n(35332),l=n(74925);let c=(0,a.F)("inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0",{variants:{variant:{default:"bg-[hsl(var(--brand-cta))] text-white hover:bg-[hsl(var(--brand-cta-hover))]",destructive:"bg-destructive text-destructive-foreground hover:bg-destructive/90",outline:"border border-input bg-input-bg hover:bg-accent hover:text-accent-foreground",secondary:"bg-secondary text-secondary-foreground hover:bg-secondary/80",ghost:"hover:bg-accent hover:text-accent-foreground",link:"text-primary underline-offset-4 hover:underline"},size:{default:"h-10 px-4 py-2",sm:"h-9 rounded-md px-3",lg:"h-11 rounded-md px-8",icon:"h-10 w-10"}},defaultVariants:{variant:"default",size:"default"}}),s=i.forwardRef((e,t)=>{let{className:n,variant:i,size:a,asChild:s=!1,...u}=e,d=s?o.DX:"button";return(0,r.jsx)(d,{className:(0,l.cn)(c({variant:i,size:a,className:n})),ref:t,...u})});s.displayName="Button"},61427:(e,t,n)=>{function r(e){return e||(e="us"),String.fromCodePoint(...e.toUpperCase().split("").map(e=>127397+e.charCodeAt(0)))}function i(e){return new Intl.DisplayNames(["en"],{type:"region"}).of(e)}function o(e){return e?e.startsWith("http://")||e.startsWith("https://")?e:"https://".concat(e):e}function a(e){let t=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(!e)return e;let n=e.replace(/^https?:\/\//,"");return n=n.replace(/^www\./,""),t||(n=n.replace(/\/$/,"")),n}function l(e,t){return(null==e?void 0:e.active_url)||(null==e?void 0:e.url_override)||(null==e?void 0:e.url)||t||""}n.d(t,{B8:()=>h,Eq:()=>p,Gc:()=>A,It:()=>m,KV:()=>b,NQ:()=>v,RG:()=>i,Ss:()=>l,VA:()=>u,XM:()=>g,cq:()=>a,cx:()=>o,qJ:()=>c,xg:()=>r,y_:()=>s}),n(37811);let c=e=>e?e.replace(/^https?:\/\/[^.]+\.s3\.amazonaws\.com\//,""):"",s=e=>{if(!e)return"";let t=e.split("/");if(t.some(e=>""===e)){let e=[];for(let n of t)""===n?e.push("%2F"):e.push(encodeURIComponent(n.trim()));return e.join("/").replace(/\/%2F\//g,"/%2F")}return e.split("/").map(e=>""===e?"":encodeURIComponent(e.trim())).join("/")};function u(e){return e?"".concat("https://d2z55ssxzfn8g4.cloudfront.net","/").concat(s(c(e))):void 0}function d(e){if(!e)return null;let t=e.match(/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:[^/\n\s]+\/\S+\/|(?:v|e(?:mbed)?)\/|\S*?[?&]v=)|youtu\.be\/)([a-zA-Z0-9_-]{11})/);return t&&t[1]?t[1]:null}function p(e){let t=d(e);return t?"https://www.youtube.com/embed/".concat(t):null}function h(e){let t=d(e);return t?"https://img.youtube.com/vi/".concat(t,"/hqdefault.jpg"):null}let g=e=>{if(!e||"string"!=typeof e)return"";try{let t=e.replace(/^https?:\/\/(www\.)?/,"").replace(/\/$/,"");if(!t)return"";return t.replace(/\.com$/,"").split(".").map(e=>e.charAt(0).toUpperCase()+e.slice(1)).join(" ")}catch(t){return console.warn("Error processing URL in getWebsiteName: ".concat(e),t),""}},f=e=>e.toLowerCase().replace(/[''`´]/g,"").replace(/[^\w\s]/g," ").replace(/\s+/g," ").trim(),m=(e,t)=>
1{if(!e||!t)return!1;let n=f(e),r=f(t);if(r.includes(n))return!0;let i=n.split(/\s+/).filter(e=>e.length>0);if(i.length>1)return i.every(e=>r.includes(e));let o=r.split(/\s+/);return o.some(e=>e.includes(n)||n.includes(e)||o.some((t,r)=>r!==o.indexOf(e)&&(e+t).includes(n)))};function b(){{let e=window.location.hostname;return"app.shopvision.ai"===e||("localhost"===e||"127.0.0.1"===e||e.includes("staging")||e.includes("preview")||e.includes("vercel.app"),!1)}}function v(e){return e.first_name&&e.last_name?"".concat(e.first_name.charAt(0)).concat(e.last_name.charAt(0)).toUpperCase():e.first_name?e.first_name.charAt(0).toUpperCase():e.email.charAt(0).toUpperCase()}let w="https://cdn.brandfetch.io",y="1id54OahSnAcq3p8gh9";function A(e){let t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:80;if(!w||!y)return null;let n=a(e).split("/")[0];return n?"".concat(w,"/").concat(n,"/w/").concat(t,"/h/").concat(t,"?c=").concat(y):null}},70467:(e,t,n)=>{n.d(t,{DF:()=>l,RC:()=>o,qo:()=>a,z:()=>c});let r=new Set(["inbox","agent","competitive-scorecard","acquisition","explorers","ads-explorer","email-explorer","promotions-explorer","social-explorer","time-machine","swipe-files","price-intelligence","wholesale-intelligence","wholesale-intelligence-v2","monday-meeting","push-notifications","settings","agency-settings","team","integrations","knowledge"]),i=["/internal/plg-report"];function o(e){try{return decodeURIComponent(e)}catch(t){return e}}function a(e,t){return!e||!t.startsWith("/")||t.startsWith("//")||!function(e){let t=e.split(/[?#]/)[0],n=t.split("/");if(n.some(e=>{let t=o(e);return"."===t||".."===t}))return!1;let a=n[1];return r.has(a)||i.some(e=>t===e||t.startsWith("".concat(e,"/")))}(t)?t:"".concat(e).concat(t)}function l(e){var t;let n=null==(t=e.match(/^\/orgs\/([^/?#]+)/))?void 0:t[1];return n?o(n):null}function c(e,t){return!!e&&(!!e.slug&&e.slug===t||!!e.id&&e.id===t)}},74925:(e,t,n)=>{n.d(t,{aX:()=>a,cn:()=>o});var r=n(18162),i=n(59787);function o(){for(var e=arguments.length,t=Array(e),n=0;n<e;n++)t[n]=arguments[n];return(0,i.QP)((0,r.$)(t))}function a(e){if(!e)return"";try{let t=e.startsWith("http")?e:"https://".concat(e);return new URL(t).hostname.replace("www.","")}catch(e){return""}}n(61427)},96930:(e,t,n)=>{n.d(t,{$R:()=>F,EW:()=>N,Os:()=>_,RF:()=>z,Tt:()=>U,Vg:()=>M,Xs:()=>E,mi:()=>S,sT:()=>P,v9:()=>j,wS:()=>B});var r=n(99417),i=n(77388),o=n(83150),a=n(89494),l=n(19293),c=n(15861),s=n(50167),u=n(33170),d=n(70212),p=n(67669),h=n(9062),g=n(8523),f=n(70286),m=n(18857),b=n(38654),v=n(59842),w=n(62649),y=n(81649),A=n(18385),k=n(62767),I=n(91470),x=n(21489),C=n(70467);let _="/inbox",S="/";function j(e){let t=e.match(/^\/orgs\/[^/]+(\/.*)?$/);return t?t[1]||"/":e}function E(e){let t=e.match(/^\/orgs\/[^/]+/);return t?t[0]:""}function P(e){let t=e.match(/^\/orgs\/([^/]+)/);return t?(0,C.RC)(t[1]):null}function M(e,t){return t?"".concat(e).concat(e.includes("?")?"&":"?","org_id=").concat(encodeURIComponent(t)):e}let O="/settings?tab=my-catalog",z=[{id:"inbox",label:"Inbox",href:"/inbox",icon:r.A,group:"utility"},{id:"agent",label:"Agent",href:"/agent",icon:i.A,group:"utility"},{id:"competitive-scorecard",label:"Competitive Pulse",href:"/competitive-scorecard",icon:o.A,group:"marketing"},{id:"acquisition",label:"Acquisition",href:"/acquisition",icon:a.A,group:"marketing",badge:"new",featureFlag:"acquisition",lockedBehavior:"hide"},{id:"brand-voice",label:"Brand Voice",href:"/brand-voice",icon:l.A,group:"marketing",betaOnly:!0,betaFeatureId:"brand_voice"},{id:"explorers",label:"Explorers",href:"/explorers",icon:c.A,group:"marketing"},{id:"time-machine",label:"Time Machine",href:"/time-machine",icon:s.A,group:"marketing"},{id:"swipe-files",label:"Swipe Files",href:"/swipe-files",icon:u.A,group:"marketing"},{id:"price-intelligence",label:"Pricing",href:"/price-intelligence",icon:d.A,group:"pricing",subItems:[{id:"pi-matches",label:"Matching",href:"/price-intelligence",icon:p.A},{id:"pi-reporting",label:"Analytics",href:"/price-intelligence?view=dashboards",icon:h.A,activeParam:{key:"view",value:"dashboards"}},{id:"pi-exports",label:"Exports",href:"/price-intelligence?view=exports",icon:g.A,activeParam:{key:"view",value:"exports"}},{id:"pi-my-catalog",label:"My Catalog",href:O,icon:f.A,crossLink:"Account Settings",adminOnly:!0}]},{id:"assortment-catalog",label:"Assortment & Catalog",href:"/explorers/catalog",icon:m.A,group:"catalog",subItems:[{id:"ac-products",label:"Products",href:"/explorers/catalog",icon:m.A},{id:"ac-collections",label:"Collections / Categories",href:"/explorers/catalog?tab=collections",icon:b.A,activeParam:{key:"tab",value:"collections"}},{id:"ac-analytics",label:"Analytics",href:"/explorers/catalog?view=dashboards",icon:h.A,activeParam:{key:"view",value:"dashboards"}}]},{id:"wholesale-intelligence",label:"Wholesale & MAP",href:"/wholesale-intelligence",icon:v.A,group:"wholesale",subItems:[{id:"wi-matching",label:"Matching",href:"/wholesale-intelligence",icon:p.A},{id:"wi-summary",label:"Violations Summary",href:"/wholesale-intelligence?summary=1",icon:w.A,activeParam:{key:"summary",value:"1"}},{id:"wi-exports",label:"Exports",href:"/wholesale-intelligence?exports=1",icon:g.A,activeParam:{key:"exports",value:"1"}},{id:"wi-my-catalog",label:"My Catalog",href:O,icon:f.A,crossLink:"Account Settings",adminOnly:!0}]}],U=[{id:"settings",label:"Account Settings",href:"/settings",icon:f.A,section:"account"},{id:"agency-settings",label:"Agency settings",href:"/agency-settings",icon:y.A,section:"account"},{id:"team",label:"My Team",href:"/team",icon:A.A,section:"team"},{id:"profile",label:"Profile",href:"/profile",icon:k.A,section:"team"},{id:"sign-out",label:"Log Out",href:"/sign-out",icon:I.A,section:"sign-out"}],R={...Object.fromEntries(z.filter(e=>e.href).map(e=>[e.href,e.label])),...Object.fromEntries(U.filter(e=>e.href).map(e=>[e.href,e.label])),"/accounts":"Accounts","/sign-in":"Sign In","/integrations":"Integrations","/internal/plg-report":"PLG Report Generator","/knowledge":"Knowledge"},J={...Object.fromEntries(z.filter(e=>e.href).map(e=>[e.href,e.icon])),...Object.fromEntries(U.filter(e=>e.href).map(e=>[e.href,e.icon])),"/knowledge":x.A};function N(e,t){if(t)return"catalog"===t;let n=j(e);return"/explorers/catalog"===n||n.startsWith("/explorers/catalog/")}function V(e,t){if(void 0!==e[t])return e[t];let n="";for(let r of Object.keys(e))r&&r.length>n.length&&(t.startsWith(r+"/")||t.startsWith(r+"?"))&&(n=r);return n?e[n]:void 0}function B(e){var t;return null!=(t=V(R,j(e)))?t:"Agent"}function F(e){var t;return null!=(t=V(J,j(e)))?t:i.A}},98834:(e,t,n)=>{function r(e){let t=e.split(".")[1];if(!t)return null;try{var n,r;let e=t.replace(/-/g,"+").replace(/_/g,"/"),i=JSON.parse(atob(e.padEnd(e.length+(4-e.length%4)%4,"="))),o=null!=(r=null==i||null==(n=i.app_metadata)?void 0:n.account_id)?r:null==i?void 0:i.org_id;return"string"==typeof o&&""!==o?o:null}catch(e){return null}}async function i(e){let{template:t,expectedOrgId:n,mint:i,reassert:o,attempts:a=3,delayMs:l=250}=e,c=await i(!1);if(!c||!n)return c;let s=r(c);for(let e=1;s!==n&&e<a;e+=1){if(console.warn("[orgBoundToken] template token minted for another org â re-minting",{template:t,expectedOrgId:n,tokenOrgId:s,attempt:e}),o)try{await o()}catch(e){console.warn("[orgBoundToken] could not re-assert the active org",e)}if(await new Promise(t=>setTimeout(t,l*e)),!(c=await i(!0)))return null;s=r(c)}return s!==n?(console.error("[orgBoundToken] refusing a template token for another org",{template:t,expectedOrgId:n,tokenOrgId:s}),null):c}n.d(t,{C:()=>i})}
1,99264:(e,t,n)=>{n.d(t,{Y:()=>i,u:()=>o});var r=n(70467);function i(e,t){var n,i,o;let a=(0,r.DF)(t);return a?(0,r.z)(e,a)?{inSync:!0,orgId:null!=(i=null==e?void 0:e.id)?i:null}:{inSync:!1,urlOrg:a,clerkOrgId:null!=(o=null==e?void 0:e.id)?o:null}:{inSync:!0,orgId:null!=(n=null==e?void 0:e.id)?n:null}}let o="This tab is no longer synced to the account in its URL. Reload the page and try again."}}]);
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.