1;!function(){try { var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof global?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&((e._debugIds|| (e._debugIds={}))[n]="4d038fc6-1a97-f40e-1e97-3c0eb64cc853")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,471818,e=>{"use strict";var t=e.i(391398),r=e.i(605628),a=e.i(469311),n=e.i(464500),s=e.i(847626),i=e.i(607649),o=e.i(432663),l=e.i(853062);e.s(["ShareListingModal",0,e=>{let{shareLink:c,emailBody:d,emailSubject:u}=(({featuredBusiness:e})=>{let t=e.customId||e._id,r=`${l.routes.PUBLIC_LISTING_BUSINESS}/${t}`,a=`${window.location.origin}${r}`,n=`Check out this business I found on Skip â ${e.businessName} ${a}`;return{shareLink:a,emailSubject:"Check out this business on Skip",emailBody:n}})(e),m=(0,r.useStore)(s.$isEmbedded),{buttonText:p,handleCopyLink:h}=(0,o.useCopyLinkButton)({link:c});return(0,t.jsxs)("div",{className:"flex w-full flex-col items-center space-y-4 rounded-2xl p-8","data-sentry-component":"ShareListingModal","data-sentry-source-file":"ShareListingModal.tsx",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center text-center",children:[(0,t.jsx)("div",{className:"mb-8 flex h-[100px] w-[100px] items-center justify-center rounded-2xl border border-gray-200 shadow-sm",children:(0,t.jsx)(n.HugeIcon,{strokeWidth:1,name:"TelegramIcon",className:"h-[50px] w-[50px] text-black","data-sentry-element":"HugeIcon","data-sentry-source-file":"ShareListingModal.tsx"})}),(0,t.jsx)("h2",{className:"mb-2 font-inter-display text-h6 font-semibold leading-7",children:"Share This Business"}),(0,t.jsx)("p",{className:"text-sm font-normal leading-5",children:"Share this business listing with a friend or colleague"})]}),(0,t.jsx)("hr",{className:"!mb-6 !mt-8 w-full border-gray-200"}),(0,t.jsxs)("div",{className:"!mt-0 flex w-full flex-col items-start justify-start space-y-4",children:[(0,t.jsx)("p",{className:"text-sm font-medium leading-6",children:"Share via"}),(0,t.jsxs)("div",{className:"flex w-full items-center justify-between",children:[!m&&(0,t.jsx)(i.ShareOnSocialMedia,{subject:u,shareLink:c,customLinkParams:{email:d}}),(0,t.jsx)(a.Button,{size:"xs",className:"px-2 text-xs",variant:"neutral",onClick:h,"data-sentry-element":"Button","data-sentry-source-file":"ShareListingModal.tsx",children:p})]})]})]})}])},180471,214495,203916,222289,657537,e=>{"use strict";e.s(["ChatPublicListingCard",()=>i],180471);var t,r=e.i(391398),a=e.i(58197),n=e.i(450584),s=e.i(191788);let i=({id:e})=>{let[t,i]=(0,s.useState)(null),[o,l]=(0,s.useState)(!0),[c,d]=(0,s.useState)(null);return((0,s.useEffect)(()=>{(async()=>{if(!e){console.error("ChatPublicListingCard: id is required"),d("Invalid listing ID"),l(!1);return}try{l(!0);let t=await (0,a.fetchFeaturedBusinessById)(e);t?i(t):(console.error("ChatPublicListingCard: Public listing not found:",e),d("Public listing not found"))}catch(e){console.error("ChatPublicListingCard: Error fetching listing:",e),d("Failed to load public listing")}finally{l(!1)}})()},[e]),o)?(0,r.jsxs)("div",{className:"animate-pulse rounded-2xl bg-gray-100 p-4",children:[(0,r.jsx)("div",{className:"aspect-[80/53] w-full rounded-t-2xl bg-gray-200"}),(0,r.jsxs)("div",{className:"mt-4 space-y-2",children:[(0,r.jsx)("div",{className:"h-4 rounded bg-gray-200"}),(0,r.jsx)("div",{className:"h-4 w-3/4 rounded bg-gray-200"})]})]}):c||!t?(0,r.jsx)("div",{className:"rounded-2xl border border-red-200 bg-red-50 p-4 text-center",children:(0,r.jsx)("p",{className:"text-sm text-red-600",children:c||"Unable to load public listing"})}):(0,r.jsx)("div",{className:"w-full min-w-0 max-w-[320px] flex-shrink-0","data-sentry-component":"ChatPublicListingCard","data-sentry-source-file":"ChatPublicListingCard.tsx",children:(0,r.jsx)(n.BusinessCardV2,{featuredBusiness:t,variant:"standard","data-sentry-element":"BusinessCardV2","data-sentry-source-file":"ChatPublicListingCard.tsx"})})};var o=e.i(605628),l=e.i(275885),c=((t={}).PLUS_SUBSCRIPTION="PLUS_SUBSCRIPTION",t.PRO_SUBSCRIPTION="PRO_SUBSCRIPTION",t.BUSINESS_PLAN="BUSINESS_PLAN",t.WEBSITE_BUILDER="WEBSITE_BUILDER",t.BUSINESS_VALUATION="BUSINESS_VALUATION",t.AGENT="AGENT",t.FEATURED_BUSINESS="FEATURED_BUSINESS",t),d=e.i(469311);e.i(753051);var u=e.i(593537),m=e.i(178644),p=e.i(949838),h=e.i(470867),f=e.i(373175),g=e.i(168541),y=e.i(465263),x=e.i(374801),v=e.i(387876);e.s(["ChatQuickActions",0,({items:e,upsellType:t,onActionClick:a})=>{let n=(0,o.useStore)(p.$hasBusinessPlanAccess),s=(0,g.useStoreSelector)(p.$activeOrPastDueOrTrialingPlusMembership,e=>!!e.value&&["active","trialing"].includes(e.value.status)),i=(0,g.useStoreSelector)(p.$featuredBusinessSubscription,e=>!!e.value&&["active","trialing"].includes(e.value.status)),b=(0,g.useStoreSelector)(p.$websiteBuilderSubscription,e=>!!e.value&&["active","trialing"].includes(e.value.status));if(!e)return console.warn("ChatQuickActions: items prop is undefined"),null;if(!Array.isArray(e))return console.error("ChatQuickActions: items prop must be an array, received:",typeof e,e),null;if(0===e.length)return null;let w=e.filter(e=>"string"==typeof e&&e.trim().length>0);if(0===w.length)return console.warn("ChatQuickActions: no valid string items found in:",e),null;t&&t.length!==w.length&&console.warn("ChatQuickActions: upsellType array length does not match items array length");let j=async(e,r)=>{try{let o=t?.[r];if(!o)return void a(e);switch(o){case c.PLUS_SUBSCRIPTION:if(s)return m.currentAiChatActions.sendMessage(`${e}`);try{await (0,x.openMembershipModal)({variation:"unlockPlus",purchaseMetadata:{section:"ai-chat-quick-action"}}),m.currentAiChatActions.sendMessage("I've upgraded to Plus!")}catch(t){console.log("Plus subscription upsell cancelled or failed:",t),m.currentAiChatActions.sendMessage(`I cancelled the "${e}" action`)}return;case c.BUSINESS_PLAN:if(n.value)return m.currentAiChatActions.sendMessage(`${e}`);try{await f.businessPlanModals.openModal("membersOnlySubmitApplicationModal"),m.currentAiChatActions.sendMessage("I've upgraded to Business Plan Subscription!")}catch(t){console.log("Business plan upsell cancelled or failed:",t),m.currentAiChatActions.sendMessage(`I cancelled the "${e}" action`)}return;case c.FEATURED_BUSINESS:if(i)return m.currentAiChatActions.sendMessage(`${e}`);try{let e=await (0,y.openBoostSliderModal)();if(e?.action!=="started")return;m.currentAiChatActions.sendMessage("I've upgraded to Featured Business Subscription!")}catch(t){if(t instanceof h.ModalError){console.log("Featured business upsell cancelled:",t.reason),m.currentAiChatActions.sendMessage(`I cancelled the "${e}" action`);return}l.captureException(t)}return;case c.WEBSITE_BUILDER:if(b)return m.currentAiChatActions.sendMessage(`${e}`);try{await (0,v.handleWebsiteBuilderUpsellGeneration)({onGenerate:async({onSuccess:t,onError:r})=>{try{m.currentAiChatActions.sendMessage(`${e}`),t("")}catch{r()}}})}catch(t){console.log("Website builder upsell cancelled or failed:",t),m.currentAiChatActions.sendMessage(`I cancelled the "${e}" action`)}return;case c.BUSINESS_VALUATION:console.warn(`Upsell type ${o} not yet fully implemented`),a(e);break;default:console.warn(`Unhandled upsell type: ${o}`),a(e)}}catch(t){console.error("ChatQuickActions: Error in handleActionClick:",t),m.currentAiChatActions.sendMessage(`An error occurred with the "${e}" action`)}};return(0,r.jsx)("div",{className:"flex flex-wrap gap-y-2 overflow-x-auto","data-sentry-component":"ChatQuickActions","data-sentry-source-file":"ChatQuickActions.tsx",children:w.map((e,t)=>(0,r.jsx)(d.Button,{variant:"secondary",size:"sm",onClick:()=>j(e,t),className:(0,u.cn)("bg-white","!h-[36px]","mr-2"),style:{fontSize:"16px"},children:e},`${e}-${t}`))})}],214495);var b=e.i(127630);e.s(["ChatUrlButton",0,({value:e,label:t})=>e&&t?"string"!=typeof e||"string"!=typeof t?(console.error("ChatUrlButton: value and label must be strings, received:",typeof e,typeof t),null):(0,r.jsxs)(d.Button,{variant:"secondary",size:"sm",onClick:()=>{try{let t=(()=>{let t=e.trim();if(t.startsWith("http://")||t.startsWith("https://"))return t;let r=`${window.location.protocol}//${window.location.host}`,a=t.startsWith("/")?"":"/";return`${r}${a}${t}`})();window.open(t,"_blank","noopener,noreferrer")}catch(e){console.error("ChatUrlButton: Error opening URL:",e)}},className:"mr-2 inline-flex items-center gap-2 bg-white",style:{fontSize:"16px"},"data-sentry-element":"Button","data-sentry-component":"ChatUrlButton","data-sentry-source-file":"ChatUrlButton.tsx",children:[t,(0,r.jsx)(b.ExternalLink,{className:"h-4 w-4","data-sentry-element":"ExternalLink","data-sentry-source-file":"ChatUrlButton.tsx"})]}):(console.warn("ChatUrlButton: both value and label are required"),null)],203916);var w=e.i(567573),j=e.i(123436),C=e.i(307854),S=e.i(434606),N=e.i(498817),P=e.i(198311),A=e.i(706770);let k=(0,A.atom)(["",null]),E=(0,A.atom)(()=>{}),I=()=>{let[e,t]=(0,o.useStore)(k);return(0,r.jsx)(N.AnimatePresence,{"data-sentry-element":"AnimatePresence","data-sentry-component":"HandoffModalContainer","data-sentry-source-file":"HandoffPrompt.tsx",children:e&&t&&(0,r.jsx)(P.motion.div,{initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},className:"pointer-events-none fixed left-0 top-0 z-10 flex h-full w-screen items-center justify-center transition-colors",children:(0,r.jsx)(P.motion.div,{initial:{scale:.9,opacity:0,x:100},animate:{scale:1,opacity:1,x:0},exit:{scale:.9,opacity:0,x:100},transition:{type:"spring",stiffness:300,damping:25},onClick:e=>e.stopPropagation(),className:"absolute right-3 top-[82px] z-10 h-fit min-h-[85svh] w-[400px] overflow-auto rounded-xl bg-white shadow-2xl",children:(0,r.jsxs)("div",{className:"pointer-events-auto relative flex h-full min-h-[85svh] flex-col",children:[t,(0,r.jsx)(P.motion.div,{className:"absolute right-6 top-6 cursor-pointer",whileHover:{scale:1.1},whileTap:{scale:.9},onClick:()=>{E.get()()},children:(0,r.jsx)(S.SkipIcon,{name:"replace"})})]})})})})};e.s(["HandoffPrompt",0,({value:e})=>{let[t,a]=(0,o.useStore)(k),n=(0,o.useStore)(j.$aiChatHandoffSystemPrompt),i=()=>{let[t,a]=(0,s.useState)(e||""),{toast:n}=(0,w.useToast)();(0,s.useEffect)(()=>{console.log("Modal updating editablePrompt with value:",e),a(e||"")},[e]);let i=()=>{a(e||"")};(0,s.useEffect)(()=>{E.set(i)},[e]);let o=async()=>{try{await navigator.clipboard.writeText(t),n({title:"Prompt copied",description:"Handoff prompt has been copied to clipboard",variant:"default"})}catch(e){console.error("Failed to copy: ",e),n({title:"Copy failed",description:"Failed to copy prompt to clipboard",variant:"destructive"})}};return(0,r.jsxs)("div",{className:"relative flex h-full max-h-[85svh] min-h-[85svh] flex-col","data-sentry-component":"HandoffSpecialistModal","data-sentry-source-file":"HandoffPrompt.tsx",children:[(0,r.jsx)("div",{className:"flex h-full flex-1 flex-col overflow-y-auto",children:(0,r.jsxs)("div",{className:"flex flex-1 flex-col p-6",children:[(0,r.jsx)("h1",{className:"mb-4 text-[18px] font-semibold",children:"Handoff Prompt"}),(0,r.jsx)("hr",{className:"my-6 border-neutral-100"}),(0,r.jsx)("div",{className:"mb-6 flex flex-1 flex-col",children:(0,r.jsx)("textarea",{value:t,onChange:e=>a(e.target.value),className:"mt-3 min-h-0 flex-1 resize-none rounded-lg border-transparent bg-primary-40 p-3 text-sm font-medium focus:outline-none",placeholder:"Enter the handoff system prompt...",style:{height:"100%"}})})]})}),(0,r.jsx)("div",{className:"sticky bottom-0 left-0 right-0 mx-8 mt-auto border-t border-neutral-100 bg-white py-4 shadow-sm",children:(0,r.jsxs)("div",{className:"flex justify-between",children:[(0,r.jsxs)(d.Button,{variant:"secondary",onClick:o,className:"gap-2","data-sentry-element":"Button","data-sentry-source-file":"HandoffPrompt.tsx",children:[(0,r.jsx)(S.SkipIcon,{name:"copy","data-sentry-element":"SkipIcon","data-sentry-source-file":"HandoffPrompt.tsx"}),"Copy"]}),(0,r.jsx)("div",{className:"flex gap-3",children:(0,r.jsx)(d.Button,{variant:"primary",onClick:()=>{console.log("Saving prompt:",t),j.$aiChatHandoffSystemPrompt.set(t),console.log("Prompt saved to store:",t),k.set(["",null])},"data-sentry-element":"Button","data-sentry-source-file":"HandoffPrompt.tsx",children:"Apply"})})]})})]})};return(0,s.useEffect)(()=>{console.log("HandoffPrompt useEffect triggered with value:",e),j.$aiChatHandoffSystemPrompt.set(e||""),console.log("Store updated with value:",e||"(empty)")},[e]),console.log("HandoffPrompt render - isProd:",C.isProd,"modalKey:",t,"currentHandoffPrompt:",n),(0,r.jsxs)(r.Fragment,{children:[!C.isProd&&n&&!t&&(0,r.jsx)(N.AnimatePresence,{children:(0,r.jsxs)(P.motion.div,{initial:{scale:0,rotate:-180},animate:{scale:1,rotate:0},exit:{scale:0,rotate:180},transition:{type:"spring",stiffness:260,damping:20},className:"fixed bottom-6 right-6 z-50",children:[(0,r.jsx)(P.motion.button,{onClick:()=>{var e;console.log("Floating button clicked - opening modal"),e=(0,r.jsx)(i,{}),k.set(["HandoffSpecialist",e])},className:"group relative",whileHover:{scale:1.05},whileTap:{scale:.95},children:(0,r.jsx)("div",{className:"flex h-14 w-14 items-center justify-center rounded-full bg-gradient-to-br from-blue-500 to-purple-600 text-white shadow-lg transition-shadow hover:shadow-xl",children:(0,r.jsx)(S.SkipIcon,{name:"settings",className:"h-6 w-6 flex-shrink-0"})})}),(0,r.jsxs)(P.motion.div,{initial:{opacity:0,x:20},whileHover:{opacity:1,x:0},className:"pointer-events-none absolute right-16 top-1/2 -translate-y-1/2 whitespace-nowrap rounded-lg bg-gray-800 px-3 py-1 text-sm text-white",children:["Handoff Specialist",(0,r.jsx)("div",{className:"absolute left-full top-1/2 -translate-y-1/2 border-4 border-transparent border-l-gray-800"})]})]})}),(0,r.jsx)(I,{"data-sentry-element":"HandoffModalContainer","data-sentry-source-file":"HandoffPrompt.tsx"})]})}],222289);var B=e.i(493525),O=e.i(464500),M=e.i(572361),D=e.i(776872),L=e.i(272225),T=e.i(343002);e.i(645726);var R=e.i(697491),_=e.i(434316);e.s(["ImageSelection",0,({section:e,keywords:t=[],images:a=[],onImageSelected:n,onKeywordSearch:i})=>
2{let[o,l]=(0,s.useState)(null),[c,p]=(0,s.useState)(!1),[h,f]=(0,s.useState)(null),[g,y]=(0,s.useState)(null),[x,v]=(0,s.useState)(1),[b,w]=(0,s.useState)(Array.isArray(t)?t.join(", "):""),[j,C]=(0,s.useState)(Array.isArray(t)?t:[]),[S,N]=(0,s.useState)(!1),[P,A]=(0,s.useState)([]),k=(e=>{let[t,r]=(0,s.useState)(e);return(0,s.useEffect)(()=>{let t=setTimeout(()=>{r(e)},500);return()=>{clearTimeout(t)}},[e,500]),t})(b),E=(0,s.useCallback)(async e=>{if(e.trim()){N(!0);try{let t=e.split(",").map(e=>e.trim()).filter(e=>e),r=await B.auth.currentUser?.getIdToken();if(!r)return void console.error("No authentication token available");let a=await fetch(`/api/image?search=${t.join(" ")}`,{headers:{"Content-Type":"application/json",Authorization:r}});if(!a.ok)throw console.error(a),Error(`Failed to fetch images: ${a.status}`);let n=await a.json();Array.isArray(n)&&A(n),C(t),i&&await i(t)}catch(e){console.error("Error searching images:",e)}finally{N(!1)}}},[i]);(0,s.useEffect)(()=>{k.trim()&&(v(1),E(k))},[k,E]),(0,s.useEffect)(()=>{Array.isArray(t)&&t.length>0&&0===P.length&&E(t.join(", "))},[t,E,P.length]),(0,s.useEffect)(()=>{Array.isArray(t)&&t.length>0&&w(t.join(", "))},[t]);let I=(0,s.useMemo)(()=>{let t=P.length>0?P:a&&Array.isArray(a)&&a.length>0?a:[];return Array.isArray(t)&&t.length>0?t.map(t=>({id:t.id?.toString()||Math.random().toString(),url:t.url||t.webformatURL||t.src,alt:t.tags||t.alt||`${e} image`,keywords:t.tags?t.tags.split(",").map(e=>e.trim()):j})):[]},[j,a,e,P]),z=(0,s.useMemo)(()=>{if(1===x)return I.slice(0,3);{let e=3+(x-2)*4;return I.slice(e,e+4)}},[I,x,4]);(0,s.useEffect)(()=>{v(1)},[4]);let{paginationRange:F,pageCount:U}=(0,D.usePagination)({totalCount:I.length+1,pageSize:4,currentPage:x,siblingCount:1}),$=(e,t)=>{l(e),"uploaded"!==e&&(f(null),y(null)),n?.(t,"uploaded"===e?"upload":"provider")},K=async e=>{try{let t=await (0,T.uploadUserDocument)({file:e,category:"IMAGE",source:"cofounder"});return(0,R.getDownloadURL)(t.fileRef)}catch(e){throw console.error("Error uploading to Firebase:",e),e}},H=async(e,t)=>{try{let r=await fetch(e);if(!r.ok)throw Error(`Failed to download image: ${r.status}`);let a=await r.blob(),n=e.split("."),s=n[n.length-1]?.split("?")[0]||"jpg",i=`${t}.${s}`;return new File([a],i,{type:a.type||"image/jpeg"})}catch(e){throw console.error("Error downloading image:",e),e}},W=async e=>{let t=e[0];if(t){p(!0);try{let e=new FileReader;e.onload=e=>{let t=e.target?.result;f(t),l("uploaded")},e.readAsDataURL(t);let r=await K(t);y(r),p(!1),n?.(r,"upload")}catch(e){console.error("Error uploading image:",e),p(!1)}}},V=(0,_.useDropzone)({maxFiles:1,maxSize:5242880,accept:["image/jpeg","image/jpg","image/png","image/gif","image/webp"],onDrop:W,onDropRejected:()=>{console.error("File rejected - either too large or invalid format")}}),G=async()=>{if("uploaded"===o&&g)return void m.currentAiChatActions.sendMessage(`I uploaded a custom ${e.toLowerCase()} image \xa7 hidden: (URL: ${g}) \xa7`);let t=o?I.find(e=>e.id===o):null;if(t){p(!0);try{let r=`${e.toLowerCase()}-image-${Date.now()}`,a=await H(t.url,r),n=await K(a);m.currentAiChatActions.sendMessage(`I selected the ${e.toLowerCase()} image \xa7 hidden: (URL: ${n}) \xa7`)}catch(r){console.error("Error uploading selected image to Firebase:",r),m.currentAiChatActions.sendMessage(`I selected the ${e.toLowerCase()} image \xa7 hidden: (URL: ${t.url}) \xa7`)}finally{p(!1)}}};return(0,r.jsxs)("div",{className:"rounded-lg border border-gray-200 bg-white p-4","data-sentry-component":"ImageSelection","data-sentry-source-file":"ImageSelection.tsx",children:[(0,r.jsxs)("div",{className:"mb-4",children:[(0,r.jsxs)("h3",{className:"text-lg font-semibold text-gray-900",children:["Choose ",e," Image"]}),(0,r.jsx)("p",{className:"text-sm text-gray-600",children:"Select from our curated images or upload your own"})]}),(0,r.jsxs)("div",{className:"mb-6",children:[(0,r.jsx)("h4",{className:"mb-3 text-sm font-medium text-gray-700",children:"Search by Keywords"}),(0,r.jsx)(M.Input,{"data-sentry-element":"Input","data-sentry-source-file":"ImageSelection.tsx",children:(0,r.jsxs)(M.Input.Container,{className:"relative","data-sentry-element":"Input.Container","data-sentry-source-file":"ImageSelection.tsx",children:[(0,r.jsx)(M.Input.Field,{type:"text",value:b,onChange:e=>w(e.target.value),placeholder:"Enter keywords separated by commas (e.g., business, team, modern)",disabled:S,"data-sentry-element":"Input.Field","data-sentry-source-file":"ImageSelection.tsx"}),S&&(0,r.jsx)(M.Input.Right,{children:(0,r.jsx)("div",{className:"h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-blue-600"})})]})})]}),(0,r.jsxs)("div",{className:"mb-6",children:[(0,r.jsx)("div",{className:"mb-4 flex items-center justify-end",children:I.length>0&&(0,r.jsxs)("span",{className:"text-xs text-gray-500",children:[I.length," images found"]}
2)}),S?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-4",children:[1===x&&(0,r.jsx)(L.Skeleton,{className:"aspect-square rounded-lg"}),Array.from({length:1===x?3:4}).map((e,t)=>(0,r.jsx)(L.Skeleton,{className:"aspect-square rounded-lg"},t))]}),(0,r.jsx)("div",{className:"mt-6 flex justify-start",children:(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)(L.Skeleton,{className:"h-9 w-12 rounded-md"}),(0,r.jsx)(L.Skeleton,{className:"h-9 w-9 rounded-md"}),(0,r.jsx)(L.Skeleton,{className:"h-9 w-9 rounded-md"}),(0,r.jsx)(L.Skeleton,{className:"h-9 w-9 rounded-md"}),(0,r.jsx)(L.Skeleton,{className:"h-9 w-12 rounded-md"})]})})]}):z.length>0||!b.trim()?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsxs)("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-4",children:[1===x&&(0,r.jsxs)("div",{className:(0,u.cn)("group relative aspect-square cursor-pointer overflow-hidden rounded-lg border-2 transition-all",h?"uploaded"===o?"border-blue-500 ring-2 ring-blue-200":"border-gray-200 hover:border-gray-300":"border-dashed border-primary-100 bg-primary-50 hover:border-primary-200",V.isDragActive&&"border-primary-300 bg-primary-100"),onClick:h?()=>$("uploaded",g||""):void 0,...!h?V.getRootProps():{},children:[(0,r.jsx)("input",{...V.getInputProps()}),h?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("img",{src:h,alt:"Uploaded",className:"aspect-square w-full object-cover transition-transform group-hover:scale-105"}),"uploaded"===o&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-blue-500 bg-opacity-20",children:(0,r.jsx)(O.HugeIcon,{name:"CheckmarkCircle02Icon",className:"h-6 w-6 rounded-full bg-white text-blue-600"})})]}):(0,r.jsx)("div",{className:"flex aspect-square w-full flex-col items-center justify-center text-gray-950",children:c?(0,r.jsx)("div",{className:"h-6 w-6 animate-spin rounded-full border-2 border-primary border-t-transparent"}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)("div",{className:"mb-2 flex h-10 w-10 items-center justify-center rounded-lg bg-white",children:(0,r.jsx)(O.HugeIcon,{name:"FolderUploadIcon",className:"h-5 w-5 text-primary"})}),(0,r.jsx)("span",{className:"px-2 text-center text-xs",children:V.isDragActive?"Drop image here":"Upload or drop image from your computer"})]})})]}),z.map(e=>(0,r.jsxs)("div",{className:(0,u.cn)("group relative aspect-square cursor-pointer overflow-hidden rounded-lg transition-all",o===e.id?"border-2 border-blue-500 ring-2 ring-blue-200":"hover:ring-2 hover:ring-gray-200"),onClick:()=>$(e.id,e.url),children:[(0,r.jsx)("img",{src:e.url,alt:e.alt,className:"aspect-square w-full object-cover transition-transform group-hover:scale-105"}),o===e.id&&(0,r.jsx)("div",{className:"absolute inset-0 flex items-center justify-center bg-blue-500 bg-opacity-20",children:(0,r.jsx)(O.HugeIcon,{name:"CheckmarkCircle02Icon",className:"h-6 w-6 rounded-full bg-white text-blue-600"})})]},e.id))]}),U>1&&(0,r.jsx)("div",{className:"mt-6 flex justify-start",children:(0,r.jsx)(D.StandardPagination,{currentPage:x,pageCount:U,setCurrentPage:v,paginationRange:F})})]}):(0,r.jsx)("div",{className:"flex h-32 items-center justify-center rounded-lg border-2 border-dashed border-gray-300",children:(0,r.jsx)("p",{className:"text-sm text-gray-500",children:"Type keywords above to search for images"})})]}),(0,r.jsx)("div",{className:"flex justify-start gap-2",children:(0,r.jsx)(d.Button,{onClick:G,disabled:!o||"uploaded"===o&&!g||c,className:"px-4 py-2 text-sm",variant:"primary","data-sentry-element":"Button","data-sentry-source-file":"ImageSelection.tsx",children:c?(0,r.jsxs)("div",{className:"flex items-center gap-2",children:[(0,r.jsx)("div",{className:"h-3 w-3 animate-spin rounded-full border-2 border-white border-t-transparent"}),"Uploading..."]}):"Use This Image"})})]})}],657537)},733086,e=>{"use strict";e.s(["AiAgentSideSheet",()=>n]);var t=e.i(391398),r=e.i(126830),a=e.i(112161);let n=({children:e,publicListing:n})=>(0,t.jsxs)(r.Sheet,{"data-sentry-element":"Sheet","data-sentry-component":"AiAgentSideSheet","data-sentry-source-file":"AiAgentSideSheet.tsx",children:[(0,t.jsx)(r.SheetTrigger,{asChild:!0,"data-sentry-element":"SheetTrigger","data-sentry-source-file":"AiAgentSideSheet.tsx",children:e}),(0,t.jsx)(r.SheetContent,{side:"right",className:"z-[999] my-8 overflow-hidden bg-white px-0 max-lg:w-full md:mx-4 md:mt-[20px] md:h-[calc(100vh-40px)] md:rounded-2xl md:px-0 md:py-0 lg:w-[780p
2x]","data-sentry-element":"SheetContent","data-sentry-source-file":"AiAgentSideSheet.tsx",children:(0,t.jsx)(a.ChatAgentEmbed,{businessId:n.businessId,featuredBusiness:n,isInSheet:!0,"data-sentry-element":"ChatAgentEmbed","data-sentry-source-file":"AiAgentSideSheet.tsx"})})]})},817689,312068,190591,46806,982567,e=>{"use strict";var t=e.i(391398),r=e.i(275885),a=e.i(723774),n=e.i(272225);e.i(753051);var s=e.i(593537),i=e.i(853062),o=e.i(525695),l=e.i(41158),c=e.i(191788),d=e.i(292558);let u=({hideOnMobile:e})=>(0,t.jsx)("span",{className:(0,s.cn)("text-gray-300",{"max-md:text-transparent":e}),"data-sentry-component":"Dot","data-sentry-source-file":"BusinessHeaderStats.tsx",children:"â¢"}),m=({href:e,children:r})=>(0,t.jsx)(l.default,{href:e,className:"text-gray-950","data-sentry-element":"Link","data-sentry-component":"StatLink","data-sentry-source-file":"BusinessHeaderStats.tsx",children:r}),p=({count:e,asLink:r})=>{let n=`${(0,a.formatNumber)(e)} Follower${1===e?"":"s"}`;return r?(0,t.jsx)(m,{href:`${i.routes.SEARCH}?tab=requests`,"data-sentry-element":"StatLink","data-sentry-component":"FollowersStat","data-sentry-source-file":"BusinessHeaderStats.tsx",children:n}):(0,t.jsx)("p",{"data-sentry-component":"FollowersStat","data-sentry-source-file":"BusinessHeaderStats.tsx",children:n})},h=({count:e,asLink:r})=>{let n=`${(0,a.formatNumber)(e)} Connection${1===e?"":"s"}`;return r?(0,t.jsx)(m,{href:`${i.routes.SEARCH}?tab=connections`,"data-sentry-element":"StatLink","data-sentry-component":"ConnectionsStat","data-sentry-source-file":"BusinessHeaderStats.tsx",children:n}):(0,t.jsx)("p",{"data-sentry-component":"ConnectionsStat","data-sentry-source-file":"BusinessHeaderStats.tsx",children:n})},f=({businessId:e,followersCount:r,isDoubleLine:a})=>{let[n]=o.trpc.businessConnections.listConnected.useSuspenseQuery({businessId:e,limit:1,offset:0});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u,{hideOnMobile:a,"data-sentry-element":"Dot","data-sentry-source-file":"BusinessHeaderStats.tsx"}),(0,t.jsx)(h,{count:n.total,asLink:!0,"data-sentry-element":"ConnectionsStat","data-sentry-source-file":"BusinessHeaderStats.tsx"}),(0,t.jsx)(u,{"data-sentry-element":"Dot","data-sentry-source-file":"BusinessHeaderStats.tsx"}),(0,t.jsx)(p,{count:r,asLink:!0,"data-sentry-element":"FollowersStat","data-sentry-source-file":"BusinessHeaderStats.tsx"})]})},g=({businessId:e,followersCount:r,isDoubleLine:a})=>{let[n]=o.trpc.businessConnections.publicConnectionCount.useSuspenseQuery({businessId:e});return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u,{hideOnMobile:a,"data-sentry-element":"Dot","data-sentry-source-file":"BusinessHeaderStats.tsx"}),(0,t.jsx)(h,{count:n.count,asLink:!0,"data-sentry-element":"ConnectionsStat","data-sentry-source-file":"BusinessHeaderStats.tsx"}),(0,t.jsx)(u,{"data-sentry-element":"Dot","data-sentry-source-file":"BusinessHeaderStats.tsx"}),(0,t.jsx)(p,{count:r,asLink:!0,"data-sentry-element":"FollowersStat","data-sentry-source-file":"BusinessHeaderStats.tsx"})]})};e.s(["BusinessHeaderStats",0,({isOwner:e,businessId:a,followersCount:s,isDoubleLine:i})=>(0,t.jsx)(d.ErrorBoundary,{fallbackRender:()=>(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u,{hideOnMobile:i}),(0,t.jsx)(p,{count:s,asLink:!0})]}),onError:e=>r.captureException(e,{tags:{component:"BusinessHeaderStats"}}),"data-sentry-element":"ErrorBoundary","data-sentry-component":"BusinessHeaderStats","data-sentry-source-file":"BusinessHeaderStats.tsx",children:(0,t.jsx)(c.Suspense,{fallback:(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)(u,{hideOnMobile:i}),(0,t.jsx)(n.Skeleton,{className:"h-4 w-44 rounded-md"})]}),"data-sentry-element":"Suspense","data-sentry-source-file":"BusinessHeaderStats.tsx",children:(0,t.jsx)(e?f:g,{businessId:a,followersCount:s,isDoubleLine:i,"data-sentry-element":"Stats","data-sentry-source-file":"BusinessHeaderStats.tsx"})})})],817689);var y=e.i(605628),x=e.i(797645),v=e.i(796759);let b=({viewerBusinessId:e,targetBusinessId:r})=>{let[a]=o.trpc.businessConnections.mutualWith.useSuspenseQuery({businessId:e,targetBusinessId:r});return(0,t.jsx)(v.MutualLine,{mutual:a,href:(0,v.mutualFilterHref)(r),"data-sentry-element":"MutualLine","data-sentry-component":"MutualLineData","data-sentry-source-file":"BusinessMutualLine.tsx"})};e.s(["BusinessMutualLine",0,({targetBusinessId:e})=>{let a=(0,y.useStore)(x.$business),n=a.value?._id;return n&&n!==e?(0,t.jsx)(d.ErrorBoundary,{fallbackRender:()=>null,onError:e=>r.captureException(e,{tags:{component:"BusinessMutualLine"}}),"data-sentry-element":"ErrorBoundary","data-sentry-component":"BusinessMutualLine","data-sentry-source-file":"BusinessMutualLine.tsx",children:(0,t.jsx)(c.Suspense,{fallback:null,"data-sentry-element":"Suspense","data-sentry-source-file":"BusinessMutualLine.tsx",children:(0,t.jsx)(b,{viewerBusinessId:n,targetBusinessId:e,"data-sentry-element":"MutualLineData","data-sentry-source-file":"BusinessMutualLine.tsx"})})}):null}],312068);var w=e.i(469311),j=e.i(67679);e.s(["EditButton",0,({className:e,...r})=>(0,t.jsx)(w.Button,{size:"none",variant:"unstyled",className:(0,s.cn)("ml-2.5 size-5 text-gray-600",e),...r,"data-sentry-element":"Button","data-sentry-component":"EditButton","data-sentry-source-file":"EditButton.tsx",children:(0,t.jsx)(j.PencilEdit01Icon,{className:"size-full text-inherit","data-sentry-element":"PencilEdit01Icon","data-sentry-source-file":"EditButton.tsx"})})],190591);
2var C=e.i(145704),S=e.i(653828);e.i(272989);var N=e.i(880095),P=e.i(126830),A=e.i(567573),k=e.i(56105),E=e.i(814235),I=e.i(307854),B=e.i(343002),O=e.i(47857);e.i(979449);var M=e.i(668569),D=e.i(794470),L=e.i(249730),T=e.i(730515),R=e.i(823912);e.i(581516);var _=e.i(359385);e.i(645726);var z=e.i(697491),F=e.i(54247);let U=(0,e.i(931358).default)("SlidersHorizontalIcon",[["path",{d:"M4 5.00024L10 5",stroke:"currentColor",key:"k0"}],["path",{d:"M13 5L20 5",stroke:"currentColor",key:"k1"}],["path",{d:"M16 9L16 15",stroke:"currentColor",key:"k2"}],["path",{d:"M10 2L10 8",stroke:"currentColor",key:"k3"}],["path",{d:"M12 16L12 22",stroke:"currentColor",key:"k4"}],["path",{d:"M16 12L20 12.0002",stroke:"currentColor",key:"k5"}],["path",{d:"M4 12.0002L13 12",stroke:"currentColor",key:"k6"}],["path",{d:"M12 19L20 19",stroke:"currentColor",key:"k7"}],["path",{d:"M4 19.0002L9 19",stroke:"currentColor",key:"k8"}]]);var $=e.i(558021);let K=M.businessProfileSchema.merge(D.contactLocationSchema).merge(L.listingAppearanceSchema),H=({publicListing:e,latestRevenue:a,onSuccess:n})=>{let s,o=e.businessId,d=(0,$.useForm)({resolver:(0,k.zodResolver)(K),defaultValues:{name:e.businessName,primaryTag:e.primaryTag,secondaryTags:e.secondaryTags||[],website:e.websiteUrl||"",latestRevenue:a,startDate:e.startYear?((s=new Date(1,0,1)).setFullYear(e.startYear),s):null,zipCode:e.zipCode||"",city:e.businessCity||"",state:e.businessState||"",pictureFile:{url:e.pictureUrl,file:void 0,shouldDelete:!1},smallDescription:e.smallDescription||"",aboutSection:e.aboutSection||""}}),{isSubmitting:u}=d.formState,m=(0,c.useCallback)(async t=>{try{let r;if(!o)throw Error("No business selected");await (0,C.validateAndLogoutOnBadWords)({businessName:t.name,smallDescription:t.smallDescription,aboutSection:t.aboutSection,websiteUrl:t.website});let a=t.primaryTag?(0,R.tagToCategory)(t.primaryTag):void 0,s=t.zipCode?await (0,S.getGeographicInfoFromZipCode)(t.zipCode):{state:void 0,city:"",latitude:void 0,longitude:void 0},{file:i,shouldDelete:l}=t.pictureFile;l?r=(0,_.deleteField)():i?r=await (0,B.uploadFeaturedBusinessImage)(i,{businessId:o,fieldName:"pictureUrl"}).then(e=>(0,z.getDownloadURL)(e.fileRef)):t.pictureFile.url&&(r=t.pictureFile.url),await (0,E.updateBusiness)({businessId:o,data:{name:t.name.replace(RegExp(" llc","gi")," LLC"),category:a,primaryTag:t.primaryTag,secondaryTags:t.secondaryTags,website:t.website||"",startDate:t.startDate??void 0,zipCode:t.zipCode,city:t.city||s?.city||"",state:t.state||s?.state?.code||"",latitude:s?.latitude,longitude:s?.longitude,latestRevenue:t.latestRevenue,smallDescription:t.smallDescription,aboutSection:t.aboutSection,pictureUrl:r,isSkipUser:O.$userData.get().value?.email?.endsWith("@helloskip.com")}}),(0,N.eventRaven)("publicListingUpdate",{name:t.name,category:a,city:t.city||s?.city,state:t.state||s?.state?.code,businessId:o,publicListingId:e._id,primaryTag:t.primaryTag,secondaryTags:t.secondaryTags}),(0,A.toast)({variant:"success",description:"Listing updated successfully"}),n()}catch(t){(0,A.toast)({variant:"destructive",description:t instanceof Error&&!I.isProd?t.message:"Failed to update listing, please try again."}),(0,r.captureException)(t,{tags:{feature:"edit-listing-sidesheet"},extra:{businessId:o,publicListingId:e._id}})}},[o,e._id,n]);return(0,t.jsx)($.FormProvider,{...d,"data-sentry-element":"FormProvider","data-sentry-component":"EditListingForm","data-sentry-source-file":"EditListingSidesheet.tsx",children:(0,t.jsxs)(T.SettingsEditSheet.Form,{onSubmit:d.handleSubmit(m),"data-sentry-element":"SettingsEditSheet.Form","data-sentry-source-file":"EditListingSidesheet.tsx",children:[(0,t.jsxs)(T.SettingsEditSheet.Body,{disabled:u,className:"group overflow-y-auto","data-sentry-element":"SettingsEditSheet.Body","data-sentry-source-file":"EditListingSidesheet.tsx",children:[(0,t.jsx)("div",{className:"flex items-center justify-between border-b pb-6",children:(0,t.jsx)("h2",{className:"font-inter-display text-h6 font-semibold text-gray-950",children:"Edit Your Listing"})}),(0,t.jsx)(M.BusinessProfileFields,{disabled:u,compact:!0,hiddenFields:["latestRevenue"],"data-sentry-element":"BusinessProfileFields","data-sentry-source-file":"EditListingSidesheet.tsx"}),(0,t.jsx)(D.ContactLocationFields,{disabled:u,compact:!0,"data-sentry-element":"ContactLocationFields","data-sentry-source-file":"EditListingSidesheet.tsx"}),(0,t.jsx)(L.ListingAppearanceFields,{disabled:u,businessId:o,"data-sentry-element":"ListingAppearanceFields","data-sentry-source-file":"EditListingSidesheet.tsx"}),(0,t.jsxs)(l.default,{href:`${i.routes.ACCOUNT_DETAILS}?tab=public`,className:"flex items-center gap-2 rounded-xl border border-gray-200 px-4 py-3 text-sm text-gray-700 transition-colors hover:bg-gray-50","data-sentry-element":"Link","data-sentry-source-file":"EditListingSidesheet.tsx",children:[(0,t.jsx)(U,{size:16,className:"text-gray-600","data-sentry-element":"SlidersHorizontalIcon","data-sentry-source-file":"EditListingSidesheet.tsx"}),(0,t.jsxs)("span",{children:["More business page options in"," ",(0,t.jsx)("span",{className:"font-medium text-primary-600",children:"Settings"})]}),(0,t.jsx)(F.ArrowRight01Icon,{size:16,className:"ml-auto text-gray-600","data-sentry-element":"ArrowRight01Icon","data-sentry-source-file":"EditListingSidesheet.tsx"})]})]}),(0,t.jsx)(T.SettingsEditSheet.Footer,{"data-sentry-element":"SettingsEditSheet.Footer","data-sentry-source-file":"EditListingSidesheet.tsx",children:(0,t.jsx)(w.Button,{isLoading:u,disabled:u,variant:"neutral",type:"submit","data-sentry-element":"Button","data-sentry-source-file":"EditListingSidesheet.tsx",children:"Save Changes"})})]})})};e.s(["EditListingSidesheet",0,({publicListing:e,latestRevenue:r,open:a,onOpenChange:n})=>(0,t.jsx)(P.Sheet,{open:a,onOpenChange:n,"data-sentry-element":"Sheet","data-sentry-component":"EditListingSidesheet","data-sentry-source-file":"EditListingSidesheet.tsx",children:(0,t.jsx)(T.SettingsEditSheet.Content,{className:"md:w-[720px] md:max-w-[720px] md:py-6",onInteractOutside:e=>e.preventDefault(),"data-sentry-element":"SettingsEditSheet.Content","data-sentry-source-file":"EditListingSidesheet.tsx",children:(0,t.jsx)(H,{publicListing:e,latestRevenue:r,onSuccess:()=>n(!1),"data-sentry-element":"EditListingForm","data-sentry-source-file":"EditListingSidesheet.tsx"})})})],46806),e.s(["Section",()=>er,"SheetHeader",()=>J],982567);var W=e.i(606678),V=e.i(812500),G=e.i(717831),q=e.i(450584),Y=e.i(785986),Z=e.i(538986),X=e.i(98908),Q=e.i(126019);let J=({title:e,...r})=>(0,t.jsxs)("div",{...r,className:"sticky top-0 z-10 flex w-full items-center justify-between bg-white p-5 md:p-8","data-sentry-component":"SheetHeader","data-sentry-source-file":"Section.tsx",children:[(0,t.jsx)(Y.ArrowLeft01Icon,{strokeWidth:2,className:"size-6 text-gray-950","data-sentry-element":"ArrowLeft01Icon","data-sentry-source-file":"Section.tsx"}),(0,t.jsx)("h2",{className:"p-0 text-center font-inter-display text-h7 font-semibold leading-none tracking-normal md:ml-2 md:w-full md:text-left",children:e}),(0,t.jsx)("div",{className:"pointer-events-none size-6"})]}),ee=({listing:e})=>(0,t.jsxs)(w.Button,{onClick:()=>q.openFeaturedBusinessCardModal({featuredBusiness:e}),variant:"unstyled",className:"flex w-full gap-3 overflow-hidden p-0","data-sentry-element":"Button","data-sentry-component":"MobileListingCard","data-sentry-source-file":"Section.tsx",children:[(0,t.jsx)(G.ImageErrorBoundary,{src:e.pictureUrl,fallback:(0,t.jsx)("div",{className:"grid size-12 min-w-12 place-items-center rounded-[10px] bg-gray-50",children:(0,t.jsx)(Z.Store04Icon,{className:"size-6 text-gray-300"})}),"data-sentry-element":"ImageErrorBoundary","data-sentry-source-file":"Section.tsx",children:(0,t.jsx)(Q.default,{width:48,height:48,src:e.pictureUrl,alt:e.businessName,className:"aspect-square w-[48px] rounded-[10px] object-cover",loading:"lazy","data-sentry-element":"Image","data-sentry-source-file":"Section.tsx"})}),(0,t.jsxs)("div",{className:"flex h-full w-full flex-col items-start justify-center gap-1",children:[(0,t.jsx)("span",{className:"text-sm font-medium",children:e.businessName}),(0,t.jsxs)("span",{className:"text-xs text-gray-600",children:[e.businessCity,", ",e.businessState]})]})]});function et({chunk:e,isMobile:r}){return r?(0,t.jsx)("div",{className:"grid w-full grid-cols-1 gap-5",children:e.map(e=>(0,t.jsx)(ee,{listing:e},e._id))}):(0,t.jsx)("div",{className:"grid w-full gap-5 sm:grid-cols-2 lg:grid-cols-4","data-sentry-component":"ListingCarouselChunk","data-sentry-source-file":"Section.tsx",children:e.map(e=>(0,t.jsx)(q.BusinessCardV2,{featuredBusiness:e,className:"h-full bg-white"},e._id))})}let er=c.default.memo(({title:e,items:r=[],className:a})=>
2{let n=(0,V.useBreakpoint)(768),[i,o]=(0,c.useState)(!1),l=r.slice(0,20);return 0===r.length?null:(0,t.jsxs)(W.CarouselRoot,{orientation:"horizontal",className:(0,s.cn)(a),children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)(P.Sheet,{open:i,onOpenChange:o,children:[(0,t.jsxs)(P.SheetTrigger,{className:"flex items-center space-x-1",children:[(0,t.jsx)("h2",{className:"font-inter-display text-h7 font-semibold lg:text-h6",children:e}),(0,t.jsx)(F.ArrowRight01Icon,{strokeWidth:1.5,className:"size-6 text-gray-600"})]}),(0,t.jsx)(P.SheetContent,{close:!1,className:"bg-white max-md:w-screen md:p-0",children:i&&(0,t.jsxs)("div",{className:"relative",children:[(0,t.jsx)(P.SheetClose,{asChild:!0,children:(0,t.jsx)(J,{title:e})}),(0,t.jsx)(q.BusinessCardGrid,{className:"px-4 py-2 md:px-8 md:pb-8",children:r.slice(0,40).map(e=>(0,t.jsx)(q.BusinessCardV2,{featuredBusiness:e},e._id))})]})})]}),(0,t.jsx)(W.CarouselArrows,{className:"max-lg:hidden"})]}),(0,t.jsx)(W.CarouselContent,{className:"mt-5 gap-4 overflow-visible lg:mt-6",children:(0,X.default)(l,4).map(e=>(0,t.jsx)(W.CarouselItem,{className:"h-full w-full max-md:basis-[85%]",children:(0,t.jsx)(et,{chunk:e,isMobile:n})},e[0]._id))})]})});er.displayName="Section"},469677,e=>{"use strict";e.s(["BusinessPageContent",()=>tn],469677);var t=e.i(391398),r=e.i(985343),a=e.i(605628),n=e.i(731671),s=e.i(189461),i=e.i(498003);e.i(272989);var o=e.i(880095);e.i(365480);var l=e.i(472512),c=e.i(304378),d=e.i(469311),u=e.i(464500),m=e.i(586427),p=e.i(307428);e.i(753051);var h=e.i(593537),f=e.i(797645),g=e.i(733086),y=e.i(323554),x=e.i(853062),v=e.i(715682),b=e.i(613572),w=e.i(567573),j=e.i(546554),C=e.i(817689),S=e.i(312068),N=e.i(190591),P=e.i(46806),A=e.i(230422),k=e.i(982567),E=e.i(929588),I=e.i(718880),B=e.i(958596),O=e.i(717831),M=e.i(470867),D=e.i(85506),L=e.i(471818),T=e.i(361192),R=e.i(434606),_=e.i(156411),z=e.i(686993),F=e.i(660719),U=e.i(450584),$=e.i(502535),K=e.i(723924),H=e.i(493525),W=e.i(343002),V=e.i(375985);e.i(645726);var G=e.i(697491),q=e.i(322138),Y=e.i(191788),Z=Y,X=Object.defineProperty,Q=(e,t,r)=>{let a;return(a="symbol"!=typeof t?t+"":t)in e?X(e,a,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[a]=r};let J={x:0,y:0,width:0,height:0,unit:"px"},ee=(e,t,r)=>Math.min(Math.max(e,t),r),et=(e,t)=>e===t||e.width===t.width&&e.height===t.height&&e.x===t.x&&e.y===t.y&&e.unit===t.unit;function er(e,t,r){return"%"===e.unit?{...J,...e,unit:"%"}:{unit:"%",x:e.x?e.x/t*100:0,y:e.y?e.y/r*100:0,width:e.width?e.width/t*100:0,height:e.height?e.height/r*100:0}}function ea(e,t,r){return e.unit?"px"===e.unit?{...J,...e,unit:"px"}:{unit:"px",x:e.x?e.x*t/100:0,y:e.y?e.y*r/100:0,width:e.width?e.width*t/100:0,height:e.height?e.height*r/100:0}:{...J,...e,unit:"px"}}function en(e,t,r,a,n,s=0,i=0,o=a,l=n){let c={...e},d=Math.min(s,a),u=Math.min(i,n),m=Math.min(o,a),p=Math.min(l,n);t&&(t>1?(u=(d=i?i*t:d)/t,m=o*t):(d=(u=s?s/t:u)*t,p=l/t)),c.y<0&&(c.height=Math.max(c.height+c.y,u),c.y=0),c.x<0&&(c.width=Math.max(c.width+c.x,d),c.x=0);let h=a-(c.x+c.width);h<0&&(c.x=Math.min(c.x,a-d),c.width+=h);let f=n-(c.y+c.height);if(f<0&&(c.y=Math.min(c.y,n-u),c.height+=f),c.width<d&&(("sw"===r||"nw"==r)&&(c.x-=d-c.width),c.width=d),c.height<u&&(("nw"===r||"ne"==r)&&(c.y-=u-c.height),c.height=u),c.width>m&&(("sw"===r||"nw"==r)&&(c.x-=m-c.width),c.width=m),c.height>p&&(("nw"===r||"ne"==r)&&(c.y-=p-c.height),c.height=p),t){let e=c.width/c.height;if(e<t){let e=Math.max(c.width/t,u);("nw"===r||"ne"==r)&&(c.y-=e-c.height),c.height=e}else if(e>t){let e=Math.max(c.height*t,d);("sw"===r||"nw"==r)&&(c.x-=e-c.width),c.width=e}}return c}let es={capture:!0,passive:!1},ei=0,eo=class e extends Z.PureComponent{constructor(){super(...arguments),Q(this,"docMoveBound",!1),Q(this,"mouseDownOnCrop",!1),Q(this,"dragStarted",!1),Q(this,"evData",{startClientX:0,startClientY:0,startCropX:0,startCropY:0,clientX:0,clientY:0,isResize:!0}),Q(this,"componentRef",(0,Z.createRef)()),Q(this,"mediaRef",(0,Z.createRef)()),Q(this,"resizeObserver"),Q(this,"initChangeCalled",!1),Q(this,"instanceId",`rc-${ei++}`),Q(this,"state",{cropIsActive:!1,newCropIsBeingDrawn:!1}),Q(this,"onCropPointerDown",e=>{let{crop:t,disabled:r}=this.props,a=this.getBox();if(!t)return;let n=ea(t,a.width,a.height);if(r)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let s=e.target.dataset.ord,i=e.clientX,o=e.clientY,l=n.x,c=n.y;if(s){let t=e.clientX-a.x,r=e.clientY-a.y,d=0,u=0;"ne"===s||"e"==s?(d=t-(n.x+n.width),u=r-n.y,l=n.x,c=n.y+n.height):"se"===s||"s"===s?(d=t-(n.x+n.width),u=r-(n.y+n.height),l=n.x,c=n.y):"sw"===s||"w"==s?(d=t-n.x,u=r-(n.y+n.height),l=n.x+n.width,c=n.y):("nw"===s||"n"==s)&&(d=t-n.x,u=r-n.y,l=n.x+n.width,c=n.y+n.height),i=l+a.x+d,o=c+a.y+u}this.evData={startClientX:i,startClientY:o,startCropX:l,startCropY:c,clientX:e.clientX,clientY:e.clientY,isResize:!!s,ord:s},this.mouseDownOnCrop=!0,this.setState({cropIsActive:!0})}),Q(this,"onComponentPointerDown",e=>{let{crop:t,disabled:r,locked:a,keepSelection:n,onChange:s}=this.props,i=this.getBox();if(r||a||n&&t)return;e.cancelable&&e.preventDefault(),this.bindDocMove(),this.componentRef.current.focus({preventScroll:!0});let o=e.clientX-i.x,l=e.clientY-i.y,c={unit:"px",x:o,y:l,width:0,height:0};this.evData={startClientX:e.clientX,startClientY:e.clientY,startCropX:o,startCropY:l,clientX:e.clientX,clientY:e.clientY,isResize:!0},this.mouseDownOnCrop=!0,s(ea(c,i.width,i.height),er(c,i.width,i.height)),this.setState({cropIsActive:!0,newCropIsBeingDrawn:!0})}),Q(this,"onDocPointerMove",e=>{let t,{crop:r,disabled:a,onChange:n,onDragStart:s}=this.props,i=this.getBox();if(a||!r||!this.mouseDownOnCrop)return;e.cancelable&&e.preventDefault(),this.dragStarted||(this.dragStarted=!0,s&&s(e));let{evData:o}=this;o.clientX=e.clientX,o.clientY=e.clientY,et(r,t=o.isResize?this.resizeCrop():this.dragCrop())||n(ea(t,i.width,i.height),er(t,i.width,i.height))}),Q(this,"onComponentKeyDown",t=>{let{crop:r,disabled:a,onChange:n,onComplete:s}=this.props;if(a)return;let i=t.key,o=!1;if(!r)return;let l=this.getBox(),c=this.makePixelCrop(l),d=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep;if("ArrowLeft"===i?(c.x-=d,o=!0):"ArrowRight"===i?(c.x+=d,o=!0):"ArrowUp"===i?(c.y-=d,o=!0):"ArrowDown"===i&&(c.y+=d,o=!0),o){t.cancelable&&t.preventDefault(),c.x=ee(c.x,0,l.width-c.width),c.y=ee(c.y,0,l.height-c.height);let e=ea(c,l.width,l.height),r=er(c,l.width,l.height);n(e,r),s&&s(e,r)}}),Q(this,"onHandlerKeyDown",(t,r)=>{var a,n;let s,{aspect:i=0,crop:o,disabled:l,minWidth:c=0,minHeight:d=0,maxWidth:u,maxHeight:m,onChange:p,onComplete:h}=this.props,f=this.getBox();if(l||!o||"ArrowUp"!==t.key&&"ArrowDown"!==t.key&&"ArrowLeft"!==t.key&&"ArrowRight"!==t.key)return;t.stopPropagation(),t.preventDefault();let g=(navigator.platform.match("Mac")?t.metaKey:t.ctrlKey)?e.nudgeStepLarge:t.shiftKey?e.nudgeStepMedium:e.nudgeStep,y=en((a=ea(o,f.width,f.height),n=t.key,s={...a},"ArrowLeft"===n?"nw"===r?(s.x-=g,s.y-=g,s.width+=g,s.height+=g):"w"===r?(s.x-=g,s.width+=g):"sw"===r?(s.x-=g,s.width+=g,s.height+=g):"ne"===r?(s.y+=g,s.width-=g,s.height-=g):"e"===r?s.width-=g:"se"===r&&(s.width-=g,s.height-=g):"ArrowRight"===n&&("nw"===r?(s.x+=g,s.y+=g,s.width-=g,s.height-=g):"w"===r?(s.x+=g,s.width-=g):"sw"===r?(s.x+=g,s.width-=g,s.height-=g):"ne"===r?(s.y-=g,s.width+=g,s.height+=g):"e"===r?s.width+=g:"se"===r&&(s.width+=g,s.height+=g)),"ArrowUp"===n?"nw"===r?(s.x-=g,s.y-=g,s.width+=g,s.height+=g):"n"===r?(s.y-=g,s.height+=g):"ne"===r?(s.y-=g,s.width+=g,s.height+=g):"sw"===r?(s.x+=g,s.width-=g,s.height-=g):"s"===r?s.height-=g:"se"===r&&(s.width-=g,s.height-=g):"ArrowDown"===n&&("nw"===r?(s.x+=g,s.y+=g,s.width-=g,s.height-=g):"n"===r?(s.y+=g,s.height-=g):"ne"===r?(s.y+=g,s.width-=g,s.height-=g):"sw"===r?(s.x-=g,s.width+=g,s.height+=g):"s"===r?s.height+=g:"se"===r&&(s.width+=g,s.height+=g)),s),i,r,f.width,f.height,c,d,u,m);if(!et(o,y)){let e=er(y,f.width,f.height);p(y,e),h&&h(y,e)}}),Q(this,"onDocPointerDone",e=>{let{crop:t,disabled:r,onComplete:a,onDragEnd:n}=this.props,s=this.getBox();this.unbindDocMove(),!(r||!t)&&this.mouseDownOnCrop&&(this.mouseDownOnCrop=!1,this.dragStarted=!1,n&&n(e),a&&a(ea(t,s.width,s.height),er(t,s.width,s.height)),this.setState({cropIsActive:!1,newCropIsBeingDrawn:!1}))}),Q(this,"onDragFocus",()=>{var e;null==(e=this.componentRef.current)||e.scrollTo(0,0)})}get document(){return document}getBox(){let e=this.mediaRef.current;if(!e)return{x:0,y:0,width:0,height:0};let{x:t,y:r,width:a,height:n}=e.getBoundingClientRect();return{x:t,y:r,width:a,height:n}}componentDidUpdate(e){let{crop:t,onComplete:r}=this.props;if(r&&!e.crop&&t){let{width:e,height:a}=this.getBox();e&&a&&r(ea(t,e,a),er(t,e,a))}}componentWillUnmount(){this.resizeObserver&&this.resizeObserver.disconnect(),this.unbindDocMove()}bindDocMove(){this.docMoveBound||(this.document.addEventListener("pointermove",this.onDocPointerMove,es),this.document.addEventListener("pointerup",this.onDocPointerDone,es),this.document.addEventListener("pointercancel",this.onDocPointerDone,es),this.docMoveBound=!0)}
2unbindDocMove(){this.docMoveBound&&(this.document.removeEventListener("pointermove",this.onDocPointerMove,es),this.document.removeEventListener("pointerup",this.onDocPointerDone,es),this.document.removeEventListener("pointercancel",this.onDocPointerDone,es),this.docMoveBound=!1)}getCropStyle(){let{crop:e}=this.props;if(e)return{top:`${e.y}${e.unit}`,left:`${e.x}${e.unit}`,width:`${e.width}${e.unit}`,height:`${e.height}${e.unit}`}}dragCrop(){let{evData:e}=this,t=this.getBox(),r=this.makePixelCrop(t),a=e.clientX-e.startClientX,n=e.clientY-e.startClientY;return r.x=ee(e.startCropX+a,0,t.width-r.width),r.y=ee(e.startCropY+n,0,t.height-r.height),r}getPointRegion(e,t,r,a){let n,{evData:s}=this,i=s.clientX-e.x,o=s.clientY-e.y;return n=a&&t?"nw"===t||"n"===t||"ne"===t:o<s.startCropY,(r&&t?"nw"===t||"w"===t||"sw"===t:i<s.startCropX)?n?"nw":"sw":n?"ne":"se"}resolveMinDimensions(e,t,r=0,a=0){let n=Math.min(r,e.width),s=Math.min(a,e.height);return t&&(n||s)?t>1?n?[n,n/t]:[s*t,s]:s?[s*t,s]:[n,n/t]:[n,s]}resizeCrop(){let{evData:t}=this,{aspect:r=0,maxWidth:a,maxHeight:n}=this.props,s=this.getBox(),[i,o]=this.resolveMinDimensions(s,r,this.props.minWidth,this.props.minHeight),l=this.makePixelCrop(s),c=this.getPointRegion(s,t.ord,i,o),d=t.ord||c,u=t.clientX-t.startClientX,m=t.clientY-t.startClientY;(i&&"nw"===d||"w"===d||"sw"===d)&&(u=Math.min(u,-i)),(o&&"nw"===d||"n"===d||"ne"===d)&&(m=Math.min(m,-o));let p={unit:"px",x:0,y:0,width:0,height:0};"ne"===c?(p.x=t.startCropX,p.width=u,r?p.height=p.width/r:p.height=Math.abs(m),p.y=t.startCropY-p.height):"se"===c?(p.x=t.startCropX,p.y=t.startCropY,p.width=u,r?p.height=p.width/r:p.height=m):"sw"===c?(p.x=t.startCropX+u,p.y=t.startCropY,p.width=Math.abs(u),r?p.height=p.width/r:p.height=m):"nw"===c&&(p.x=t.startCropX+u,p.width=Math.abs(u),r?(p.height=p.width/r,p.y=t.startCropY-p.height):(p.height=Math.abs(m),p.y=t.startCropY+m));let h=en(p,r,c,s.width,s.height,i,o,a,n);return r||e.xyOrds.indexOf(d)>-1?l=h:e.xOrds.indexOf(d)>-1?(l.x=h.x,l.width=h.width):e.yOrds.indexOf(d)>-1&&(l.y=h.y,l.height=h.height),l.x=ee(l.x,0,s.width-l.width),l.y=ee(l.y,0,s.height-l.height),l}renderCropSelection(){let{ariaLabels:t=e.defaultProps.ariaLabels,disabled:r,locked:a,renderSelectionAddon:n,ruleOfThirds:s,crop:i}=this.props,o=this.getCropStyle();if(i)return Z.default.createElement("div",{style:o,className:"ReactCrop__crop-selection",onPointerDown:this.onCropPointerDown,"aria-label":t.cropArea,tabIndex:0,onKeyDown:this.onComponentKeyDown,role:"group"},!r&&!a&&Z.default.createElement("div",{className:"ReactCrop__drag-elements",onFocus:this.onDragFocus},Z.default.createElement("div",{className:"ReactCrop__drag-bar ord-n","data-ord":"n"}),Z.default.createElement("div",{className:"ReactCrop__drag-bar ord-e","data-ord":"e"}),Z.default.createElement("div",{className:"ReactCrop__drag-bar ord-s","data-ord":"s"}),Z.default.createElement("div",{className:"ReactCrop__drag-bar ord-w","data-ord":"w"}),Z.default.createElement("div",{className:"ReactCrop__drag-handle ord-nw","data-ord":"nw",tabIndex:0,"aria-label":t.nwDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"nw"),role:"button"}),Z.default.createElement("div",{className:"ReactCrop__drag-handle ord-n","data-ord":"n",tabIndex:0,"aria-label":t.nDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"n"),role:"button"}),Z.default.createElement("div",{className:"ReactCrop__drag-handle ord-ne","data-ord":"ne",tabIndex:0,"aria-label":t.neDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"ne"),role:"button"}),Z.default.createElement("div",{className:"ReactCrop__drag-handle ord-e","data-ord":"e",tabIndex:0,"aria-label":t.eDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"e"),role:"button"}),Z.default.createElement("div",{className:"ReactCrop__drag-handle ord-se","data-ord":"se",tabIndex:0,"aria-label":t.seDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"se"),role:"button"}),Z.default.createElement("div",{className:"ReactCrop__drag-handle ord-s","data-ord":"s",tabIndex:0,"aria-label":t.sDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"s"),role:"button"}),Z.default.createElement("div",{className:"ReactCrop__drag-handle ord-sw","data-ord":"sw",tabIndex:0,"aria-label":t.swDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"sw"),role:"button"}),Z.default.createElement("div",{className:"ReactCrop__drag-handle ord-w","data-ord":"w",tabIndex:0,"aria-label":t.wDragHandle,onKeyDown:e=>this.onHandlerKeyDown(e,"w"),role:"button"})),n&&Z.default.createElement("div",{className:"ReactCrop__selection-addon",onPointerDown:e=>e.stopPropagation()},n(this.state)),s&&Z.default.createElement(Z.default.Fragment,null,Z.default.createElement("div",{className:"ReactCrop__rule-of-thirds-hz"}),Z.default.createElement("div",{className:"ReactCrop__rule-of-thirds-vt"})))}makePixelCrop(e){return ea({...J,...this.props.crop||{}},e.width,e.height)}render(){let{aspect:e,children:t,circularCrop:r,className:a,crop:n,disabled:s,locked:i,style:o,ruleOfThirds:l}=this.props,{cropIsActive:c,newCropIsBeingDrawn:d}=this.state,u=n?this.renderCropSelection():null,m=((...e)=>e.filter(e=>e&&"string"==typeof e).join(" "))("ReactCrop",a,c&&"ReactCrop--active",s&&"ReactCrop--disabled",i&&"ReactCrop--locked",d&&"ReactCrop--new-crop",n&&e&&"ReactCrop--fixed-aspect",n&&r&&"ReactCrop--circular-crop",n&&l&&"ReactCrop--rule-of-thirds",!this.dragStarted&&n&&!n.width&&!n.height&&"ReactCrop--invisible-crop",r&&"ReactCrop--no-animate");return Z.default.createElement("div",{ref:this.componentRef,className:m,style:o},Z.default.createElement("div",{ref:this.mediaRef,className:"ReactCrop__child-wrapper",onPointerDown:this.onComponentPointerDown},t),n?Z.default.createElement("svg",{className:"ReactCrop__crop-mask",width:"100%",height:"100%"},Z.default.createElement("defs",null,Z.default.createElement("mask",{id:`hole-${this.instanceId}`},Z.default.createElement("rect",{width:"100%",height:"100%",fill:"white"}),r?Z.default.createElement("ellipse",{cx:`${n.x+n.width/2}${n.unit}`,cy:`${n.y+n.height/2}${n.unit}`,rx:`${n.width/2}${n.unit}`,ry:`${n.height/2}${n.unit}`,fill:"black"}):Z.default.createElement("rect",{x:`${n.x}${n.unit}`,y:`${n.y}${n.unit}`,width:`${n.width}${n.unit}`,height:`${n.height}${n.unit}`,fill:"black"}))),Z.default.createElement("rect",{fill:"black",fillOpacity:.5,width:"100%",height:"100%",mask:`url(#hole-${this.instanceId})`})):void 0,u)}};async function el(e,t){let r=await H.auth?.currentUser?.getIdToken();if(!r)throw Error("Not authenticated");let a=await fetch(`/api/storage/file?path=${encodeURIComponent(e)}`,{headers:{Authorization:r},signal:t});if(!a.ok)throw Error(`Failed to load image (${a.status})`);return a.blob()}Q(eo,"xOrds",["e","w"]),Q(eo,"yOrds",["n","s"]),Q(eo,"xyOrds",["nw","ne","se","sw"]),Q(eo,"nudgeStep",1),Q(eo,"nudgeStepMedium",10),Q(eo,"nudgeStepLarge",100),Q(eo,"defaultProps",{ariaLabels:{cropArea:"Use the arrow keys to move the crop selection area",nwDragHandle:"Use the arrow keys to move the north west drag handle to change the crop selection area",nDragHandle:"Use the up and down arrow keys to move the north drag handle to change the crop selection area",neDragHandle:"Use the arrow keys to move the north east drag handle to change the crop selection area",eDragHandle:"Use the up and down arrow keys to move the east drag handle to change the crop selection area",seDragHandle:"Use the arrow keys to move the south east drag handle to change the crop selection area",sDragHandle:"Use the up and down arrow keys to move the south drag handle to change the crop selection area",swDragHandle:"Use the arrow keys to move the south west drag handle to change the crop selection area",wDragHandle:"Use the up and down arrow keys to move the west drag handle to change the crop selection area"}});let ec=e=>{(0,w.toast)({title:"Error",description:V.isDevEnv?"Error on crop: "+String(e):"Something went wrong while saving the banner.",variant:"error"})};async function ed(e,t){let r=await createImageBitmap(e);try{let e=t.width>1500?1500/t.width:1,a=Math.max(1,Math.round(t.width*e)),n=Math.max(1,Math.round(t.height*e)),s=document.createElement("canvas");s.width=a,s.height=n;let i=s.getContext("2d");if(!i)throw Error("Canvas 2D context unavailable");return i.drawImage(r,t.x,t.y,t.width,t.height,0,0,a,n),await new Promise((e,t)=>
2{s.toBlob(r=>r?e(r):t(Error("Failed to encode cropped image")),"image/jpeg",.95)})}finally{r.close()}}let eu=({imageUrl:e,file:r,filePath:a,originalName:n,businessId:s,featuredBusinessId:i,onSuccess:o,onFailure:l})=>{let c=(0,Y.useRef)(null),[u,m]=(0,Y.useState)(r??null),[p,h]=(0,Y.useState)(),[f,g]=(0,Y.useState)(!1),y=!u&&!!a;(0,Y.useEffect)(()=>{if(r||!a)return;let e=new AbortController;return(async()=>{try{let t=await el(a,e.signal);m(t)}catch(e){if(e?.name==="AbortError")return;ec(e),l()}})(),()=>e.abort()},[r,a,l]);let x=async()=>{let e=c.current;if(!p||!u||!e)return;g(!0);let t=(0,w.toast)({title:"Uploading",description:"Uploading banner...",variant:"info"});try{let r={unit:"px",x:p.x/100*e.naturalWidth,y:p.y/100*e.naturalHeight,width:p.width/100*e.naturalWidth,height:p.height/100*e.naturalHeight},a=await ed(u,r),l=n?.replace(/\.[^.]+$/,"")||"banner",c=new File([a],`${l}.jpg`,{type:"image/jpeg"}),d=await (0,W.uploadFeaturedBusinessImage)(c,{fieldName:`${i}-banner`,businessId:s,onProgress:e=>{let r=(100*e).toFixed(0);t.update({description:`Uploading banner... ${r}%`})}}),m=await (0,G.getDownloadURL)(d.fileRef);t.dismiss(),o({kind:"cropped",url:m})}catch(e){t.dismiss(),ec(e),g(!1)}};return(0,t.jsxs)("div",{className:"flex w-[90vw] max-w-[720px] flex-col gap-6 p-4 md:gap-8 md:p-8","data-sentry-component":"BannerCropModal","data-sentry-source-file":"BannerCropModal.tsx",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2",children:[(0,t.jsx)("h2",{className:"font-inter-display text-h7 font-semibold tracking-[-0.00625rem] text-gray-950 md:text-h6 md:tracking-[-0.03125rem]",children:"Edit Banner Image"}),(0,t.jsx)("p",{className:"font-inter text-sm text-gray-950",children:"Drag the corners to adjust the crop"})]}),(0,t.jsxs)("div",{className:"relative flex w-full items-center justify-center overflow-hidden rounded-xl bg-gray-950 md:rounded",children:[(0,t.jsx)(eo,{crop:p,aspect:3.75,onChange:(e,t)=>
2h(t),keepSelection:!0,ruleOfThirds:!1,"data-sentry-element":"ReactCrop","data-sentry-source-file":"BannerCropModal.tsx",children:(0,t.jsx)("img",{ref:c,src:e,alt:"Banner to crop",onLoad:e=>{var t,r,a,n,s,i;let o,l,c=e.currentTarget;h((o=ea(t={unit:"%",width:90},r=c.naturalWidth,a=c.naturalHeight),t.width&&(o.height=o.width/3.75),t.height&&(o.width=3.75*o.height),o.y+o.height>a&&(o.height=a-o.y,o.width=3.75*o.height),o.x+o.width>r&&(o.width=r-o.x,o.height=o.width/3.75),n="%"===t.unit?er(o,r,a):o,(l=ea(n,s=c.naturalWidth,i=c.naturalHeight)).x=(s-l.width)/2,l.y=(i-l.height)/2,"%"===n.unit?er(l,s,i):l))},className:"max-h-[200px] w-auto md:max-h-[416px]"})}),y&&(0,t.jsx)("div",{className:"absolute inset-0 z-10 flex items-center justify-center bg-black/40",children:(0,t.jsx)(q.Loader2,{className:"size-6 animate-spin text-white"})})]}),(0,t.jsxs)("div",{className:"flex w-full items-center gap-6",children:[(0,t.jsx)(d.Button,{variant:"secondary",size:"lg",className:"flex-1",onClick:()=>o({kind:"back"}),disabled:f,"data-sentry-element":"Button","data-sentry-source-file":"BannerCropModal.tsx",children:"Back"}),(0,t.jsx)(d.Button,{variant:"primary",size:"lg",className:"flex-1",onClick:x,isLoading:f,disabled:!p||!u||f||y,"data-sentry-element":"Button","data-sentry-source-file":"BannerCropModal.tsx",children:"Save"})]})]})},em=async e=>{if(!e.file&&!e.filePath)return null;try{return await (0,M.asyncModal)({id:"banner-crop",options:{dismissOnOverlayClick:!1,dismissOnEsc:!0},builder:(r,a)=>(0,t.jsx)(eu,{imageUrl:e.imageUrl,file:e.file,filePath:e.filePath,originalName:e.originalName,businessId:e.businessId,featuredBusinessId:e.featuredBusinessId,onSuccess:r,onFailure:a})})??null}catch{return null}};var ep=e.i(776872),eh=e.i(812500),ef=e.i(260399),eg=e.i(627655),ey=e.i(976277),ex=e.i(126019);let ev=({product:e})=>e.videoUrl?(0,t.jsx)("video",{loop:!0,muted:!0,autoPlay:!0,playsInline:!0,preload:"metadata",src:e.videoUrl,className:"size-full object-cover"}):e.pictureUrl?(0,t.jsx)(O.ImageErrorBoundary,{src:e.pictureUrl,fallback:(0,t.jsx)(ef.ProductImageFallback,{}),"data-sentry-element":"ImageErrorBoundary","data-sentry-component":"FeaturedProductMedia","data-sentry-source-file":"FeaturedProductSelectionModal.tsx",children:(0,t.jsx)(ex.default,{alt:e.name,width:320,height:320,sizes:"(max-width: 768px) 45vw, 160px",src:e.pictureUrl,className:"size-full object-cover","data-sentry-element":"Image","data-sentry-source-file":"FeaturedProductSelectionModal.tsx"})}):(0,t.jsx)(ef.ProductImageFallback,{}),eb=({product:e,isSelected:r,onSelect:a})=>(0,t.jsxs)("button",{type:"button",className:"group flex min-w-0 flex-col gap-2 text-left",onClick:()=>a(e._id),"data-sentry-component":"FeaturedProductOption","data-sentry-source-file":"FeaturedProductSelectionModal.tsx",children:[(0,t.jsxs)("span",{className:"relative aspect-square w-full overflow-hidden rounded-xl bg-gray-100",children:[(0,t.jsx)(ev,{product:e,"data-sentry-element":"FeaturedProductMedia","data-sentry-source-file":"FeaturedProductSelectionModal.tsx"}),(0,t.jsx)("span",{className:(0,h.cn)("pointer-events-none absolute inset-0 rounded-xl transition-all",r&&"bg-primary-500 opacity-50")}),r&&(0,t.jsx)(eg.CheckmarkCircle02Icon,{className:"absolute right-2 top-2 size-6 rounded-full text-white"})]}),(0,t.jsx)("span",{className:"w-full truncate text-xs text-gray-950",children:e.name})]});function ew({products:e,featuredProductId:r,onSubmit:a,onSuccess:n}){let s=(0,eh.useIsMobile)(),[i,o]=(0,Y.useState)(r),[l,c]=(0,Y.useState)(1),[u,m]=(0,Y.useState)(!1),p=s?4:8,h=(0,Y.useMemo)(()=>{let t=e.find(e=>e._id===r);return t?[t,...e.filter(e=>e._id!==t._id)]:e},[r,e]),f=(0,Y.useMemo)(()=>{let e=(l-1)*p;return h.slice(e,e+p)},[l,h,p]),{paginationRange:g,pageCount:y}=(0,ep.usePagination)({currentPage:l,siblingCount:1,pageSize:p,totalCount:h.length});(0,Y.useEffect)(()=>{c(e=>Math.min(e,Math.max(y,1)))},[y]);let x=async e=>{m(!0);try{await a(e),n(e)}catch(e){console.error("Failed to update featured product:",e),(0,w.toast)({variant:"destructive",description:"Failed to update featured product"})}finally{m(!1)}};return(0,t.jsx)("div",{className:"flex h-full w-full max-w-3xl flex-col gap-6 p-6 md:h-auto md:w-screen","data-sentry-component":"FeaturedProductSelectionModal","data-sentry-source-file":"FeaturedProductSelectionModal.tsx",children:(0,t.jsxs)("div",{className:"flex flex-1 flex-col justify-between gap-6 md:flex-none",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,t.jsxs)("div",{className:"flex flex-col gap-2 pr-8",children:[(0,t.jsx)("h2",{className:"font-inter-display text-h7 font-semibold text-gray-950",children:"Select Your Featured Product"}),(0,t.jsx)("p",{className:"text-sm text-gray-950",children:"Choose a product or service you want visitors to notice first"})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-6",children:[(0,t.jsx)("div",{className:"grid grid-cols-2 gap-4 md:grid-cols-4",children:f.map(e=>(0,t.jsx)(eb,{product:e,isSelected:i===e._id,onSelect:o},e._id))}),y>1&&(0,t.jsx)(ep.StandardPagination,{currentPage:l,pageCount:y,setCurrentPage:c,paginationRange:g})]})]}),(0,t.jsxs)("div",{className:"flex flex-col gap-3",children:[(0,t.jsx)(d.Button,{variant:"primary",size:"md",className:"w-full md:min-h-11",disabled:!i||u,isLoading:u,onClick:()=>{i&&x({type:"select",productId:i})},"data-sentry-element":"Button","data-sentry-source-file":"FeaturedProductSelectionModal.tsx",children:"Feature This Product"}),r&&(0,t.jsx)(d.Button,{variant:"unstyled",size:"none",className:"mx-auto px-3 py-2 text-sm font-medium text-gray-600 hover:text-gray-950",disabled:u,onClick:()=>void x({type:"remove"}),children:"Remove Featured Product"})]})]})})}var ej=e.i(958082),eC=e.i(535522),eS=e.i(525695),eN=e.i(914756);e.i(581516);var eP=e.i(359385),eA=e.i(983396);let ek=(0,e.i(931358).default)("AiImageIcon",[["circle",{cx:"7",cy:"8",r:"1.5",stroke:"currentColor",key:"k0"}],["path",{d:"M20.9977 11C21 11.4701 21 11.9693 21 12.5C21 16.9783 21 19.2175 19.6088 20.6088C18.2175 22 15.9783 22 11.5 22C7.02166 22 4.78249 22 3.39124 20.6088C2 19.2175 2 16.9783 2 12.5C2 8.02166 2 5.78249 3.39124 4.39124C4.78249 3 7.02166 3 11.5 3C12.0307 3 12.5299 3 13 3.00231",stroke:"currentColor",key:"k1"}],["path",{d:"M18.5 2L18.7579 2.69703C19.0961 3.61102 19.2652 4.06802 19.5986 4.40139C19.932 4.73477 20.389 4.90387 21.303 5.24208L22 5.5L21.303 5.75792C20.389 6.09613 19.932 6.26524 19.5986 6.59861C19.2652 6.93198 19.0961 7.38898 18.7579 8.30297L18.5 9L18.2421 8.30297C17.9039 7.38898 17.7348 6.93198 17.4014 6.59861C17.068 6.26524 16.611 6.09613 15.697 5.75792L15 5.5L15.697 5.24208C16.611 4.90387 17.068 4.73477 17.4014 4.40139C17.7348 4.06802 17.9039 3.61102 18.2421 2.69703L18.5 2Z",stroke:"currentColor",key:"k2"}],["path",{d:"M4.5 21.4999C8.87246 16.275 13.7741 9.384 20.9975 14.0424",stroke:"currentColor",key:"k3"}]]);var eE=e.i(958344),eI=e.i(268564),eB=e.i(63785),eO=e.i(274997),eM=e.i(434843),eD=e.i(860612),eL=e.i(67679),eT=e.i(502416),eR=e.i(258401),e_=e.i(198311),ez=e.i(41158),eF=e.i(217837),eU=e.i(203828),e$=e.i(333818);let eK=({isSkipMember:e,className:r})=>e?(0,t.jsx)(m.Tooltip,{content:"Skip Member","data-sentry-element":"Tooltip","data-sentry-component":"SkipMemberBadge","data-sentry-source-file":"BusinessPageContent.tsx",children:(0,t.jsx)("span",{"aria-label":"Skip Member",className:(0,h.cn)("inline-flex size-[18px] flex-shrink-0 items-center justify-center align-middle",r),children:(0,t.jsx)(R.SkipIcon,{name:"skipMemberBadge","data-sentry-element":"SkipIcon","data-sentry-source-file":"BusinessPageContent.tsx"})})}):null,eH=e=>(!e.visibility||"visible"===e.visibility)&&(e.status??"active")==="active",eW=({slug:e,title:r,featuredImageUrl:a,publishedAt:n,businessSlug:s})=>{let i=n?(0,eN.format)(new Date(n),"MMM d, yyyy"):"";return(0,t.jsxs)(ez.default,{href:`/b/${s}/blog/${e}`,className:"flex items-center gap-3","data-sentry-element":"Link","data-sentry-component":"RecentPostCard","data-sentry-source-file":"BusinessPageContent.tsx",children:[(0,t.jsx)(O.ImageErrorBoundary,{src:a??void 0,fallback:(0,t.jsx)("div",{className:"grid h-[60px] w-[72px] min-w-[72px] place-items-center rounded-lg bg-gray-100",children:(0,t.jsx)(eI.File01Icon,{className:"size-6 text-gray-300"})}),"data-sentry-element":"ImageErrorBoundary","data-sentry-source-file":"BusinessPageContent.tsx",children:(0,t.jsx)(ex.default,{width:72,height:60,src:a||"",alt:r,className:"h-[60px] w-[72px] min-w-[72px] rounded-lg object-cover shadow-sm",loading:"lazy","data-sentry-element":"Image","data-sentry-source-file":"BusinessPageContent.tsx"})}),(0,t.jsxs)("div",{className:"flex min-w-0 flex-1 flex-col justify-center gap-1.5",children:[(0,t.jsx)("p",{className:"line-clamp-2 text-sm font-medium text-gray-950",children:r}),i&&(0,t.jsx)("p",{className:"text-xs text-gray-600",children:i})]})]})},eV=({businessId:e,featuredBusinessId:r,customId:a,seeMorePostsHref:n,isCurrentUserOwner:s})=>{let{data:i,isLoading:o}=eS.trpc.blogPosts.listPublishedBlogPostsByBusiness.useQuery({businessId:e,limit:7,excludeSlug:void 0,offset:0},{enabled:!!e}),l=a||r;if(o)return null;if(!i||0===i.length)return s?(0,t.jsxs)("div",{className:"flex flex-col items-center gap-6 rounded-xl border border-gray-100 bg-gray-50 px-8 py-12",children:[(0,t.jsx)(z.OverlappingPostImages,{}),(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2 text-center",children:[(0,t.jsx)("p",{className:"text-md font-semibold text-gray-950",children:"Create Your First Blog"}),(0,t.jsx)("p",{className:"text-sm text-gray-950",children:"Create blog posts instantly and reach a wider audience"})]}),(0,t.jsxs)(d.Button,{variant:"secondary",onClick:()=>(0,_.openBlogEditorModal)(),children:[(0,t.jsx)(eA.Add01Icon,{className:"size-5"}),"Create New Post"]})]}):null;
2let c=i.length>6,u=c?i.slice(0,6):i;return(0,t.jsxs)("div",{className:"flex flex-col gap-6 rounded-xl border border-gray-100 bg-gray-50 p-6 md:p-8","data-sentry-component":"RecentPostsSection","data-sentry-source-file":"BusinessPageContent.tsx",children:[(0,t.jsx)("h2",{className:"font-inter-display text-h7 font-semibold text-gray-950",children:"Recent Posts"}),(0,t.jsx)("div",{className:"flex flex-col gap-8",children:u.map(e=>(0,t.jsx)(eW,{slug:e.slug,title:e.title,featuredImageUrl:e.featuredImageUrl,publishedAt:e.publishedAt,businessSlug:l},e.slug))}),c&&(0,t.jsx)(d.Button,{variant:"secondary",asChild:!0,children:(0,t.jsx)(ez.default,{href:n,children:"See More Posts"})})]})},eG=(0,Y.createContext)(null),eq=()=>{let e=(0,Y.useContext)(eG);if(!e)throw Error("useOpenEditListing must be used inside EditListingProvider");return e},eY=({children:e,publicListing:r,isCurrentUserOwner:n})=>{let s=(0,a.useStore)(f.$listOfBusinesses),[l,c]=(0,Y.useState)(!1),d=(0,eF.useSearchParams)(),u=d?.get("modal")==="edit-listing",m=(0,Y.useMemo)(()=>s.value?.find(e=>e._id===r.businessId)?.latestRevenue||0,[s.value,r.businessId]),p=(0,Y.useCallback)(()=>{(0,o.eventRaven)("businessPageClick",{action:"editListingModal"}),c(!0)},[]);(0,K.useParamModal)({modalId:"edit-listing",launch:n?async()=>p():null});let h=(0,Y.useCallback)(e=>{c(e),!e&&u&&(0,i.webviewMessage)("close")},[u]);return(0,t.jsxs)(eG.Provider,{value:p,"data-sentry-element":"EditListingContext.Provider","data-sentry-component":"EditListingProvider","data-sentry-source-file":"BusinessPageContent.tsx",children:[e,n&&(0,t.jsx)(P.EditListingSidesheet,{publicListing:r,latestRevenue:m,open:l,onOpenChange:h})]})},eZ=(0,r.persistentMap)("ai-review-banner-dismissed:"),eX=({businessId:e})=>{let r=eq(),n=(0,a.useStore)(eZ)[e],s=(0,Y.useCallback)(()=>{eZ.setKey(e,"true")},[e]),i=(0,Y.useCallback)(()=>{s(),r()},[s,r]);return n?null:(0,t.jsxs)("div",{className:"flex w-full flex-col gap-3 rounded-xl border border-purple-200 bg-purple-50 px-5 py-3 sm:flex-row sm:items-center sm:gap-4","data-sentry-component":"AiReviewBannerConnected","data-sentry-source-file":"BusinessPageContent.tsx",children:[(0,t.jsxs)("div",{className:"flex items-start justify-between sm:contents",children:[(0,t.jsx)(eR.SparklesIcon,{className:"size-5 shrink-0 text-purple-500","data-sentry-element":"SparklesIcon","data-sentry-source-file":"BusinessPageContent.tsx"}),(0,t.jsx)(d.Button,{variant:"unstyled",size:"none",onClick:s,className:"shrink-0 text-gray-950 hover:text-gray-600 sm:order-last","aria-label":"Dismiss","data-sentry-element":"Button","data-sentry-source-file":"BusinessPageContent.tsx",children:(0,t.jsx)(eE.Cancel01Icon,{className:"size-4","data-sentry-element":"Cancel01Icon","data-sentry-source-file":"BusinessPageContent.tsx"})})]}),(0,t.jsxs)("div",{className:"min-w-0 flex-1 text-sm text-gray-950",children:[(0,t.jsx)("p",{className:"font-semibold",children:"Your AI Cofounder created your business page."}),(0,t.jsx)("p",{children:"We used the information you provided to create and improve your business details. Review everything to make sure it looks right."})]}),(0,t.jsx)(d.Button,{variant:"secondary",size:"sm",className:"w-full shrink-0 sm:w-auto",onClick:i,"data-sentry-element":"Button","data-sentry-source-file":"BusinessPageContent.tsx",children:"Review & Confirm"})]})},eQ=async({featuredBusinessId:e,businessId:t})=>{try{let r;do{let a=await (0,eC.openMediaSelectionModal)(t,{title:"Upload Banner Image"});if(!a||!(r=await em({imageUrl:a.url,file:a.file,filePath:a.filePath,originalName:a.name,businessId:t,featuredBusinessId:e})))return}while("back"===r.kind)await (0,eP.setDoc)((0,eP.doc)((0,b.collection)("featured_business").ref,e),{bannerUrl:r.url,updatedAt:new Date().toISOString()},{merge:!0}),(0,w.toast)({variant:"success",title:"Banner updated successfully"})}catch(e){console.error("Banner upload failed:",e),(0,w.toast)({variant:"destructive",title:"Failed to upload banner",description:"Please try again."})}},eJ=({publicListing:e,isCurrentUserOwner:r})=>{let a=r?"img":ex.default,n=(0,Y.useMemo)(()=>r?e.bannerUrl?`${e.bannerUrl}${e.bannerUrl.includes("?")?"&":"?"}t=${e.updatedAt||Date.now()}`:"/images/featured-business/featured-blank-banner.png":e.bannerUrl||"/images/featured-business/featured-blank-banner.png",[r,e]);
2return r&&!e.bannerUrl?(0,t.jsxs)(e_.motion.div,{animate:{opacity:1,y:0},initial:{opacity:0,y:10},className:"relative -mb-14 aspect-[3.75/1] w-full overflow-hidden rounded-xl bg-gray-50 md:rounded-2xl",children:[(0,t.jsx)(ex.default,{src:"/images/featured-business/featured-blank-banner.png",alt:"","aria-hidden":!0,fill:!0,sizes:"100vw",className:"absolute inset-0 h-full w-full object-cover opacity-40 grayscale",loading:"lazy"}),(0,t.jsx)("div",{className:"absolute left-1/2 top-1/2 h-1/2 w-2/5 -translate-x-1/2 -translate-y-1/2 rounded-full bg-white blur-3xl"}),(0,t.jsx)("div",{className:"absolute inset-0 flex items-end justify-end pb-3 pr-3 md:hidden",children:(0,t.jsxs)(p.DropdownMenu,{children:[(0,t.jsx)(p.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsx)(d.Button,{variant:"secondary",icon:!0,"aria-label":"Add banner image",children:(0,t.jsx)(eO.ImageAdd01Icon,{className:"size-5"})})}),(0,t.jsxs)(p.DropdownMenuContent,{align:"end",className:"w-44 p-2",children:[(0,t.jsx)(p.DropdownMenuItem,{asChild:!0,children:(0,t.jsxs)(ez.default,{href:x.routes.IMAGINE,className:"flex items-center gap-2",children:[(0,t.jsx)(ek,{className:"size-4 text-gray-600"}),"Create Banner"]})}),(0,t.jsxs)(p.DropdownMenuItem,{className:"flex items-center gap-2",onSelect:()=>eQ({featuredBusinessId:e._id,businessId:e.businessId}),children:[(0,t.jsx)(eO.ImageAdd01Icon,{className:"size-4 text-gray-600"}),"Upload Banner"]})]})]})}),(0,t.jsxs)("div",{className:"absolute inset-0 hidden flex-col items-center justify-center gap-3.5 px-6 text-center md:flex",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center gap-1.5",children:[(0,t.jsx)("p",{className:"text-lg font-semibold text-gray-950",children:"Complete Your Business Page"}),(0,t.jsxs)("p",{className:"text-sm text-gray-700",children:["Instantly"," ",(0,t.jsx)(ez.default,{href:x.routes.IMAGINE,className:"text-primary-600 hover:underline",children:"create"})," ","banner or"," ",(0,t.jsx)("button",{type:"button",onClick:()=>eQ({featuredBusinessId:e._id,businessId:e.businessId}),className:"text-primary-600 hover:underline",children:"upload"})," ","to make your page stand out"]})]}),(0,t.jsx)(d.Button,{variant:"secondary",asChild:!0,children:(0,t.jsxs)(ez.default,{href:x.routes.IMAGINE,children:[(0,t.jsx)(ek,{className:"size-5"}),"Create Banner"]})})]})]}):(0,t.jsxs)(e_.motion.div,{animate:{opacity:1,y:0},initial:{opacity:0,y:10},className:"relative -mb-14 aspect-[3.75/1] w-full overflow-hidden rounded-xl md:rounded-2xl","data-sentry-element":"motion.div","data-sentry-component":"BusinessBanner","data-sentry-source-file":"BusinessPageContent.tsx",children:[(0,t.jsx)(a,{src:n,alt:e.businessName,fill:!0,className:"absolute inset-0 size-full object-cover animate-in",loading:"lazy","data-sentry-element":"ImageComp","data-sentry-source-file":"BusinessPageContent.tsx"}),(0,t.jsxs)(d.Button,{variant:"secondary",onClick:()=>eQ({featuredBusinessId:e._id,businessId:e.businessId}),className:(0,h.cn)("absolute bottom-3 right-3 px-3 md:bottom-5 md:right-5 md:px-4",{hidden:!r}),"data-sentry-element":"Button","data-sentry-source-file":"BusinessPageContent.tsx",children:[(0,t.jsx)(eO.ImageAdd01Icon,{className:"size-4 md:size-5","data-sentry-element":"ImageAdd01Icon","data-sentry-source-file":"BusinessPageContent.tsx"}),(0,t.jsx)("span",{className:"max-md:hidden",children:"Update Image"})]})]})},e0=({publicListing:e,isCurrentUserOwner:r})=>{let a=r?"img":ex.default,n=eq();return(0,t.jsx)("div",{className:"relative flex flex-col items-center","data-sentry-component":"BusinessLogo","data-sentry-source-file":"BusinessPageContent.tsx",children:(0,t.jsxs)(e_.motion.div,{animate:{opacity:1,y:0},initial:{opacity:0,y:10},className:(0,h.cn)("items-center justify-center overflow-hidden rounded-xl border-2 border-solid border-white bg-white delay-0 md:rounded-[1.25rem]"),"data-sentry-element":"motion.div","data-sentry-source-file":"BusinessPageContent.tsx",children:[(0,t.jsx)(O.ImageErrorBoundary,{src:e.pictureUrl,fallback:(0,t.jsx)("div",{className:"flex size-[72px] max-h-[72px] max-w-[72px] items-center justify-center rounded-[calc(0.75rem-3px)] bg-gray-200 md:size-[120px] md:max-h-[120px] md:max-w-[120px] md:rounded-[calc(1.25rem-6px)]",children:(0,t.jsx)(u.HugeIcon,{name:"Store04Icon",className:"size-8 text-gray-300 md:size-14"})}),"data-sentry-element":"ImageErrorBoundary","data-sentry-source-file":"BusinessPageContent.tsx",children:(0,t.jsx)(a,{src:e.pictureUrl,alt:e.businessName,width:256,height:256,className:"size-[72px] max-h-[72px] max-w-[72px] object-cover md:size-[120px] md:max-h-[120px] md:max-w-[120px] md:rounded-[calc(1.25rem-6px)]",loading:"lazy","data-sentry-element":"ImageComp","data-sentry-source-file":"BusinessPageContent.tsx"})}),(0,t.jsx)(d.Button,{variant:"unstyled",size:"none",className:(0,h.cn)("absolute bottom-0 right-0 z-10 flex size-8 items-center justify-center rounded-[0.625rem] border border-gray-50 bg-white shadow-xs",{hidden:!r}),onClick:n,"data-sentry-element":"Button","data-sentry-source-file":"BusinessPageContent.tsx",children:(0,t.jsx)(eB.Image01Icon,{className:"size-4 text-gray-950","data-sentry-element":"Image01Icon","data-sentry-source-file":"BusinessPageContent.tsx"})})]})})},e1=({publicListing:e,isCurrentUserOwner:r,showUnverifiedGetVerifiedCta:a})=>
2a&&"verified"!==e.verificationStatus&&r?(0,t.jsx)(d.Button,{variant:"unstyled",size:"none",className:"rounded-full",onClick:t=>{t.stopPropagation(),(0,F.openBusinessVerificationSheet)(e.businessId)},children:(0,t.jsxs)(c.Badge,{variant:"squared",color:"gray",className:"space-x-1 rounded-full",children:[(0,t.jsx)(B.ReactComponent,{className:"size-2.5 align-middle text-primary-500"}),(0,t.jsx)("span",{children:"Get Verified"})]})}):(0,t.jsx)(E.VerificationBadge,{verificationStatus:e.verificationStatus,"data-sentry-element":"VerificationBadge","data-sentry-component":"BusinessVerificationMarker","data-sentry-source-file":"BusinessPageContent.tsx"}),e2=({publicListing:e,accountFullName:r,followersCount:a,isCurrentUserOwner:n,isSkipMember:s,showUnverifiedGetVerifiedCta:i})=>{let o=eq(),c=(0,Y.useRef)(null),[d,u]=(0,Y.useState)(!1);return(0,Y.useEffect)(()=>{if(!c.current)return;let e=new ResizeObserver(()=>{c.current&&u(c.current.clientHeight>24)});return e.observe(c.current),()=>e.disconnect()},[]),(0,t.jsxs)(e_.motion.div,{transition:{delay:.1},animate:{opacity:1,y:0},initial:{opacity:0,y:10},className:"flex flex-col items-center gap-4","data-sentry-element":"motion.div","data-sentry-component":"BusinessIdentity","data-sentry-source-file":"BusinessPageContent.tsx",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("h5",{className:(0,h.cn)("inline align-middle font-inter-display text-h7 font-semibold text-gray-950 md:text-h6"),children:e.businessName}),(0,t.jsx)(e1,{publicListing:e,isCurrentUserOwner:n,showUnverifiedGetVerifiedCta:i,"data-sentry-element":"BusinessVerificationMarker","data-sentry-source-file":"BusinessPageContent.tsx"}),(0,t.jsx)(eK,{isSkipMember:s,"data-sentry-element":"SkipMemberBadge","data-sentry-source-file":"BusinessPageContent.tsx"}),n&&(0,t.jsx)(N.EditButton,{onClick:o,className:"ml-0"})]}),(0,t.jsxs)("div",{className:"flex flex-col items-center gap-1",children:[(0,t.jsxs)("div",{ref:c,className:"flex flex-wrap items-center justify-center gap-3 text-center text-sm text-gray-950",children:[r&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("p",{children:["By ",r]}),(0,t.jsx)("span",{className:"text-gray-300",children:"â¢"})]}),e.businessCategory&&(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("p",{children:l.BUSINESS_CATEGORIES_MAP[e.businessCategory]}),(0,t.jsx)("span",{className:"text-gray-300",children:"â¢"})]}),(0,t.jsxs)("p",{children:[e.businessCity,", ",e.businessState]}),(0,t.jsx)(C.BusinessHeaderStats,{isOwner:!!n,businessId:e.businessId,followersCount:a,isDoubleLine:d,"data-sentry-element":"BusinessHeaderStats","data-sentry-source-file":"BusinessPageContent.tsx"})]}),!n&&(0,t.jsx)(S.BusinessMutualLine,{targetBusinessId:e.businessId})]})]})},e5=({publicListing:e,aiAgentSummary:r,isFollowLoading:a,liked:n,onToggleFollow:i})=>{let o=(0,s.addHttpSchema)(e.websiteUrl);return(0,t.jsxs)("div",{className:"flex items-center gap-3","data-sentry-component":"BusinessActions","data-sentry-source-file":"BusinessPageContent.tsx",children:[r&&(0,t.jsx)(g.AiAgentSideSheet,{publicListing:e,children:(0,t.jsx)(d.Button,{variant:"neutral",children:"Ask AI Agent"})}),(0,t.jsx)(d.Button,{isLoading:a,variant:"secondary",onClick:i,"data-sentry-element":"Button","data-sentry-source-file":"BusinessPageContent.tsx",children:n?"Following":"Follow Us"}),(0,t.jsxs)(p.DropdownMenu,{"data-sentry-element":"DropdownMenu","data-sentry-source-file":"BusinessPageContent.tsx",children:[(0,t.jsx)(p.DropdownMenuTrigger,{asChild:!0,"data-sentry-element":"DropdownMenuTrigger","data-sentry-source-file":"BusinessPageContent.tsx",children:(0,t.jsx)(d.Button,{variant:"secondary",icon:!0,className:"size-10",onClick:e=>e.stopPropagation(),"data-sentry-element":"Button","data-sentry-source-file":"BusinessPageContent.tsx",children:(0,t.jsx)(eD.MoreVerticalCircle01Icon,{className:"size-6 text-gray-600","data-sentry-element":"MoreVerticalCircle01Icon","data-sentry-source-file":"BusinessPageContent.tsx"})})}),(0,t.jsxs)(p.DropdownMenuContent,{className:"w-56 rounded-lg border border-gray-100 bg-white p-2 shadow-lg","data-sentry-element":"DropdownMenuContent","data-sentry-source-file":"BusinessPageContent.tsx",children:[o&&(0,t.jsx)(p.DropdownMenuItem,{asChild:!0,children:(0,t.jsxs)(ez.default,{href:o,target:"_blank",rel:"noopener noreferrer",className:"flex w-full items-center text-gray-950",children:[(0,t.jsx)(eM.InternetIcon,{className:"mr-2 size-4 text-gray-600"}),"Go To Website"]})}),(0,t.jsxs)(p.DropdownMenuItem,{onSelect:()=>
2{(0,M.openModalSync)({id:"share-listing-modal",content:(0,t.jsx)(L.ShareListingModal,{featuredBusiness:e})})},"data-sentry-element":"DropdownMenuItem","data-sentry-source-file":"BusinessPageContent.tsx",children:[(0,t.jsx)(eT.Share05Icon,{className:"mr-2 size-4 text-gray-600","data-sentry-element":"Share05Icon","data-sentry-source-file":"BusinessPageContent.tsx"}),"Share Business"]})]})]})]})},e3=({publicListing:e,aiAgentSummary:r,accountFullName:a,featuredBusinessLikeState:n,isCurrentUserOwner:s,isSkipMember:i,showUnverifiedGetVerifiedCta:o})=>{let{liked:l,count:c,toggle:d,isLoading:u}=n;return(0,t.jsxs)("div",{className:"flex w-full flex-col items-center gap-6","data-sentry-component":"BusinessPageHero","data-sentry-source-file":"BusinessPageContent.tsx",children:[(0,t.jsx)(eJ,{publicListing:e,isCurrentUserOwner:s,"data-sentry-element":"BusinessBanner","data-sentry-source-file":"BusinessPageContent.tsx"}),(0,t.jsx)(e0,{publicListing:e,isCurrentUserOwner:s,"data-sentry-element":"BusinessLogo","data-sentry-source-file":"BusinessPageContent.tsx"}),(0,t.jsx)(e2,{publicListing:e,accountFullName:a,followersCount:c,isCurrentUserOwner:s,isSkipMember:i,showUnverifiedGetVerifiedCta:o,"data-sentry-element":"BusinessIdentity","data-sentry-source-file":"BusinessPageContent.tsx"}),(0,t.jsx)(e5,{publicListing:e,aiAgentSummary:r,isFollowLoading:u,liked:l,onToggleFollow:d,"data-sentry-element":"BusinessActions","data-sentry-source-file":"BusinessPageContent.tsx"})]})},e6=({publicListing:e,businessProducts:r,allBusinessProducts:a,hasProducts:n,isCurrentUserOwner:s,showAllProducts:i,onShowAllProducts:l,hiddenProductsCount:c})=>{if(0===r.length)return n?null:(0,t.jsxs)("div",{className:(0,h.cn)("px-5 xl:px-0",{hidden:!s}),children:[(0,t.jsx)("h2",{className:"mb-6 font-inter-display text-h7 font-semibold capitalize text-gray-950",children:"Products & Services"}),(0,t.jsx)(ej.EditProductsContent,{isFromModal:!1})]});let u=e.customId||e._id;return(0,t.jsxs)("section",{className:"px-5 xl:px-0","data-sentry-component":"ProductsSection","data-sentry-source-file":"BusinessPageContent.tsx",children:[(0,t.jsxs)("span",{className:"mb-6 flex flex-row items-center gap-2.5 font-semibold",children:[(0,t.jsx)("h2",{className:"font-inter-display text-h7 capitalize text-gray-950",children:"Products & Services"}),s&&(0,t.jsx)(ez.default,{href:x.routes.DASHBOARD_PAYMENTS,target:"_blank",onClick:()=>{(0,o.eventRaven)("businessPageClick",{action:"viewProductPageClick"})},children:(0,t.jsx)(eL.PencilEdit01Icon,{className:"size-5 text-gray-600"})})]}),(0,t.jsx)("div",{className:"grid grid-cols-1 gap-x-4 gap-y-8 md:grid-cols-4 md:gap-x-6 md:gap-y-12",children:r.map(e=>{let r=(0,v.getProductRoutePath)({businessSlug:u,productId:e._id,productName:e.name,products:a});return(0,t.jsx)(A.ProductCard,{productId:e._id,name:e.name,price:e.price,videoUrl:e.videoUrl,pictureUrl:e.pictureUrl,description:e.description,isCurrentUserOwner:s,linkTo:r,disableHover:!0,initialLikeCount:e.likeCount,likeSource:"business_page",imageSizes:"(max-width: 750px) 80px, 280px"},e._id)})}),!i&&c>0&&(0,t.jsxs)(d.Button,{variant:"secondary",className:"mt-8 w-full md:w-fit",onClick:l,children:["See More (",c,")"]})]})},e4=({aboutSection:e,isCurrentUserOwner:r})=>{let a=eq();return(0,t.jsxs)("div",{className:"flex flex-col gap-4 px-5 md:gap-5 xl:px-0","data-sentry-component":"AboutSection","data-sentry-source-file":"BusinessPageContent.tsx",children:[(0,t.jsxs)("div",{className:"flex flex-row items-center",children:[(0,t.jsx)("h2",{className:"font-inter-display text-h7 font-semibold text-gray-950 lg:text-h6",children:"About Us"}),r&&(0,t.jsx)(N.EditButton,{onClick:a})]}),(0,t.jsx)(D.Markdown,{components:{...D.markdownComponents},"data-sentry-element":"Markdown","data-sentry-source-file":"BusinessPageContent.tsx",children:e})]})},e7=e=>{let t;return t=e??"",(t.match(/^\s*\*\*.+\?\*\*/gm)?.length??0)>=3},e8=({aiAgentSummary:e,isCurrentUserOwner:r})=>{let{push:a}=(0,eU.useRouter)(),n=e7(e?.summary);return e&&(n||r)?(0,t.jsxs)("section",{className:"rounded-2xl px-5 xl:px-0","data-sentry-component":"FaqSection","data-sentry-source-file":"BusinessPageContent.tsx",children:[(0,t.jsxs)("div",{className:"flex flex-row items-center",children:[(0,t.jsx)("h2",{className:"ai-gradient-text font-inter-display text-h7 font-semibold text-gray-950 lg:text-h6",children:"Frequently Asked Questions"}),(0,t.jsx)(N.EditButton,{className:(0,h.cn)({hidden:!r}),onClick:()=>{(0,o.eventRaven)("businessPageClick",{action:"editFaqModal"}
2),(0,M.openModalSync)({id:"edit-faq-modal",content:(0,t.jsx)(T.StandardModal,{icon:(0,t.jsx)(eL.PencilEdit01Icon,{}),title:"Edit Your FAQ",description:(0,t.jsx)("p",{className:"text-md",children:"Update your AI Agent and your FAQ will be regenerated."}),buttonText:"Update AI Agent",onPrimaryClick:()=>a(x.routes.DASHBOARD_WORKSPACE_AGENT)}),options:{dismissOnRouteChange:!0}})},"data-sentry-element":"EditButton","data-sentry-source-file":"BusinessPageContent.tsx"})]}),(0,t.jsxs)("p",{className:"mt-1 text-sm text-gray-600",children:["Generated from business"," ",(0,t.jsx)(ez.default,{href:`${x.routes.AI_AGENT_PUBLIC}?source=BusinessPage`,target:"_blank",className:"text-primary-700","data-sentry-element":"Link","data-sentry-source-file":"BusinessPageContent.tsx",children:"AI Agent"})]}),(0,t.jsx)("div",{className:"mt-5 space-y-[1em] text-md",children:e.summary.split("\n").map((e,r)=>(0,t.jsx)(D.Markdown,{components:{...D.markdownComponents},children:e},r))})]}):null},e9=({publicListing:e,businessContactEmail:r,isCurrentUserOwner:a,originalBusinessProducts:n,featuredProduct:s})=>{let i=()=>{(({products:e,featuredProductId:r,onSubmit:a})=>(0,M.asyncModal)({id:"featured-product-selection",options:{dismissOnEsc:!0,dismissOnOverlayClick:!0,dismissOnRouteChange:!0,fullscreen:!0},builder:n=>(0,t.jsx)(ew,{products:e,featuredProductId:r,onSubmit:a,onSuccess:n})}).catch(ey.default))({featuredProductId:e.featuredProductId??void 0,products:n,onSubmit:async t=>{let r="select"===t.type?t.productId:null;await (0,eP.updateDoc)((0,eP.doc)((0,b.collection)("featured_business").ref,e._id),{featuredProductId:r??(0,eP.deleteField)(),updatedAt:eP.Timestamp.now()}),(0,w.toast)({variant:"success",title:"select"===t.type?"Your featured product is successfully added":"Your featured product has been removed"})}})};return a&&!s&&n.length>0?(0,t.jsxs)("div",{className:"flex min-h-60 flex-col items-center justify-center gap-4 self-stretch rounded-2xl border border-dashed border-gray-200 bg-gray-50 p-6",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center gap-2.5",children:[(0,t.jsx)("h2",{className:"font-inter-display text-h7 font-semibold capitalize text-gray-950",children:"Feature a Product"}),(0,t.jsx)("p",{className:"text-gray-950",children:"Highlight a product or service you want visitors to notice first"})]}),(0,t.jsx)(d.Button,{variant:"secondary",onClick:i,children:"Add Product or Service"})]}):s?(0,t.jsxs)("section",{className:"flex flex-col gap-6 px-5 xl:px-0","data-sentry-component":"FeaturedProductSection","data-sentry-source-file":"BusinessPageContent.tsx",children:[(0,t.jsxs)("div",{className:"mb-6 flex flex-row items-center gap-2.5 font-semibold",children:[(0,t.jsx)("h2",{className:"font-inter-display text-h7 capitalize text-gray-950",children:"Featured"}),a&&(0,t.jsx)(eL.PencilEdit01Icon,{className:"size-5 cursor-pointer text-gray-600",onClick:i})]}),(0,t.jsx)(e$.ProductDetailsSection,{className:"border-0 p-0 md:p-0",product:s,publicListing:e,businessContactEmail:r,businessVerificationStatus:"verified"===e.verificationStatus?"verified":void 0,showFulfillmentPill:!0,"data-sentry-element":"ProductDetailsSection","data-sentry-source-file":"BusinessPageContent.tsx"})]}):null},te=({publicListing:e,businessProducts:r,aiAgentSummary:a,businessContactEmail:n,isCurrentUserOwner:s,showAllProducts:i,onShowAllProducts:o,hiddenProductsCount:l,originalBusinessProducts:c,featuredProduct:d})=>{let u=c.length>0,m=!!d||!!s&&u,p=r.length>0||!!s&&!u,f=e7(a?.summary)||!!s&&!!a;return(0,t.jsxs)("section",{className:"flex min-w-0 flex-1 flex-col gap-8 lg:gap-10","data-sentry-component":"BusinessMainContent","data-sentry-source-file":"BusinessPageContent.tsx",children:[(0,t.jsx)(e9,{publicListing:e,businessContactEmail:n,isCurrentUserOwner:s,originalBusinessProducts:c,featuredProduct:d,"data-sentry-element":"FeaturedProductSection","data-sentry-source-file":"BusinessPageContent.tsx"}),(0,t.jsx)("hr",{className:(0,h.cn)("border-gray-100",{hidden:!(m&&p)})}),(0,t.jsx)(e6,{publicListing:e,businessProducts:r,allBusinessProducts:c,hasProducts:u,isCurrentUserOwner:s,showAllProducts:i,onShowAllProducts:o,hiddenProductsCount:l,"data-sentry-element":"ProductsSection","data-sentry-source-file":"BusinessPageContent.tsx"}),(0,t.jsx)("hr",{className:(0,h.cn)("border-gray-100",{hidden:!m&&!p})}),(0,t.jsx)(e4,{aboutSection:e.aboutSection,isCurrentUserOwner:s,"data-sentry-element":"AboutSection","data-sentry-source-file":"BusinessPageContent.tsx"}),(0,t.jsx)("hr",{className:(0,h.cn)("border-gray-100",{hidden:!f})}),(0,t.jsx)(e8,{aiAgentSummary:a,isCurrentUserOwner:s,"data-sentry-element":"FaqSection","data-sentry-source-file":"BusinessPageContent.tsx"})]})},tt=({publicListing:e,aiAgentSummary:r})=>(0,t.jsxs)("div",{className:"relative flex flex-col rounded-xl border border-purple-100 bg-purple-50 p-6 md:p-8","data-sentry-component":"AiAgentCallout","data-sentry-source-file":"BusinessPageContent.tsx",children:[(0,t.jsx)(ex.default,{src:"/images/featured-business/featured-ask-us-bg.png",alt:"bg-image",className:"absolute right-0 top-0 z-0",width:300,height:300,"data-sentry-element":"Image","data-sentry-source-file":"BusinessPageContent.tsx"}),(0,t.jsx)("h2",{className:"mb-1.5 font-inter-display text-h7 font-semibold text-purple-700",children:r?"Have Questions?":"Create Your AI Business Agent"}),(0,t.jsx)("p",{className:"mb-4",children:r?"What do you want to know about our business? Go ahead and ask":"Add an AI assistant to answer questions and help customers 24/7."}),r?(0,t.jsx)(g.AiAgentSideSheet,{publicListing:e,children:(0,t.jsxs)(d.Button,{variant:"secondary",icon:!0,className:"w-fit px-3",children:[(0,t.jsx)(I.ReactComponent,{className:"size-5"}),"Ask Us"]})}):(0,t.jsx)(d.Button,{variant:"secondary",icon:!0,className:"w-fit px-3",asChild:!0,children:(0,t.jsxs)(ez.default,{href:x.routes.AI_CHAT+"?prompt=Create an AI Agent for My Business",children:[(0,t.jsx)(I.ReactComponent,{className:"size-5"}),"Create Agent"]})})]}),tr=({publicListing:e,aiAgentSummary:r,forceColumnLayout:a,isCurrentUserOwner:n,seeMorePostsHref:s})=>{let i=n&&!r||!n&&r;return(0,t.jsxs)("section",{className:(0,h.cn)("flex w-full max-w-full flex-col gap-4 px-5 xl:gap-5 xl:px-0",{"xl:w-[22.5rem] xl:min-w-[22.5rem] xl:max-w-[22.5rem] xl:flex-shrink-0":!a}),"data-sentry-component":"BusinessSidebar","data-sentry-source-file":"BusinessPageContent.tsx",children:[i&&(0,t.jsx)(tt,{publicListing:e,aiAgentSummary:r}),(0,t.jsx)(eV,{businessId:e.businessId,featuredBusinessId:e._id,customId:e.customId,seeMorePostsHref:s,isCurrentUserOwner:n,"data-sentry-element":"RecentPostsSection","data-sentry-source-file":"BusinessPageContent.tsx"})]})},ta=({businesses:e})=>e&&0!==e.length?(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"mx-auto flex w-full max-w-[1200px] flex-col gap-5 px-5 md:hidden",children:[(0,t.jsx)("h2",{className:"font-inter-display text-h7 font-semibold",children:"Discover More"}),(0,t.jsx)("div",{className:"flex flex-col gap-4",children:e.slice(0,6).map(e=>(0,t.jsx)(U.BusinessCardV2,{featuredBusiness:e,className:"w-full",onClick:()=>
2(0,y.openBusinessPanel)(e._id)},e._id))})]}),(0,t.jsx)(k.Section,{title:"Discover More",items:e,className:(0,h.cn)("mx-auto max-w-[1200px] overflow-hidden px-5 xl:px-0","hidden md:block"),"data-sentry-element":"Section","data-sentry-source-file":"BusinessPageContent.tsx"})]}):null,tn=({publicListing:e,businessProducts:r,aiAgentSummary:s,accountFullName:i,businessContactEmail:o,showDiscoverMore:l=!0,disableContainerPadding:c=!1,forceColumnLayout:d=!1,isSkipMember:u,seeMorePostsHref:m,withBusinessProfilePanel:p=!0,showUnverifiedGetVerifiedCta:g=!1})=>{let{data:x}=eS.trpc.featuredBusinesses.publicListings.useQuery({limit:5,page:1,type:void 0,categories:void 0,internal_test:!1,search:void 0},{enabled:l}),v=(0,a.useStore)(f.$listOfBusinesses),[b,w]=(0,Y.useState)(null),C=!1!==e.displayFounderName?i:null,S=b?.businessId===e.businessId&&b.value,N=e.featuredProductId??null,P=(0,Y.useMemo)(()=>(0,j.createBusinessFeaturedProductAtom)(e.businessId,N),[e.businessId,N]),A=(0,a.useStore)(P),k=(0,$.useFeaturedBusinessLike)({featuredBusinessId:e._id,initialLikeCount:e.likeCount||0}),E=(0,Y.useMemo)(()=>v.value?.find(t=>t._id===e.businessId),[v.value,e.businessId]),I=!!E,B=I&&"onboarding"===E.createdFrom,O=(0,Y.useMemo)(()=>{if(!N)return null;let e=A.value??r.find(e=>e._id===N);return e&&eH(e)?e:null},[A.value,r,N]),[M,D,L]=(0,Y.useMemo)(()=>{let e=r.filter(e=>eH(e)&&e._id!==O?._id).sort(n.sortByProductOrder),t=null!=O?[O,...e]:e;if(!S){let r=e.slice(0,8),a=e.length-r.length;return[r,t,a]}return[e,t,0]},[r,O,S]);return(0,t.jsxs)("main",{className:(0,h.cn)("mx-auto flex w-full max-w-[1200px] flex-col items-center gap-8 md:gap-10",{"max-md:pb-10":!c}),"data-sentry-component":"BusinessPageContent","data-sentry-source-file":"BusinessPageContent.tsx",children:[(0,t.jsxs)(eY,{publicListing:e,isCurrentUserOwner:I,"data-sentry-element":"EditListingProvider","data-sentry-source-file":"BusinessPageContent.tsx",children:[B&&(0,t.jsx)(eX,{businessId:e.businessId}),(0,t.jsx)(e3,{publicListing:e,aiAgentSummary:s,accountFullName:C,featuredBusinessLikeState:k,isCurrentUserOwner:I,isSkipMember:u,showUnverifiedGetVerifiedCta:g,"data-sentry-element":"BusinessPageHero","data-sentry-source-file":"BusinessPageContent.tsx"}),(0,t.jsx)("hr",{className:"w-full border-gray-100"}),(0,t.jsxs)("div",{className:(0,h.cn)("flex w-full flex-col gap-8 lg:gap-10",{"xl:flex-row":!d}),children:[(0,t.jsx)(te,{publicListing:e,businessProducts:M,hiddenProductsCount:L,aiAgentSummary:s,businessContactEmail:o,isCurrentUserOwner:I,showAllProducts:S,onShowAllProducts:()=>w({businessId:e.businessId,value:!0}),originalBusinessProducts:D,featuredProduct:O,"data-sentry-element":"BusinessMainContent","data-sentry-source-file":"BusinessPageContent.tsx"}),(0,t.jsx)(tr,{publicListing:e,aiAgentSummary:s,forceColumnLayout:d,isCurrentUserOwner:I,seeMorePostsHref:m,"data-sentry-element":"BusinessSidebar","data-sentry-source-file":"BusinessPageContent.tsx"})]}),l&&(0,t.jsx)(ta,{businesses:x?.records})]}),p?(0,t.jsx)(y.BusinessProfilePanel,{}):null]})}},323554,e=>{"use strict";e.s(["BusinessProfilePanel",()=>E,"openBusinessPanel",()=>C]);var t=e.i(391398),r=e.i(605628),a=e.i(275885),n=e.i(613572),s=e.i(473535),i=e.i(126830),o=e.i(567573),l=e.i(812500);e.i(753051);var c=e.i(593537),d=e.i(552579),u=e.i(853062),m=e.i(962027),p=e.i(811084);e.i(581516);var h=e.i(359385),f=e.i(741673),g=e.i(868462),y=e.i(706770),x=e.i(191788),v=e.i(292558),b=e.i(493349),w=e.i(469677);let j=(0,y.atom)(null),C=e=>j.set(e),S=()=>j.set(null),N=e=>(0,p.useSuspenseQuery)({queryKey:["public-listing",e],queryFn:async()=>{let t=(0,n.collection)("featured_business").ref,r=null,a=await (0,h.getDoc)((0,h.doc)(t,e));if(a.exists())r={...a.data(),_id:a.id};else{let a=(0,h.query)(t,(0,h.where)("businessId","==",e),(0,h.limit)(1)),n=await (0,h.getDocs)(a);if(!n.empty){let e=n.docs[0];r={...e.data(),_id:e.id}}}if(!r)throw Error(`Public listing not found for ID: ${e}`);if(!r.businessId)throw Error(`Public listing ${r._id} is missing businessId`);return r}}),P=({publicListingId:e})=>{let r,a,{data:s}=N(e),{data:i}=(r=s.businessId,(0,p.useSuspenseQuery)({queryKey:["ai-agent-summary",r],queryFn:async()=>{let e=(0,h.doc)((0,n.collection)("ai_agent_summary").ref,r);return(0,h.getDoc)(e).then(e=>{let t=e.data();return e.exists()&&t?{...t,_id:e.id}:null})}})),{data:o}=(a=s.businessId,(0,p.useSuspenseQuery)({queryKey:["business-products",a],queryFn:async()=>{let e=(0,n.collection)("business").s(a,"products").ref;return(0,h.getDocs)(e).then(e=>e.docs.map(e=>({...e.data(),_id:e.id})))}}));return(0,t.jsx)(w.BusinessPageContent,{publicListing:s,businessProducts:o,aiAgentSummary:i,showDiscoverMore:!1,disableContainerPadding:!0,forceColumnLayout:!0,seeMorePostsHref:`/b/${s?.customId||s?._id}/blog`,isSkipMember:!1,withBusinessProfilePanel:!1,"data-sentry-element":"BusinessPageContent","data-sentry-component":"BusinessProfilePanelContent","data-sentry-source-file":"BusinessProfilePanel.tsx"})},A=({children:e,onClick:r,ariaLabel:a,className:n})=>
2(0,t.jsx)("button",{className:(0,c.cn)("size-6 rounded-md",n),onClick:r,"aria-label":a,"data-sentry-component":"BusinessPanelHeaderButton","data-sentry-source-file":"BusinessProfilePanel.tsx",children:e}),k=({publicListingId:e})=>{let{data:r}=N(e);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsx)("span",{className:"text-h6 font-semibold",children:r?.businessName}),(0,t.jsxs)("div",{className:"flex items-center gap-4",children:[(0,t.jsx)(A,{onClick:()=>{let e=r?.customId??r?._id;window.open(`${u.routes.PUBLIC_LISTING_BUSINESS}/${e}`,"_blank","noreferrer")},ariaLabel:"Open in new tab","data-sentry-element":"BusinessPanelHeaderButton","data-sentry-source-file":"BusinessProfilePanel.tsx",children:(0,t.jsx)(f.SquareArrowUpRightIcon,{className:"size-6 text-primary-500","data-sentry-element":"SquareArrowUpRightIcon","data-sentry-source-file":"BusinessProfilePanel.tsx"})}),(0,t.jsx)(A,{className:"stroke-gray-600",onClick:S,ariaLabel:"Close","data-sentry-element":"BusinessPanelHeaderButton","data-sentry-source-file":"BusinessProfilePanel.tsx",children:(0,t.jsx)(g.X,{className:"size-6",strokeWidth:1.5,"data-sentry-element":"X","data-sentry-source-file":"BusinessProfilePanel.tsx"})})]})]})},E=()=>{let e=(0,l.useIsTablet)(),n=(0,m.useQueryClient)(),c=(0,r.useStore)(j),u=!!c,p=e=>{e||S()};(0,d.usePageViewCounter)("business_page",c??"",{enabled:u});let h=(0,t.jsx)("div",{className:"flex min-h-[50vh] items-center justify-center",children:(0,t.jsx)(b.Loading,{size:"lg"})}),f=e=>{a.captureException(e,{extra:{component:"BusinessProfilePanel",publicListingId:c}}),(0,o.toast)({variant:"warning",title:"Oops! Something went wrong.",description:"We couldn't load this business profile. Please try again later"}),n.removeQueries({queryKey:["public-listing",c]});let t=n.getQueryData(["public-listing",c]),r=t?.businessId;r&&(n.removeQueries({queryKey:["ai-agent-summary",r]}),n.removeQueries({queryKey:["business-products",r]})),S()};return e?(0,t.jsx)(v.ErrorBoundary,{fallback:null,onError:f,resetKeys:[u,c],children:(0,t.jsx)(s.Root,{open:u,onOpenChange:p,children:(0,t.jsx)(s.DrawerContent,{className:"max-h-[90dvh] bg-white focus-visible:outline-none",children:c&&(0,t.jsxs)(x.Suspense,{fallback:h,children:[(0,t.jsx)(s.DrawerTitle,{className:"sr-only",children:"Business Profile"}),(0,t.jsx)("div",{className:"overflow-y-auto p-4",children:(0,t.jsx)(P,{publicListingId:c})})]})})})}):(0,t.jsx)(i.Sheet,{open:u,onOpenChange:p,"data-sentry-element":"Sheet","data-sentry-component":"BusinessProfilePanel","data-sentry-source-file":"BusinessProfilePanel.tsx",children:(0,t.jsx)(i.SheetContent,{side:"right",close:!1,className:"w-full max-w-[800px] overflow-y-auto bg-white p-6 focus-visible:outline-none","data-sentry-element":"SheetContent","data-sentry-source-file":"BusinessProfilePanel.tsx",children:c&&(0,t.jsx)(v.ErrorBoundary,{fallback:null,onError:f,resetKeys:[u,c],children:(0,t.jsxs)(x.Suspense,{fallback:h,children:[(0,t.jsx)(i.SheetTitle,{className:"flex items-center justify-between",children:(0,t.jsx)(k,{publicListingId:c})}),(0,t.jsx)(P,{publicListingId:c})]})})})})}},356698,195232,874953,e=>{"use strict";var t=e.i(391398);e.i(365480);var r=e.i(62135),a=e.i(823912);e.s(["BusinessTagLabel",0,({as:e,featuredBusiness:n,className:s,fallback:i="Other"})=>{let o=(0,a.getBusinessTags)(n),l=o?.secondaryTags.length>0?r.BUSINESS_TAG_LABELS[o.secondaryTags[0]]:o?.primaryTag?r.BUSINESS_TAG_LABELS[o.primaryTag]:i;return(0,t.jsx)(e||"span",{className:s,"data-sentry-element":"Component","data-sentry-component":"BusinessTagLabel","data-sentry-source-file":"BusinessTagLabel.tsx",children:l})}],356698);var n=e.i(304378),s=e.i(598019),i=e.i(469311),o=e.i(586427);e.i(753051);var l=e.i(593537),c=e.i(434606);e.s(["GrantBadge",0,function({onClick:e,isGrantWinner:r,amount:a,grantName:d,awardType:u}){return r?"number"==typeof a&&d?(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)(o.Tooltip,{content:"cash"===u?"Cash":"Credits",children:(0,t.jsx)("span",{children:(0,t.jsx)(n.Badge,{variant:"filled",size:"sm",color:"cash"===u?"teal":"primary",className:(0,l.cn)({"cursor-pointer":!!e}),onClick:e,children:(0,s.formatCurrency)(a,{decimals:!1})})})}),(0,t.jsx)("span",{className:"text-sm text-gray-500",children:d})]}):(0,t.jsx)(o.Tooltip,{content:"Skip Grant Winner","data-sentry-element":"Tooltip","data-sentry-component":"GrantBadge","data-sentry-source-file":"GrantBadge.tsx",children:(0,t.jsx)(i.Button,{variant:"unstyled",size:"none",onClick:e,"aria-label":"Skip Grant Winner",className:"flex h-8 w-8 items-center justify-center bg-transparent p-0 hover:bg-transparent","data-sentry-element":"Button","data-sentry-source-file":"GrantBadge.tsx",children:(0,t.jsx)(c.SkipIcon,{name:"medal",className:"h-[18px] w-[18px] text-warning-500","data-sentry-element":"SkipIcon","data-sentry-source-file":"GrantBadge.tsx"})})}):null}],195232);var d=e.i(605628),u=e.i(847626),m=e.i(881890),p=e.i(607649),h=e.i(956279),f=e.i(853062);e.s(["ShareBusinessModal",0,e=>{let{shareLink:r,emailBody:a,emailSubject:n}=(({featuredBusiness:e})=>{let t=e.customId||e._id,r=`${f.routes.PUBLIC_LISTING_BUSINESS}/${t}`,a=`${window.location.origin}${r}
2`,n=`Check out this business I found on Skip â ${e.businessName} ${a}`;return{shareLink:a,emailSubject:"Check out this business on Skip",emailBody:n}})(e),s=(0,d.useStore)(u.$isEmbedded);return(0,t.jsxs)("div",{className:"w-full space-y-5 px-5 pb-10 pt-5","data-sentry-component":"ShareBusinessModal","data-sentry-source-file":"ShareBusinessModal.tsx",children:[(0,t.jsxs)("div",{className:"flex flex-col items-center justify-center space-y-2 text-center",children:[(0,t.jsx)(h.Skip3dIcon,{illustration:"croofBlueYellow",iconContainer:"blue",iconName:"gift2",width:90,height:84.5,"data-sentry-element":"Skip3dIcon","data-sentry-source-file":"ShareBusinessModal.tsx"}),(0,t.jsx)("h2",{className:"text-lg font-semibold leading-7",children:"Share This Business!"}),(0,t.jsx)("p",{className:"text-sm leading-6 text-gray-600",children:"Want to pay it forward and share this Business with a friend or colleague?"})]}),(0,t.jsx)("hr",{}),(0,t.jsxs)("div",{className:"flex w-full flex-col space-y-4",children:[(0,t.jsx)("p",{className:(0,l.cn)("text-md font-medium leading-relaxed",{hidden:s}),children:"Share via"}),(0,t.jsx)("div",{className:"w-full rounded-md",children:r&&(0,t.jsxs)("div",{className:"flex w-full items-center justify-between",children:[!s&&(0,t.jsx)(p.ShareOnSocialMedia,{subject:n,shareLink:r,customLinkParams:{email:a}}),(0,t.jsx)(m.CopyLinkButton,{shareLink:r,_buttonProps:s?{width:"full"}:void 0,...e})]})})]})]})}],874953)},112161,e=>{"use strict";e.s(["ChatAgentEmbed",()=>g]);var t=e.i(391398),r=e.i(605628),a=e.i(275885),n=e.i(613572),s=e.i(567573);e.i(753051);var i=e.i(593537),o=e.i(123436),l=e.i(178644),c=e.i(556762),d=e.i(375985);e.i(581516);var u=e.i(359385),m=e.i(420094),p=e.i(198311),h=e.i(126019),f=e.i(191788);let g=({businessId:e,featuredBusiness:g,isInSheet:y=!1,className:x})=>{let v=(0,f.useRef)(null),b=(0,r.useStore)(l.$aiChatMessages),[w,j]=(0,f.useState)(!1);return((0,f.useEffect)(()=>{try{(0,o.startNewConversation)()}catch{}let t=!1,r=async()=>{if(e)try{var r;let a=await (0,u.getDoc)((0,u.doc)(n.firestore,`custom_agent/${e}`));if(t)return;let i=a.data();if(i?.disabled===!0){j(!0),(0,s.toast)({title:"This agent is temporarily disabled.",description:"Please try again later",variant:"warning"});return}let o=i?.greeting??((r=g?.businessName)?`Hi there! Welcome to ${r}, what can we help you with today?`:"Hi there! How can we help you today?");l.$agentBusinessId.set(e);let c=o?[{role:"assistant",content:o,timestamp:new Date}]:[];l.$localMessages.set(c)}catch(e){if(t)return;d.isDevEnv&&console.error(e),a.captureException(e),(0,s.toast)({title:"Failed to load custom agent",description:"Please try again later"})}},i=setTimeout(()=>{r()},300);return()=>{t=!0,clearTimeout(i),l.$agentEmbeddedUrl.set(null),l.$agentBusinessId.set(null),l.$localMessages.set([])}},[e]),w)?(0,t.jsx)("div",{className:"flex w-full items-center justify-center bg-white lg:h-[90dvh]",children:(0,t.jsx)("h2",{children:"This agent is temporarily disabled."})}):(0,t.jsx)(p.motion.div,{className:(0,i.cn)("relative flex w-full bg-white lg:h-[95dvh]",{"overflow-y-auto max-lg:h-svh":y},x),ref:v,initial:{opacity:0}
2,animate:{opacity:+(b.length>0)},transition:{duration:.5,ease:"easeInOut"},"data-sentry-element":"motion.div","data-sentry-component":"ChatAgentEmbed","data-sentry-source-file":"ChatAgentEmbed.tsx",children:(0,t.jsx)("div",{className:"flex flex-1 flex-col max-lg:h-max",children:(0,t.jsx)("div",{className:"flex flex-1 max-lg:flex-col",children:(0,t.jsx)(m.LayoutGroup,{"data-sentry-element":"LayoutGroup","data-sentry-source-file":"ChatAgentEmbed.tsx",children:(0,t.jsx)(c.ChatPanel,{poweredBySkip:!0,hideMessageActions:!0,pageRef:v,debugWidgetClassName:"absolute right-4 top-16",headerComponent:g?(0,t.jsx)("div",{className:"py-3 lg:py-4",children:(0,t.jsxs)("div",{className:"flex items-center gap-3",children:[(0,t.jsx)("div",{className:"relative flex h-12 w-12 items-center justify-center overflow-hidden rounded-xl border border-gray-100",children:(0,t.jsx)(h.default,{src:g.pictureUrl,alt:g.businessName,width:40,height:40,objectFit:"contain",className:"h-10 w-10 rounded-[10px] object-contain"})}),(0,t.jsx)("div",{className:"flex flex-col",children:(0,t.jsx)("h2",{className:"text-h7 font-semibold text-gray-950",children:g.businessName})})]})}):void 0,"data-sentry-element":"ChatPanel","data-sentry-source-file":"ChatAgentEmbed.tsx"})})})})})}},556762,210171,9898,137175,e=>{"use strict";e.s(["ChatPanel",()=>ez],556762);var t=e.i(391398),r=e.i(605628),a=e.i(812500);e.i(753051);var n=e.i(593537),s=e.i(123436),i=e.i(270043),o=e.i(178644),l=e.i(197081),c=e.i(654382),d=e.i(47857),u=e.i(325196);e.s(["AIMessageBubble",()=>Z],210171);var m=e.i(67681),p=e.i(574264),h=e.i(498817),f=e.i(198311),g=e.i(126019),y=e.i(191788),x=e.i(85506),v=e.i(461030),b=e.i(135242),w=e.i(957097),j=e.i(211314),C=e.i(747732),S=e.i(180471),N=e.i(214495),P=e.i(203916),A=e.i(222289),k=e.i(657537),E=e.i(464500);e.i(115266);var I=e.i(214115),B=e.i(95495),O=e.i(789347),M=e.i(871292);let D=({pins:e=[],center:r=[-98.5795,39.8283],zoom:a=4,title:n="Map View"})=>{let s=(0,y.useRef)(null),[i,o]=(0,y.useState)(null),l=(0,y.useMemo)(()=>Array.isArray(e)?e:[],[e]);return(0,y.useEffect)(()=>{if(!s.current||0===l.length)return;let e=setTimeout(()=>{if(s.current)if(1===l.length)s.current.flyTo({center:[l[0].longitude,l[0].latitude],zoom:12,duration:1e3});else{let e=l.map(e=>e.longitude),t=l.map(e=>e.latitude),r=Math.min(...e),a=Math.max(...e),n=Math.min(...t),i=Math.max(...t);s.current.fitBounds([[r,n],[a,i]],{padding:{top:50,bottom:50,left:50,right:50},duration:1500})}},100);return()=>clearTimeout(e)},[l]),(0,t.jsxs)("div",{className:"overflow-hidden rounded-lg border border-gray-200 bg-white shadow-sm","data-sentry-component":"MapboxView","data-sentry-source-file":"MapboxView.tsx",children:[(0,t.jsxs)("div",{className:"border-b border-gray-200 p-4",children:[(0,t.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:n}),l.length>0&&(0,t.jsxs)("p",{className:"text-sm text-gray-600",children:[l.length," location",1===l.length?"":"s"," shown"]})]}),(0,t.jsx)("div",{className:"relative h-96 w-full",children:(0,t.jsxs)(I.default,{ref:s,initialViewState:{longitude:r[0],latitude:r[1],zoom:a},style:{width:"100%",height:"100%"},mapStyle:"mapbox://styles/mapbox/streets-v12",mapboxAccessToken:"pk.eyJ1IjoicHNraXAiLCJhIjoiY21lbG1meHZ4MGh6djJsb2NvMmg3dTlndSJ9.TP1sTD7rqG6TA_hLoFsYZA",attributionControl:!1,"data-sentry-element":"Map","data-sentry-source-file":"MapboxView.tsx",children:[(0,t.jsx)(O.NavigationControl,{position:"top-right","data-sentry-element":"NavigationControl","data-sentry-source-file":"MapboxView.tsx"}),l.map(e=>(0,t.jsx)(B.Marker,{longitude:e.longitude,latitude:e.latitude,onClick:t=>{t.originalEvent.stopPropagation(),o(e)},children:(0,t.jsx)("div",{className:"relative",children:(0,t.jsx)(E.HugeIcon,{name:"Location01Icon",className:"h-10 w-10 cursor-pointer drop-shadow-[0_2px_4px_rgba(0,0,0,0.5)] filter",fillColor:e.color||"#ff0000",color:"#ffffff",strokeWidth:2})})},e.id)),i&&(0,t.jsx)(M.Popup,{longitude:i.longitude,latitude:i.latitude,anchor:"bottom",onClose:()=>o(null),closeButton:!0,closeOnClick:!1,children:(0,t.jsxs)("div",{className:"max-w-xs p-2",children:[(0,t.jsx)("h4",{className:"text-sm font-semibold",children:i.title}),i.description&&(0,t.jsx)("p",{className:"mt-1 text-xs text-gray-600",children:i.description}),i.address&&(0,t.jsx)("p",{className:"mt-1 text-xs text-gray-500",children:i.address})]})})]})})]})};var L=e.i(493525),T=e.i(613572),R=e.i(469311),_=e.i(272225),z=e.i(324247),F=e.i(470867);e.i(581516);var U=e.i(359385),$=e.i(741461);let K=({businessPlanId:e})=>{let[r,a]=(0,y.useState)(!0),[n,s]=(0,y.useState)(null),[i,o]=(0,y.useState)(null);return e&&"string"==typeof e?((0,y.useEffect)(()=>
2{if(!L.auth?.currentUser)return void a(!1);let t=L.auth.currentUser.uid,r=(0,U.onSnapshot)((0,U.query)((0,T.getCollection)("user_documents"),(0,U.where)("userId","==",t),(0,U.where)("businessPlanId","==",e),(0,U.where)("category","==","BUSINESS_PLAN")),async e=>{try{if(e.empty){s(null),o(null),a(!0);return}let t=e.docs.map(e=>({...e.data(),id:e.id})).sort((e,t)=>{let r=new Date(e.createdAt);return new Date(t.createdAt).getTime()-r.getTime()})[0];s(t);try{let e=await (0,z.getFileUrl)(t);o(e||null)}catch(e){console.error("PDFPreview: Error getting file URL:",e),o(null)}a(!1)}catch(e){console.error("PDFPreview: Error processing document snapshot:",e),a(!1)}},e=>{console.error("PDFPreview: Snapshot error:",e),a(!1)});return()=>r()},[e]),r||!n)?(0,t.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-gray-200 bg-gray-50 p-3",children:[(0,t.jsx)(_.Skeleton,{className:"h-8 w-8 rounded"}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)(_.Skeleton,{className:"mb-1 h-4 w-32"}),(0,t.jsx)(_.Skeleton,{className:"h-3 w-24"})]}),(0,t.jsx)(_.Skeleton,{className:"h-8 w-16 rounded"})]}):(0,t.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-gray-200 bg-white p-3 shadow-sm","data-sentry-component":"PDFPreview","data-sentry-source-file":"PDFPreview.tsx",children:[(0,t.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded bg-blue-50",children:(0,t.jsx)($.DocumentCodeIcon,{className:"h-5 w-5 text-blue-600","data-sentry-element":"DocumentCodeIcon","data-sentry-source-file":"PDFPreview.tsx"})}),(0,t.jsxs)("div",{className:"flex-1",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-gray-900",children:n.displayName||n.name||"Business Plan"}),(0,t.jsx)("p",{className:"text-xs text-gray-500",children:"PDF ⢠Ready for preview"})]}),(0,t.jsx)(R.Button,{size:"sm",variant:"secondary",onClick:()=>{i&&(0,F.openModalSync)({id:"pdf-preview-modal",content:(0,t.jsxs)("div",{className:"w-[95vw] max-w-4xl p-6",children:[(0,t.jsx)("div",{className:"mb-4 flex items-center justify-between",children:(0,t.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:n?.displayName||n?.name||"Business Plan"})}),(0,t.jsx)("div",{className:"rounded-lg border border-gray-200 bg-white",children:(0,t.jsx)("iframe",{src:i,className:"h-[80vh] w-full rounded-lg",title:"PDF Preview"})})]}),options:{fullscreen:!0}})},disabled:!i,className:"text-sm","data-sentry-element":"Button","data-sentry-source-file":"PDFPreview.tsx",children:i?"Preview":"Loading..."})]}):(console.warn("PDFPreview: businessPlanId is required and must be a string"),null)},H=({components:e,onQuickAction:r,isLastAiMessage:a=!1})=>{if(!e||0===e.length)return null;let n=[],s=[],i=[];e.forEach(e=>{["opportunityCard","publicListing"].includes(e.type)?i.push(e):["quickActions","url","dataEntry"].includes(e.type)?n.push(e):(e.type,s.push(e))});let o=(e,n)=>{try{switch(e.type){case"quickActions":{let a=e.params.items,s=e.params.upsellType;if(!Array.isArray(a))return console.error("quickActions: items must be an array"),null;if(void 0!==s&&!Array.isArray(s))return console.error("quickActions: upsellType must be an array"),null;return(0,t.jsx)(N.ChatQuickActions,{items:a,upsellType:s,onActionClick:r},n)}case"url":{let{value:r,label:a}=e.params;if(!r||!a)return console.error("url: requires both value and label parameters"),null;return(0,t.jsx)(P.ChatUrlButton,{value:r,label:a},n)}case"dataEntry":{let{flow:r,label:a}=e.params;if(!r||!a)return console.error("dataEntry: requires both flow and label parameters"),null;return(0,t.jsx)(w.ChatDataEntry,{flow:r,label:a},n)}case"emailCapture":{let{label:r,placeholder:a,submitLabel:s}=e.params;return(0,t.jsx)(j.ChatEmailCapture,{label:r,placeholder:a,submitLabel:s},n)}case"documentPreview":{let{documentId:r}=e.params;if(!r)return null;return(0,t.jsx)(v.CofounderDocumentPreview,{documentId:r})}case"pdfPreview":{let{value:r}=e.params;if(!r)return console.error("pdfPreview: requires value parameter (businessPlanId)"),null;return(0,t.jsx)(K,{businessPlanId:r},n)}case"opportunityCard":{let{fundingId:r}=e.params;if(!r)return console.error("opportunityCard: requires fundingId parameter"),null;return(0,t.jsx)(C.ChatOpportunityCard,{fundingId:r})}case"imageSelection":{let{section:r,keywords:a,images:s}=e.params;if(!r)return console.error("imageSelection: requires section parameter"),null;return(0,t.jsx)(k.ImageSelection,{section:r,keywords:a,images:s},n)}case"mapboxView":{let{pins:r,center:a,zoom:s,title:i}=e.params;return(0,t.jsx)(D,{pins:r,center:a,zoom:s,title:i},n)}case"publicListing":{let{id:r}=e.params;if(!r)return console.error("publicListing: requires id parameter"),null;return(0,t.jsx)(S.ChatPublicListingCard,{id:r})}case"handoffPrompt":{if(!a)return null;let{value:r}=e.params;if(!r)return console.error("handoffPrompt: requires value parameter"),null;return(0,t.jsx)(A.HandoffPrompt,{value:r},n)}case"chart":{let{config:r}=e.params;if(!r)return console.error("chart: requires config parameter"),null;try{let e="string"==typeof r?JSON.parse(r):r;if(!e.data||!Array.isArray(e.data)||0===e.data.length)return console.error("chart: requires valid data array"),null;return(0,t.jsx)(b.ChatChart,{config:e},n)}catch(e){return console.error("chart: Failed to parse config:",e),null}}default:return null}}catch(t){return console.error("Error rendering component:",t,e),null}};return(0,t.jsxs)("div",{className:"mt-6","data-sentry-component":"ChatComponentRenderer","data-sentry-source-file":"ChatComponentRenderer.tsx",children:[s.length>0&&(0,t.jsx)("div",{className:"space-y-6",children:s.map(o)}),i.length>0&&(0,t.jsx)("div",{className:"mt-6 flex flex-wrap gap-4",children:i.map(o)}),n.length>0&&(0,t.jsx)("div",{className:"mt-6 space-y-4",children:n.map(o)})]})};e.i(365480);var W=e.i(709864),V=e.i(586427);let G=({messageId:e,content:r,feedbackEvaluation:a})=>{let[s,i]=(0,y.useState)(!1),[l,c]=(0,y.useState)(a),d=(0,y.useCallback)(async()=>{try{await navigator.clipboard.writeText(r),i(!0),setTimeout(()=>i(!1),2e3)}catch(e){console.error("Failed to copy message:",e)}},[r]),u=(0,y.useCallback)(async t=>{let r=L.auth.currentUser?.uid;if(!r||!e)return;let a=l===t?null:t;c(a??void 0),await o.currentAiChatActions.saveAiFeedback({messageId:e,userId:r,feedbackEvaluation:a})},[e,l]),m=l===W.UserFeedbackEvaluation.Positive,p=l===W.UserFeedbackEvaluation.Negative;return(0,t.jsxs)("div",{className:"mt-3 flex items-center gap-3","data-sentry-component":"MessageActions","data-sentry-source-file":"MessageActions.tsx",children:[(0,t.jsx)(V.Tooltip,{content:s?"Copied!":"Copy",side:"top","data-sentry-element":"Tooltip","data-sentry-source-file":"MessageActions.tsx",children:(0,t.jsx)("button",{onClick:d,className:"flex size-5 items-center justify-center text-gray-400 transition-colors hover:text-gray-600","aria-label":s?"Copied":"Copy message",children:(0,t.jsx)(E.HugeIcon,{name:s?"Tick02Icon":"Copy01Icon",className:"size-5","data-sentry-element":"HugeIcon","data-sentry-source-file":"MessageActions.tsx"})})}),(0,t.jsx)(V.Tooltip,{content:"Good response",side:"top","data-sentry-element":"Tooltip","data-sentry-source-file":"MessageActions.tsx",children:(0,t.jsx)("button",{onClick:()=>u(W.UserFeedbackEvaluation.Positive),className:(0,n.cn)("flex size-5 items-center justify-center transition-colors",m?"text-green-600":"text-gray-400 hover:text-gray-600"),"aria-label":"Thumbs up",children:(0,t.jsx)(E.HugeIcon,{name:"ThumbsUpIcon",className:"size-5",fillColor:m?"currentColor":"transparent","data-sentry-element":"HugeIcon","data-sentry-source-file":"MessageActions.tsx"})})}),(0,t.jsx)(V.Tooltip,{content:"Bad response",side:"top","data-sentry-element":"Tooltip","data-sentry-source-file":"MessageActions.tsx",children:(0,t.jsx)("button",{onClick:()=>u(W.UserFeedbackEvaluation.Negative),className:(0,n.cn)("flex size-5 items-center justify-center transition-colors",p?"text-red-500":"text-gray-400 hover:text-gray-600"),"aria-label":"Thumbs down",children:(0,t.jsx)(E.HugeIcon,{name:"ThumbsDownIcon",className:"size-5",fillColor:p?"currentColor":"transparent","data-sentry-element":"HugeIcon","data-sentry-source-file":"MessageActions.tsx"})})})]})},q={...x.markdownComponents},Y=()=>{let[e,r]=(0,y.useState)(0);return(0,y.useEffect)(()=>{let e=setInterval(()=>{r(e=>(e+1)%4)},500);return()=>clearInterval(e)},[]),(0,t.jsx)(f.motion.div,{className:"flex items-center",initial:{opacity:0}
2,animate:{opacity:1},transition:{duration:.3},"data-sentry-element":"motion.div","data-sentry-component":"EllipsisLoader","data-sentry-source-file":"AiMessageBubble.tsx",children:(0,t.jsxs)("span",{className:"font-inter font-medium text-gray-900",style:{fontSize:"16px"},children:["Reviewing details.",".".repeat(e)]})})};function Z({message:e,messageId:a,feedbackEvaluation:n,loading:s,children:i,hideMessageActions:l=!1}){let c=(0,y.useRef)(null);(0,y.useEffect)(()=>{c.current?.setAttribute("data-message-role","assistant")},[]);let[d,u]=(0,y.useState)(!1),v=(0,r.useStore)(m.$aiChatComponentParserDebug);(0,y.useEffect)(()=>{if(s){let e=setTimeout(()=>{u(!0)},5e3);return()=>clearTimeout(e)}u(!1)},[s]);let{content:b,components:w}=(0,y.useMemo)(()=>(0,p.parseMessageContent)(e||"",!v),[e,v]),j=b?b.replace(/(?:^|\n|[-*]\s|\d+\.\s)([^:\n]+?):(\s)/g,(e,t,r)=>`${e.replace(t+":",`**${t}:**`)}${r}`):"";return s||b||0!==w.length||i?(0,t.jsx)("div",{ref:c,className:"mt-10 flex w-full","data-sentry-component":"AIMessageBubble","data-sentry-source-file":"AiMessageBubble.tsx",children:(0,t.jsxs)("div",{className:"flex-1 space-y-6 max-sm:max-w-[90%]",children:[s&&!b&&(0,t.jsxs)("div",{className:"flex items-center",children:[!d&&(0,t.jsx)(g.default,{src:"/images/animations/ai-loading.webp",width:50,height:20,alt:"loading",className:"h-4 w-auto sm:h-5"}),(0,t.jsx)(h.AnimatePresence,{children:d&&(0,t.jsx)(Y,{})})]}),b&&(0,t.jsxs)(f.motion.div,{className:"break-words leading-6 text-gray-900 sm:leading-7",style:{fontSize:"16px"},initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{duration:.2},children:[(0,t.jsx)(x.Markdown,{components:q,children:j}),s&&(0,t.jsx)("div",{className:"mt-2 flex items-center gap-2",children:(0,t.jsx)(g.default,{src:"/images/animations/ai-loading.webp",width:30,height:12,alt:"typing",className:"h-3 w-auto sm:h-3"})})]}),!s&&w.length>0&&(0,t.jsx)(H,{components:w,onQuickAction:e=>{e&&e.trim()?o.currentAiChatActions.sendMessage(e.trim()):console.warn("AiMessageBubble: Attempted to send empty action:",e)}}),i,!s&&b&&!l&&(0,t.jsx)(G,{messageId:a,content:b,feedbackEvaluation:n})]})}):(0,t.jsx)(t.Fragment,{})}var X=e.i(12776);let Q=()=>{let e=(0,r.useStore)(o.$aiChatMessages),a=(0,y.useMemo)(()=>{if(!e?.length)return null;for(let t=e.length-1;t>=0;t--){let r=e[t];if(r?.role==="assistant"&&r.content){let{components:e}=(0,p.parseMessageContent)(r.content),t=e.find(e=>"progress"===e.type);if(t)return{current:Number(t.params.current)||0,total:Number(t.params.total)||10,label:t.params.label||""};break}}return null},[e]);if(!a)return null;let n=Math.min(Math.max(a.current/a.total*100,0),100);return(0,t.jsx)("div",{className:"mb-3 w-full sm:mb-4","data-sentry-component":"ChatProgress","data-sentry-source-file":"ChatProgress.tsx",children:(0,t.jsxs)("div",{className:"mx-auto w-full max-w-4xl px-2",children:[(0,t.jsxs)("div",{className:"mb-2 flex items-center justify-between sm:mb-3",children:[(0,t.jsx)("span",{className:"font-inter text-xs font-medium text-gray-950 sm:text-sm",children:a.label||"Progress"}),(0,t.jsxs)("span",{className:"font-inter text-xs text-gray-700",children:[Math.round(n),"%"]})]}),(0,t.jsx)(X.Progress,{value:n,className:"h-1.5 w-full bg-gray-200 sm:h-2",indicatorClassName:"bg-[linear-gradient(270deg,#47C2FF_0%,#7D52F4_45.19%,_#FB4BA3_100%)]","data-sentry-element":"Progress","data-sentry-source-file":"ChatProgress.tsx"})]})})};e.i(272989);var J=e.i(880095),ee=e.i(304378),et=e.i(58197),er=e.i(323554),ea=e.i(717831),en=e.i(434606),es=e.i(720409),ei=e.i(853062),eo=e.i(63785),el=e.i(434843),ec=e.i(931358);let ed=(0,ec.default)("MapsSearchIcon",[["path",{d:"M22 12.0889V9.23578C22 7.29177 22 6.31978 21.4142 5.71584C20.8284 5.11192 19.8856 5.11192 18 5.11192H15.9214C15.004 5.11192 14.9964 5.11013 14.1715 4.69638L10.8399 3.0254C9.44884 2.32773 8.75332 1.97889 8.01238 2.00314C7.27143 2.02738 6.59877 2.42098 5.25345 3.20819L4.02558 3.92667C3.03739 4.5049 2.54329 4.79402 2.27164 5.27499C2 5.75596 2 6.34169 2 7.51313V15.7487C2 17.2879 2 18.0575 2.34226 18.4859C2.57001 18.7708 2.88916 18.9625 3.242 19.026C3.77226 19.1214 4.42148 18.7416 5.71987 17.9817C6.60156 17.4659 7.45011 16.9301 8.50487 17.0754C9.38869 17.1971 10.21 17.756 11 18.1522",stroke:"currentColor",key:"k0"}],["path",{d:"M8 2.00195V17.0359",stroke:"currentColor",key:"k1"}],["path",{d:"M15 5.00879V11.0224",stroke:"currentColor",key:"k2"}],["path",{d:"M20.1069 20.1754L21.9521 21.9984M21.1691 17.6381C21.1691 19.6048 19.5752 21.1991 17.609 21.1991C1
25.6428 21.1991 14.0488 19.6048 14.0488 17.6381C14.0488 15.6714 15.6428 14.0771 17.609 14.0771C19.5752 14.0771 21.1691 15.6714 21.1691 17.6381Z",stroke:"currentColor",key:"k3"}]]),eu=(0,ec.default)("MoneyBag02Icon",[["path",{d:"M20.9427 16.8354C20.2864 12.8866 18.2432 9.94613 16.467 8.219C15.9501 7.71642 15.6917 7.46513 15.1208 7.23257C14.5499 7 14.0592 7 13.0778 7H10.9222C9.94081 7 9.4501 7 8.87922 7.23257C8.30834 7.46513 8.04991 7.71642 7.53304 8.219C5.75682 9.94613 3.71361 12.8866 3.05727 16.8354C2.56893 19.7734 5.27927 22 8.30832 22H15.6917C18.7207 22 21.4311 19.7734 20.9427 16.8354Z",stroke:"currentColor",key:"k0"}],["path",{d:"M7.25662 4.44287C7.05031 4.14258 6.75128 3.73499 7.36899 3.64205C8.00392 3.54651 8.66321 3.98114 9.30855 3.97221C9.89237 3.96413 10.1898 3.70519 10.5089 3.33548C10.8449 2.94617 11.3652 2 12 2C12.6348 2 13.1551 2.94617 13.4911 3.33548C13.8102 3.70519 14.1076 3.96413 14.6914 3.97221C15.3368 3.98114 15.9961 3.54651 16.631 3.64205C17.2487 3.73499 16.9497 4.14258 16.7434 4.44287L15.8105 5.80064C15.4115 6.38146 15.212 6.67187 14.7944 6.83594C14.3769 7 13.8373 7 12.7582 7H11.2418C10.1627 7 9.6231 7 9.20556 6.83594C8.78802 6.67187 8.5885 6.38146 8.18945 5.80064L7.25662 4.44287Z",stroke:"currentColor",key:"k1"}],["path",{d:"M13.6267 12.9186C13.4105 12.1205 12.3101 11.4003 10.9892 11.9391C9.66829 12.4778 9.45847 14.2113 11.4565 14.3955C12.3595 14.4787 12.9483 14.2989 13.4873 14.8076C14.0264 15.3162 14.1265 16.7308 12.7485 17.112C11.3705 17.4932 10.006 16.8976 9.85742 16.0517M11.8417 10.9927V11.7531M11.8417 17.2293V17.9927",stroke:"currentColor",key:"k2"}]]);e.s(["MoneyBag02Icon",0,eu],9898);var em=e.i(411995),ep=e.i(883690),eh=e.i(919086),ef=e.i(538986),eg=e.i(41158);let ey=[{href:ei.routes.IMAGINE,leftIcon:(0,t.jsx)(eo.Image01Icon,{className:"mr-1.5 size-3 md:size-5"}),content:"Create Images"},{href:ei.routes.BUSINESS_PLAN_LANDING,leftIcon:(0,t.jsx)(ep.PresentationBarChart02Icon,{className:"mr-1.5 size-3 md:size-5"}),content:"Create Business Plan"},{href:ei.routes.WEBSITE_BUILDER_EDITOR,leftIcon:(0,t.jsx)(el.InternetIcon,{className:"mr-1.5 size-3 md:size-5"}),content:"Create Website"},{href:`${ei.routes.TEAMMATES}?modal=create-post`,leftIcon:(0,t.jsx)(eh.Profile02Icon,{className:"mr-1.5 size-3 md:size-5"}),content:"Create Post"},{href:ei.routes.DASHBOARD_PAYMENTS_PRODUCTS,leftIcon:(0,t.jsx)(em.PackageAddIcon,{className:"mr-1.5 size-3 md:size-5"}),content:"Add Products"},{href:ei.routes.DASHBOARD_BUSINESS_PAGE,leftIcon:(0,t.jsx)(en.SkipIcon,{name:"storeEdit",className:"mr-1.5 size-3 md:size-5"}),content:"Edit Business"},{href:ei.routes.DASHBOARD,leftIcon:(0,t.jsx)(eu,{className:"mr-1.5 size-3 md:size-5"}),content:"Apply to Grants"},{href:ei.routes.DISCOVER,leftIcon:(0,t.jsx)(ed,{className:"mr-1.5 size-3 md:size-5"}),content:"Explore Businesses"}],ex=({input:e,onBadgeClick:a,onAvatarClick:n})=>{let s=(0,r.useStore)(et.$businessPublicListing);return(0,t.jsxs)(t.Fragment,{children:[(0,t.jsxs)("div",{className:"flex h-full w-full flex-col items-center justify-between px-4 py-0 md:py-8",children:[(0,t.jsx)("div",{className:"mb-6 flex items-baseline justify-center gap-2",children:(0,t.jsx)("h2",{className:"text-center font-inter text-sm font-normal text-gray-500",children:"Cofounder v2.1"})}),(0,t.jsxs)("div",{className:"flex w-full max-w-[720px] flex-col items-center justify-center",children:[(0,t.jsx)("div",{className:"mb-6 flex items-baseline justify-center gap-2",children:(0,t.jsx)(V.Tooltip,{content:"Open Business Page",hideArrow:!0,disabled:s.isLoading||!s.value,"data-sentry-element":"Tooltip","data-sentry-source-file":"CofounderLanding.tsx",children:(0,t.jsx)(R.Button,{variant:"secondary",icon:!0,disabled:s.isLoading||!s.value,size:"3xl",className:"max-h-[4.5rem] max-w-[4.5rem] overflow-hidden border-gray-100 shadow-sm hover:border-gray-200 hover:bg-gray-50 disabled:border-gray-100 disabled:bg-white",onClick:()=>{if(s.value){if(n)return void n();(0,er.openBusinessPanel)(s.value._id)}},"data-sentry-element":"Button","data-sentry-source-file":"CofounderLanding.tsx",children:(0,t.jsx)(ea.ImageErrorBoundary,{src:s.value?.pictureUrl,fallback:(0,t.jsx)(ef.
2Store04Icon,{className:"text-gray-950"}),"data-sentry-element":"ImageErrorBoundary","data-sentry-source-file":"CofounderLanding.tsx",children:(0,t.jsx)("img",{src:(0,es.mediaUrl)(s.value?.pictureUrl),alt:s.value?.businessName,width:256,height:256,className:"aspect-square size-[4.5rem] max-h-[4.5rem] max-w-[4.5rem] object-cover"})})})})}),(0,t.jsx)("h1",{className:"text-center font-inter-display text-h7 font-medium md:text-h4",children:"What's the next move for your business?"}),(0,t.jsx)("div",{className:"mt-4 w-full lg:mt-6",children:e}),(0,t.jsx)("div",{className:"mt-4 flex w-full flex-wrap justify-center gap-2 max-md:[&>*:nth-child(n+5)]:hidden",children:ey.map((e,r)=>{let n=()=>{(0,J.eventRaven)("cofounderPageClick",{action:"badgeClick",badge:e.content}),a?.(e.href,e.content)};return(0,t.jsx)(ee.Badge,{asChild:!0,color:"gray",size:"lg",className:"bg-white px-4 py-2 text-sm font-medium hover:border-gray-300 hover:bg-gray-100 hover:text-gray-900 md:px-4 md:py-3",children:a?(0,t.jsxs)("button",{type:"button",onClick:n,children:[e.leftIcon," ",e.content]}):(0,t.jsxs)(eg.default,{target:"_blank",rel:"noopener noreferrer",href:e.href,onClick:n,children:[e.leftIcon," ",e.content]})},r)})})]}),(0,t.jsx)("div",{className:"h-24"})]}),(0,t.jsx)(er.BusinessProfilePanel,{"data-sentry-element":"BusinessProfilePanel","data-sentry-source-file":"CofounderLanding.tsx"})]})};var ev=e.i(37857),eb=e.i(936934);let ew=({onClick:e})=>(0,t.jsx)("button",{onClick:e,className:"sticky bottom-0 left-1/2 flex h-10 w-10 -translate-x-1/2 cursor-pointer items-center justify-center rounded-full border border-gray-200 bg-white text-gray-600 transition-all hover:bg-gray-50 hover:text-gray-900 hover:shadow-xl",title:"Scroll to bottom","data-sentry-component":"ScrollToBottomButton","data-sentry-source-file":"ScrollToBottomButton.tsx",children:(0,t.jsx)(E.HugeIcon,{name:"ArrowDown01Icon",className:"h-4 w-4","data-sentry-element":"HugeIcon","data-sentry-source-file":"ScrollToBottomButton.tsx"})}),ej=({content:e,className:a})=>{let[s,i]=(0,y.useState)(!1);if((0,r.useStore)(m.$aiChatDebugTools))return(0,t.jsx)("div",{className:(0,n.cn)("mt-2 w-full",a),"data-sentry-component":"SystemMessageBubble","data-sentry-source-file":"SystemMessageBubble.tsx",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-blue-100",children:(0,t.jsx)("svg",{className:"h-4 w-4 text-blue-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","data-sentry-element":"svg","data-sentry-source-file":"SystemMessageBubble.tsx",children:(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M9 12l2 2 4-4m6 2a9 9 0 11-18 0 9 9 0 0118 0z","data-sentry-element":"path","data-sentry-source-file":"SystemMessageBubble.tsx"})})}),(0,t.jsx)("div",{className:"min-w-0 flex-1",children:(0,t.jsxs)("div",{className:"rounded-2xl border border-blue-200 bg-blue-50 px-3 py-2",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex items-center gap-2",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-blue-800",children:"System Handoff"}),(0,t.jsx)("span",{className:"inline-flex items-center rounded-full bg-blue-100 px-2 py-1 text-xs font-medium text-blue-800",children:"New Context"})]}),(0,t.jsxs)("button",{onClick:()=>i(!s),className:"ml-2 text-xs text-blue-500 transition-colors duration-200 ease-in-out hover:text-blue-700",children:[s?"Hide":"Show"," Details"]})]}),(0,t.jsx)("div",{className:(0,n.cn)("transition-all duration-300 ease-in-out",s?"mt-3 max-h-none opacity-100":"mt-0 max-h-0 overflow-hidden opacity-0"),children:(0,t.jsxs)("div",{className:"transform rounded-md border border-blue-200 bg-white p-3 transition-all duration-300 ease-in-out",children:[(0,t.jsx)("h4",{className:"mb-2 text-xs font-semibold text-blue-800",children:"Handoff Context:"}),(0,t.jsx)("pre",{className:"whitespace-pre-wrap text-xs text-blue-700",children:e})]})})]})})]})})},eC=({content:e,toolCallId:a,toolCall:s,className:i})=>{let o,l,c=(0,r.useStore)(m.$aiChatDebugTools),[d,u]=(0,y.useState)(!1);try{o=JSON.parse(e)}catch{o=e}if(s?.function?.arguments)try{l=JSON.parse(s.function.arguments)}catch{l=s.function.arguments}if(c)return(0,t.jsx)("div",{className:(0,n.cn)("mt-10 w-full",i),"data-sentry-component":"ToolMessageBubble","data-sentry-source-file":"ToolMessageBubble.tsx",children:(0,t.jsxs)("div",{className:"flex items-start gap-3",children:[(0,t.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded-full bg-gray-100",children:(0,t.jsxs)("svg",{className:"h-4 w-4 text-gray-600",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","data-sentry-element":"svg","data-sentry-source-file":"ToolMessageBubble.tsx",children:[(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M10.325 4.317c.426-1.756 2.924-1.756 3.35 0a1.724 1.724 0 002.573 1.066c1.543-.94 3.31.826 2.37 2.37a1.724 1.724 0 001.065 2.572c1.756.426 1.756 2.924 0 3.35a1.724 1.724 0 00-1.066 2.573c.94 1.543-.826 3.31-2.37 2.37a1.724 1.724 0 00-2.572 1.065c-.426 1.756-2.924 1.756-3.35 0a1.724 1.724 0 00-2.573-1.066c-1.543.94-3.31-.826-2.37-2.37a1.724 1.724 0 00-1.065-2.572c-1.756-.426-1.756-2.924 0-3.35a1.724 1.724 0 001.066-2.573c-.94-1.543.826-3.31 2.37-2.37.996.608 2.296.07 2.572-1.065z","data-sentry-element":"path","data-sentry-source-file":"ToolMessageBubble.tsx"}),(0,t.jsx)("path",{strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M15 12a3 3 0 11-6 0 3 3 0 016 0z","data-sentry-element":"path","data-sentry-source-file":"ToolMessageBubble.tsx"})]})}),(0,t.jsx)("div",{className:"min-w-0 flex-1",children:(0,t.jsxs)("div",{className:"rounded-2xl bg-gray-100 px-4 py-3",children:[(0,t.jsxs)("div",{className:"flex items-center justify-between",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-gray-700",children:"Tool Response"}),(0,t.jsxs)("button",{onClick:()=>u(!d),className:"ml-2 text-xs text-gray-500 transition-colors duration-200 ease-in-out hover:text-gray-700",children:[d?"Hide":"Show"," Details"]}
2)]}),(0,t.jsx)("div",{className:(0,n.cn)("transition-all duration-300 ease-in-out",d?"mt-3 max-h-none opacity-100":"mt-0 max-h-0 overflow-hidden opacity-0"),children:(0,t.jsxs)("div",{className:"space-y-2",children:[(0,t.jsxs)("div",{className:"text-xs text-gray-500",children:["Tool Call ID: ",a]}),s&&(0,t.jsx)("div",{className:"space-y-2",children:(0,t.jsxs)("div",{className:"transform rounded-md border border-blue-200 bg-blue-50 p-3 transition-all duration-300 ease-in-out",children:[(0,t.jsx)("h4",{className:"mb-2 text-xs font-semibold text-blue-800",children:"Function Called:"}),(0,t.jsx)("p",{className:"font-mono text-sm text-blue-900",children:s.function.name}),l&&(0,t.jsxs)("div",{className:"mt-2",children:[(0,t.jsx)("h5",{className:"mb-1 text-xs font-semibold text-blue-800",children:"Arguments:"}),(0,t.jsx)("pre",{className:"whitespace-pre-wrap text-xs text-blue-700",children:"string"==typeof l?l:JSON.stringify(l,null,2)})]})]})}),(0,t.jsxs)("div",{className:"transform rounded-md border border-gray-200 bg-white p-3 transition-all duration-300 ease-in-out",children:[(0,t.jsx)("h4",{className:"mb-2 text-xs font-semibold text-gray-800",children:"Function Response:"}),(0,t.jsx)("pre",{className:"whitespace-pre-wrap text-xs text-gray-700",children:"string"==typeof o?o:JSON.stringify(o,null,2)})]})]})})]})})]})})};var eS=e.i(725731);let eN=({message:e,attachments:a})=>{let n=((e,t)=>{if(!e)return"";if(!t)return e;let r=e.replace(/§\s*hidden:\s*\([^§]*\)\s*§/g,"").replace(/§\s*hidden:\s*[^§]*§/g,"").replace(/§\s*hidden:\s*\([^)]*$/g,"");return r.replace(/\s+/g," ").trim()})(e,!(0,r.useStore)(m.$aiChatComponentParserDebug));return(0,t.jsx)("div",{className:"group mt-10 flex w-full items-start justify-end gap-2 sm:gap-4","data-sentry-component":"UserMessageBubble","data-sentry-source-file":"UserMessageBubble.tsx",children:(0,t.jsxs)("div",{className:"xs:max-w-[85%] flex max-w-[90%] flex-col items-end sm:max-w-[70%]",children:[a&&a.length>0&&(0,t.jsx)("div",{className:"mb-3 flex flex-wrap justify-end gap-2",children:a.map((e,r)=>(0,t.jsx)(eS.PreviewAttachment,{attachment:e},`${e.name}-${r}`))}),n&&(0,t.jsx)("div",{className:"whitespace-pre-wrap break-words rounded-3xl bg-gray-100 px-5 py-2.5 leading-6 text-gray-950",children:n||"Empty message"})]})})};e.s(["UserMessageBubble",0,eN],137175);var eP=e.i(567573),eA=e.i(168541),ek=e.i(374801);let eE="cofounderDailyMsgCount",eI="cofounderSoftUpsellShownDate",eB=()=>{let e=new Date,t=e.getFullYear(),r=String(e.getMonth()+1).padStart(2,"0"),a=String(e.getDate()).padStart(2,"0");return`${t}-${r}-${a}`},eO=e=>{try{return window.localStorage.getItem(e)}catch{return null}},eM=(e,t)=>{try{window.localStorage.setItem(e,t)}catch{}};var eD=e.i(300428),eL=e.i(525695),eT=e.i(91956),eR=e.i(203828);function e_(){(0,c.openModal)({id:"SkipAiUpsellModal",options:eD.modalOptions.membershipModal,content:(0,t.jsx)(ek.MembershipModal,{variation:"skipAi",redirect:ei.routes.AI_CHAT})})}let ez=({headerComponent:e,poweredBySkip:c=!1,pageRef:m,hideMessageActions:h=!1,enableSoftUpsell:g=!1,emptyStateVariant:x="default",emptyStateInputContainerClassName:v,emptyStateTopRightAction:b,floatingChatMenu:w,debugWidgetClassName:j})=>{let[C,S]=(0,y.useState)(""),[N,P]=(0,y.useState)(!1),A=(0,r.useStore)(s.$isAiChatStreaming),k=(0,r.useStore)(s.$aiChatConversationId),{value:E}=(0,r.useStore)(i.$userChatHistory),I=(0,r.useStore)(o.$aiChatMessages),B=(0,r.useStore)(s.$loadingAiChat),O=(0,r.useStore)(o.$freeAiChatLimitReached),{isMember:M}=(0,r.useStore)(d.$userUtils),D=(0,a.useIsMobile)(),L=(0,eR.useRouter)();(()=>{let e=(0,r.useStore)(s.$isAiChatStreaming),{toast:t}=(0,eP.useToast)(),a=(0,y.useRef)(""),n=(0,y.useRef)(!1),i=(0,eA.useStoreSelector)(o.$aiChatMessages,(e=[])=>{let[t]=e.slice(-1);if(!t)return;let{components:r}=(0,p.parseMessageContent)(t.content??""),a=r.find(e=>"toast"===e.type);if(a)return{props:{title:a.params.message??"",variant:a.params.type??"success"},showOnce:"true"===a.params.showOnce}});(0,y.useEffect)(()=>{let r=i?.props.title??"";n.current&&!e&&r!==a.current&&(t({...i?.props,duration:5e3}),a.current=r),n.current=e,(e||!r)&&(a.current="")},[e,i,t])})();let T=(0,y.useRef)(null),R=(0,y.useRef)(0),_=(0,y.useRef)(!1);(0,eT.useMotionValue)(0);let z=(0,r.useStore)(o.$shouldShowUpsell),F=eL.trpc.useUtils(),U=(0,y.useCallback)(()=>
2{if(!T.current)return!0;if(D){let{scrollY:e}=window,{scrollHeight:t}=document.documentElement,{innerHeight:r}=window;if(e<0)return!1;let a=t-r;return e>a||10>Math.abs(a-e)}{let{scrollTop:e,scrollHeight:t,clientHeight:r}=T.current;return 10>Math.abs(t-r-e)}},[D]);(0,y.useEffect)(()=>{let e=()=>{if(D){if(window.scrollY<0)return void P(!1);P(!U())}else T.current&&P(!U())};return D?(e(),window.addEventListener("scroll",e,{passive:!0}),()=>window.removeEventListener("scroll",e)):void 0},[U,D]);let $=(0,y.useCallback)((e,t="smooth")=>{let r;if(r=navigator.userAgent.toLowerCase(),navigator.vendor.toLowerCase().includes("apple")&&r.includes("safari")&&!r.includes("chrome")&&!r.includes("chromium")&&!r.includes("crios")&&!r.includes("fxios")&&!r.includes("edg")&&D){try{if(e>=document.documentElement.scrollHeight-window.innerHeight-100){let e=document.createElement("div");e.style.position="absolute",e.style.top=`${document.documentElement.scrollHeight}px`,e.style.height="1px",e.style.width="1px",e.style.visibility="hidden",document.body.appendChild(e),e.scrollIntoView({behavior:t,block:"end"}),setTimeout(()=>{e.parentNode&&e.parentNode.removeChild(e)},500);return}}catch{console.log("ScrollIntoView fallback failed, using manual scroll")}let r=window.scrollY,a=e-r,n=400*("smooth"===t);if(0===n||10>Math.abs(a))return void window.scrollTo(0,e);let s=performance.now(),i=e=>{let t=Math.min((e-s)/n,1),o=1-Math.pow(1-t,3);window.scrollTo(0,r+a*o),t<1&&requestAnimationFrame(i)};requestAnimationFrame(i)}else m?.current?m.current.scrollTo({top:e,behavior:t}):window.scrollTo({top:e,behavior:t})},[D,m]),K=(0,y.useCallback)(e=>{requestAnimationFrame(()=>{D?"top"===e?$(0,"smooth"):$(document.documentElement.scrollHeight,"smooth"):T.current&&("top"===e?T.current.scrollTo({top:0,behavior:"smooth"}):T.current.scrollTo({top:T.current.scrollHeight,behavior:"smooth"}))})},[D,$]),H=(0,y.useCallback)(()=>K("bottom"),[K]),W=(0,y.useCallback)(()=>{requestAnimationFrame(()=>{let e=T.current?.querySelector('div[data-message-role="assistant"]:last-child');if(e&&T.current){let t=T.current,r=e.offsetTop-t.offsetTop-100;r<t.scrollTop&&t.scrollTo({top:Math.max(0,r),behavior:"smooth"})}})},[]),V=(0,y.useCallback)(()=>{setTimeout(()=>{(A||U())&&H()},10)},[U,H,A]);!function({onChunkReceived:e,onConversationChange:t,onMessageAdded:a}){let n=(0,r.useStore)(o.$aiChatMessages),i=(0,r.useStore)(s.$aiChatConversationId),l=(0,y.useMemo)(()=>n[n.length-1],[n]),c=(0,y.useRef)(l?._id),d=(0,y.useRef)(l?.content?.length||0),u=(0,y.useRef)(i);(0,y.useEffect)(()=>{l?.content?.length&&c.current===l?._id&&d.current<l.content.length&&e(),c.current=l?._id,d.current=l?.content?.length||0},[l,e]),(0,y.useEffect)(()=>{let e=u.current!==i,r=n.length&&u.current===i;e?(t(),u.current=i):r&&a(),e||(u.current=i)},[n.length,i,t,a])}({onChunkReceived:(0,y.useCallback)(()=>{A?requestAnimationFrame(()=>{D?U()&&W():T.current&&U()&&W()}):V()},[A,V,D,$,U,W]),onMessageAdded:(0,y.useCallback)(()=>{setTimeout(()=>{H()},100)},[H]),onConversationChange:(0,y.useCallback)(()=>{setTimeout(()=>{I.length>0?K("bottom"):K("top"),S("")},50)},[K,I.length])}),(0,y.useEffect)(()=>{let{fundingName:e,fundingId:t,earlyFeedback:r}=l.$applicationFeedbackInfo.get()||{};if(t&&e){if(z)return void e_();l.$applicationFeedbackInfo.set(null),S(""),o.currentAiChatActions.generateApplicationFeedback(e,t,!!r)}},[A,z]),(0,y.useEffect)(()=>{o.currentAiChatActions.getMessageCount()},[]),(0,y.useEffect)(()=>{let e=_.current&&!A;_.current=A,!g||!e||M||z||R.current<4||eO(eI)!==eB()&&(eM(eI,eB()),(0,ek.openMembershipModal)({variation:"cofounderSoftUpsell",redirect:ei.routes.AI_CHAT,purchaseMetadata:{section:"cofounder-soft-upsell"}}).catch(()=>{}))},[A,M,z,g]),(0,y.useEffect)(()=>{let e=()=>{P(!U())};if(e(),D)return window.addEventListener("resize",e),window.addEventListener("orientationchange",e),()=>{window.removeEventListener("resize",e),window.removeEventListener("orientationchange",e)}},[I.length,U,D]),(0,y.useEffect)(()=>{T.current&&P(!U())},[A,U]);let G=E?.find(e=>e._id===k),q=(0,y.useMemo)(()=>I.findIndex(e=>"assistant"===e.role),[I]),Y=A||B||void 0===O,X="new"===x&&!G&&!I.length,J=(0,t.jsx)(f.motion.div,{layout:!0,layoutId:"input-box",initial:{opacity:0}
2,animate:{opacity:1},children:(0,t.jsx)(eb.MultimodalInput,{input:C,setInput:S,onSubmit:(e,t)=>{if(Y)return;if(z)return void e_();let r=e.trim();(r||t&&0!==t.length)&&(o.currentAiChatActions.sendMessage(r,t),F.aiChat.getUserMessageCount.setData(void 0,e=>(e??0)+1),g&&!M&&(R.current=(()=>{let e=eB(),t=eO(eE),r=0;if(t)try{let a=JSON.parse(t);a.date===e&&"number"==typeof a.count&&(r=a.count)}catch{}return eM(eE,JSON.stringify({date:e,count:r+=1})),r})()))},disabled:Y,placeholder:"Ask Anything...",isStreaming:A,composerClassName:X?"border border-gray-200 px-2 py-[7px] shadow-md":void 0,uploadButtonClassName:X?"text-gray-500 hover:bg-transparent [&>svg]:!size-5":void 0})});return G||0!==I.length?(0,t.jsxs)("div",{className:"relative flex h-full w-full flex-col","data-sentry-component":"ChatPanel","data-sentry-source-file":"ChatPanelContainer.tsx",children:[(0,t.jsx)("div",{className:"hidden md:flex",children:(0,t.jsx)(u.AiChatDebugWidget,{className:j,"data-sentry-element":"AiChatDebugWidget","data-sentry-source-file":"ChatPanelContainer.tsx"})}),e&&(0,t.jsx)("div",{className:"sticky top-0 z-10 flex-shrink-0 border-b border-gray-200 bg-white",children:(0,t.jsx)("div",{className:"mx-auto w-full px-8 lg:max-w-4xl",children:e})}),(0,t.jsx)("div",{ref:T,className:(0,n.cn)("w-full px-8","lg:flex-1 lg:overflow-y-auto","max-lg:overflow-visible"),onScroll:D?void 0:()=>{P(!U())},children:I?.length>0&&(0,t.jsx)("div",{className:"mx-auto flex w-full max-w-[834px] flex-col pb-[7.5rem]",children:I.map((e,r)=>{let a;if("tool"===e.role&&e.tool_call_id)for(let t=r-1;t>=0;t--){let r=I[t];if("assistant"===r.role&&r.tool_calls&&(a=r.tool_calls.find(t=>t.id===e.tool_call_id)))break}return(0,t.jsx)("div",{children:"user"===e.role?(0,t.jsx)(eN,{message:e?.content||"Empty message",attachments:e.attachments}):"tool"===e.role?(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(eC,{content:e.content||"",toolCallId:e.tool_call_id||"",toolCall:a})}):"system"===e.role?(0,t.jsx)(ej,{content:e.content||""}):(0,t.jsx)(Z,{message:e.content||"",messageId:e._id,feedbackEvaluation:e.feedbackEvaluation,loading:A&&r===I.length-1,hideMessageActions:h&&r===q,"data-message-role":"assistant"})},e._id||r)})})}),N&&!A&&(0,t.jsx)("div",{className:"max-lg:fixed max-lg:bottom-24 max-lg:left-1/2 max-lg:z-30 max-lg:-translate-x-1/2 max-lg:transform lg:absolute lg:bottom-28 lg:left-1/2 lg:z-30 lg:-translate-x-1/2",children:(0,t.jsx)(ew,{onClick:H})}),(0,t.jsx)("div",{className:(0,n.cn)("sticky bottom-0 bg-white px-8 pb-6 pt-4 max-lg:fixed max-lg:left-0 max-lg:right-0 max-lg:z-40"),children:(0,t.jsxs)("div",{className:"mx-auto w-full lg:max-w-4xl",children:[(0,t.jsx)(Q,{"data-sentry-element":"ChatProgress","data-sentry-source-file":"ChatPanelContainer.tsx"}),J,c?(0,t.jsxs)("div",{className:"mt-4 flex w-full flex-row items-center justify-center gap-1",children:[(0,t.jsx)(en.SkipIcon,{name:"aiShine",className:"inline size-3"}),(0,t.jsxs)("p",{className:"text-center text-sm leading-none text-gray-500",children:["Powered by"," ",(0,t.jsx)("a",{className:"text-primary-600",href:"https://helloskip.com/agent?utm_source=Agent",target:"_blank",children:"Skip"})]})]}):(0,t.jsx)("p",{className:"mt-2 hidden text-center text-xs text-gray-500 lg:block",children:"Skip Cofounder can make mistakes. Consider checking important information."})]})}),(0,t.jsx)("div",{className:"h-24 lg:hidden"}),(G||I.length>0)&&w]}):"new"===x?(0,t.jsx)(ev.CofounderNewLanding,{disabled:Y,input:J,inputContainerClassName:v,onRouteClick:e=>void L.push(e),topRightAction:b}):(0,t.jsx)(ex,{input:J})}},450584,e=>{"use strict";e.s(["BusinessCardGrid",()=>ei,"BusinessCardV2",()=>eu,"FeaturedBusinessCardDataGate",()=>ed,"FeaturedBusinessCardRoot",()=>el,"FollowButton",()=>eh,"LikeButton",()=>ep,"LikeCount",()=>em,"MaybeBoostBadge",()=>es,"businessCardModal",()=>eb,"openFeaturedBusinessCardModal",()=>ex,"openFeaturedBusinessCardModalById",()=>ev,"storedFeaturedBusinessMock",()=>en],450584);var t=e.i(391398),r=e.i(605628),a=e.i(275885);e.i(272989);var n=e.i(880095),s=e.i(613572),i=e.i(469311),o=e.i(464500),l=e.i(126830),c=e.i(586427),d=e.i(307428),u=e.i(567573);e.i(753051);var m=e.i(593537),p=e.i(863601),h=e.i(654382),f=e.i(949838),g=e.i(323554),y=e.i(356698),x=e.i(195232),v=e.i(929588),b=e.i(20260);e.i(215291);var w=e.i(629940),j=e.i(717831),C=e.i(470867),S=e.i(874953),N=e.i(471818),P=e.i(434606),A=e.i(502535),k=e.i(849995),E=e.i(168541),I=e.i(465263),B=e.i(666641),O=e.i(272225),M=e.i(307854),D=e.i(333079),L=e.i(47857),T=e.i(375985),R=e.i(853062),_=e.i(525695),z=e.i(870032),F=e.i(126019),U=e.i(41158),$=e.i(191788);function K({featuredBusinessId:e}){let r=_.trpc.featuredBusinesses.likeDetails.useInfiniteQuery({featuredBusinessId:e,limit:20,internal_test:!M.isProd||!!window.localStorage.getItem("INTERNAL_TEST")},{initialCursor:0,refetchOnMount:"always",getNextPageParam:e=>e.nextCursor}),a=(0,$.useMemo)(()=>r.data?.pages?.flatMap(e=>e.details),[r.data?.pages]);return(0,t.jsxs)("div",{className:"flex flex-col gap-4 p-8 lg:gap-6","data-sentry-component":"RecentLikeModal","data-sentry-source-file":"RecentLikesModal.tsx",children:[(0,t.jsxs)("p",{className:"flex flex-col gap-2 text-center",children:[(0,t.jsx)("h6",{className:"font-inter-display text-h7 font-semibold text-gray-950 lg:text-h6",children:"Recent Likes"}),(0,t.jsx)("span",{className:"font-inter text-sm text-gray-950",children:"All new likes are visible"})]}),(0,t.jsx)(O.Skeleton,{isLoaded:!r.isLoading,"data-sentry-element":"Skeleton","data-sentry-source-file":"RecentLikesModal.tsx",children:a?.length?(0,t.jsx)(W,{like
2s:a,...r}):(0,t.jsx)(V,{})})]})}let H=(0,$.forwardRef)(function(e,a){let n=(0,r.useStore)(L.$user),s=(0,D.resolveFeaturedBusinessLikeState)((0,r.useStore)(D.$featuredBusinessLikeMap),e.id,n.value?.uid),[i,o]=(0,$.useState)(!1);(0,$.useEffect)(()=>{D.featuredBusinessLikeActions.getWithoutServerCount(e.id,n.value?.uid)},[e.id,n.value?.uid]);let l=(0,$.useCallback)(async t=>{if((t.stopPropagation(),n.value)&&e.id&&""!==e.id.trim()){o(!0);try{let t=await D.featuredBusinessLikeActions.saveLikeWithoutServerCount({businessId:e.id,userId:n.value.uid,liked:!s?.liked});t.error&&(0,u.toast)({title:T.isDevEnv?t.error.message:"Oops. An error happened while liking the featuredBusiness, please try again later",variant:"error"})}finally{o(!1)}}},[e.id,n.value,s?.liked]);return(0,t.jsxs)("div",{ref:a,className:"flex flex-row justify-between lg:w-[456px]",children:[(0,t.jsxs)(U.default,{className:"flex flex-row gap-3 hover:cursor-pointer",href:`${R.routes.PUBLIC_LISTING_BUSINESS}/${e.customId||e.id}`,onClick:()=>{(0,C.closeModal)()},children:[(0,t.jsx)("div",{className:"h-11 w-11 overflow-hidden rounded-xl",children:(0,t.jsx)(F.default,{src:e.pictureUrl,width:44,height:44,alt:"Recent Like Business Picture"})}),(0,t.jsxs)("p",{className:"flex flex-col gap-0.5",children:[(0,t.jsx)("h6",{className:"text-md font-medium text-gray-950",children:e.businessName}),(0,t.jsxs)("span",{className:"font-inter text-sm text-gray-600",children:[e.businessCity,", ",e.businessState]})]})]}),(0,t.jsx)(G,{onClick:l,filled:s?.liked,disabled:i})]})});function W({isFetchingNextPage:e,isLoading:r,hasNextPage:a,fetchNextPage:n,data:s}){let i=(0,$.useMemo)(()=>s?.pages?.flatMap(e=>e.details),[s?.pages]),o=(0,$.useRef)(null),l=(0,$.useCallback)(t=>{!e&&!r&&a&&(o.current&&o.current.disconnect(),o.current=new IntersectionObserver(e=>{e[0].isIntersecting&&a&&n()},{threshold:1}),t&&o.current.observe(t))},[e,r,a]);return(0,t.jsxs)("div",{className:"flex max-h-[436px] flex-col gap-8 overflow-y-auto","data-sentry-component":"RecentLikes","data-sentry-source-file":"RecentLikesModal.tsx",children:[i?.map((e,r)=>i.length===r+1?(0,t.jsx)(H,{...e,ref:l},`recent-like-${e.id}`):(0,t.jsx)(H,{...e},`recent-like-${e.id}`)),e&&(0,t.jsx)(O.Skeleton,{children:(0,t.jsx)("div",{className:"h-11 w-full lg:w-[456px]"})})]})}function V(){return(0,t.jsxs)("div",{className:"flex flex-col items-center gap-3 rounded-2xl bg-gray-50 p-10","data-sentry-component":"NoRecentLikes","data-sentry-source-file":"RecentLikesModal.tsx",children:[(0,t.jsx)(z.FavouriteIcon,{className:"h-10 w-10","data-sentry-element":"FavouriteIcon","data-sentry-source-file":"RecentLikesModal.tsx"}),(0,t.jsxs)("p",{className:"flex flex-col gap-2 text-center",children:[(0,t.jsx)("h6",{className:"text-center font-inter-display text-h7 font-semibold text-gray-950",children:"No Recent Likes"}),(0,t.jsx)("span",{className:"max-w-[376px] text-center font-inter text-sm text-gray-950",children:"No likes have been received since the date Skip began showing like activity for businesses"})]})]})}let G=({onClick:e,filled:r,disabled:a})=>(0,t.jsx)(i.Button,{variant:"ghost",className:"relative flex h-8 w-8 items-center justify-center bg-transparent p-0",onClick:e,disabled:a,"data-sentry-element":"Button","data-sentry-component":"HeartButton","data-sentry-source-file":"RecentLikesModal.tsx",children:(0,t.jsx)(z.FavouriteIcon,{className:(0,m.cn)("transition-colors *:transition-colors *:duration-700",r?"fill-red-500 text-red-500":"fill-transparent text-gray-300"),"data-sentry-element":"FavouriteIcon","data-sentry-source-file":"RecentLikesModal.tsx"})});var q=e.i(98442);e.i(581516);var Y=e.i(359385),Z=e.i(538986),X=e.i(657610),Q=e.i(203828);let J=({featuredBusiness:e,onClose:r})=>{let[a,n]=(0,$.useState)(!1),s=`<script src="${window.location.origin}/agent.js" data-agent-id="${e.businessId}"></script>`,l=async()=>{try{await navigator.clipboard.writeText(s),n(!0),(0,u.toast)({title:"Code copied!",description:"The embed code has been copied to your clipboard."}),setTimeout(()=>n(!1),2e3)}catch(e){(0,u.toast)({title:"Copy failed",description:"Please select and copy the code manually.",variant:"destructive"})}};return(0,t.jsxs)("div",{className:"w-full max-w-lg rounded-[16px] bg-white p-8 shadow-xl lg:w-[440px]","data-sentry-component":"AddAIChatAgentModal","data-sentry-source-file":"AddAIChatAgentModal.tsx",children:[(0,t.jsxs)("div",{className:"mb-4 text-center",children:[(0,t.jsx)("div",{className:"mx-auto mb-8 flex h-[100px] w-[100px] items-center justify-center rounded-[20px] shadow-[0px_1px_2px_0px_rgba(40,38,34,0.06)] shadow-[0px_1px_3px_0px_rgba(40,38,34,0.10)] outline outline-1 outline-offset-[-1px] outline-gray-200",children:(0,t.jsx)(o.HugeIcon,{name:"SourceCodeIcon",className:"h-[50px] w-[50px] text-gray-950","data-sentry-element":"HugeIcon","data-sentry-source-file":"AddAIChatAgentModal.tsx"})}),(0,t.jsx)("h2",{className:"text-h6 font-semibold text-gray-950",children:"Embed On Your Website"})]}),(0,t.jsx)("div",{className:"rounded-[20px] bg-gray-50 p-6",children:(0,t.jsx)("pre",{className:"font-mono whitespace-pre-wrap break-all text-sm text-gray-950",children:s})}),(0,t.jsxs)("div",{className:"my-8 text-center text-sm text-gray-950",children:["Learn"," ",(0,t.jsx)("a",{href:"http://helloskip.com/blog/embed-your-ai-agent",target:"_blank",rel:"noopener noreferrer",className:"font-medium text-primary-500",children:"How To Embed"})," ","On Your Site"]}),(0,t.jsxs)("div",{className:"space-y-[8px]",children:[(0,t.jsxs)(i.Button,{onClick:l,variant:"neutral",className:"w-full",size:"lg","data-sentry-element":"Button","data-sentry-source-file":"AddAIChatAgentModal.tsx",children:[(0,t.jsx)(o.HugeIcon,{name:a?"CheckmarkCircle02Icon":"Copy01Icon",className:"mr-2 h-4 w-4","data-sentry-element":"HugeIcon","data-sentry-source-file":"AddAIChatAgentModal.tsx"}),a?"Copied!":"Copy Code"]}),(0,t.jsx)(i.Button,{onClick:r,variant:"secondary",className:"w-full",size:"lg","data-sentry-element":"Button","data-sentry-source-file":"AddAIChatAgentModal.tsx",children:"Close"})]})]})};var ee=e.i(112161),et=e.i(991548);let er=w.lineIcons.aiShine,ea=w.lineIcons.aiShineDisabled,en={_id:"",businessType:"LIMITED_LIABILITY_COMPANY",businessName:"",businessId:"",startYear:0,businessCity:"",businessState:"",pictureUrl:"",smallDescription:"",aboutSection:"",plan:"featured",createdAt:""},es=({onManageBoostClick:e,featured:r,pinnedCard:a,onBoostYourBusinessClick:n})=>{let s=a?r?"manage-boost":"upsell":r?"boosted":null;if(!s)return null;let{tooltipContent:o,color:l,onClick:d}={boosted:{tooltipContent:"Boosted",color:"default",onClick:void 0},"manage-boost":{tooltipContent:"Manage boost",color:"default",onClick:e},upsell:{tooltipContent:"Increase views with Boost",color:"gray",onClick:n}}[s];return(0,t.jsx)(c.Tooltip,{content:o,"data-sentry-element":"Tooltip","data-sentry-component":"MaybeBoostBadge","data-sentry-source-file":"FeaturedBusinessCardV2.tsx",children:(0,t.jsx)(i.Button,{variant:"unstyled",size:"none",onClick:e=>{e.stopPropagation(),d?.()},className:"flex h-8 w-8 items-center justify-center","data-sentry-element":"Button","data-sentry-source-file":"FeaturedBusinessCardV2.tsx",children:(0,t.jsx)(P.Ski
2pIcon,{name:"bolt",className:(0,m.cn)("h-5 w-5 text-[#E9358F]",{grayscale:"gray"===l}),"data-sentry-element":"SkipIcon","data-sentry-source-file":"FeaturedBusinessCardV2.tsx"})})})},ei=({className:e,...r})=>(0,t.jsx)("div",{className:(0,m.cn)("grid grid-cols-[repeat(auto-fit,_minmax(300px,_1fr))] gap-x-4 gap-y-3 has-[>:last-child:nth-child(2)]:grid-cols-[repeat(auto-fit,minmax(300px,400px))] max-lg:grid-cols-1",e),...r,"data-sentry-component":"BusinessCardGrid","data-sentry-source-file":"FeaturedBusinessCardV2.tsx"}),eo=(0,$.createContext)(null),el=({listing:e,children:r,source:a,loadLikeState:n=!0,...s})=>{let i=(0,Q.useRouter)(),o=a??(0,k.getSourceFromPath)(i.pathname),{addIncrement:l}=(0,k.useBatchedCounter)(),c=(0,$.useRef)(null),d=(0,X.useInView)(c,{once:!0}),u=(0,A.useFeaturedBusinessLike)({featuredBusinessId:e._id,initialLikeCount:e.likeCount??0,enabled:n});return(0,$.useEffect)(()=>{if(d){let t=e._id;t&&t!==en._id&&l({id:t,feature:"business_listing",source:o})}},[e,d,o,l]),(0,t.jsx)(eo.Provider,{value:{listing:e,likeState:u},"data-sentry-element":"FeaturedBusinessContext.Provider","data-sentry-component":"FeaturedBusinessCardRoot","data-sentry-source-file":"FeaturedBusinessCardV2.tsx",children:(0,t.jsx)($.Suspense,{fallback:(0,t.jsx)("div",{className:"h-fit w-fit animate-pulse rounded-2xl bg-gray-100"}),"data-sentry-element":"Suspense","data-sentry-source-file":"FeaturedBusinessCardV2.tsx",children:(0,t.jsx)("div",{ref:c,...s,children:r})})})},ec=()=>{let e=(0,$.useContext)(eo);if(!e)throw Error("useFeaturedBusinessContext must be used within a FeaturedBusinessCardRoot");return e},ed=({children:e,fallback:r,isLoading:a=!1})=>{let{likeState:n}=ec();return(0,t.jsx)(t.Fragment,{children:a||n.isInitialLoading?r:e})},eu=$.default.memo(({featuredBusiness:e,onEdit:u,variant:b="standard",pinnedCard:w,onBoostYourBusinessClick:S,beforeAction:A,className:k,onClick:B})=>{let O=(0,E.useStoreSelector)(p.$cachedFeaturedBusinesses,t=>t[e._id]??e),M=(0,E.useStoreSelector)(p.$reviewedBusinessIds,t=>t[e._id]??!1),D=(0,$.useCallback)(async()=>{if((0,g.openBusinessPanel)(O._id),M)try{let t=await (0,q.getFeaturedBusiness)(e._id);t&&(0,p.cacheFeaturedBusiness)(t)}finally{(0,p.clearReviewedBusinessId)(e._id)}},[M,e._id,O]),L=B??D;e._id,en._id;let{push:T}=(0,Q.useRouter)(),_=(0,$.useRef)(null),z=(0,r.useStore)(f.$featuredBusinessSubscription),U=(0,r.useStore)(f.$agentSubscription),[H,W]=(0,$.useState)(!1);(0,$.useEffect)(()=>{(async()=>{e.businessId?W((await (0,Y.getDoc)((0,Y.doc)(s.firestore,`custom_agent/${e.businessId}`))).exists()):W(!1)})()},[e.businessId]);let V=(0,$.useMemo)(()=>{let{smallDescription:r}=e;if(r)return r.split("\n").reduce((e,r,a,n)=>(e.push(r.trim()),a!=n.length-1&&e.push((0,t.jsx)("br",{})),e),[])},[e]),G=!!e.isGrantWinner&&"number"==typeof e.grantWinAmount&&!!e.grantWinName,X=(0,$.useCallback)(()=>{if((0,n.eventRaven)("listingBusinessClick",{action:"boostedModal"}),w&&e.featured&&z.value)return(0,I.openBoostSliderModal)({featuredBusinessSubscription:z.value,featuredBusiness:e}).catch(e=>{e instanceof C.ModalError||a.captureException(e)})},[w,e,z.value]),J=(0,$.useCallback)(t=>{t.stopPropagation();let r=e?.businessRealName||e.businessName;if(r){let e=encodeURIComponent(r);window.open(`${R.routes.SKIP_GRANTS}?search=${e}`,"_blank")}},[e]);return(0,t.jsx)(t.Fragment,{children:(0,t.jsx)(el,{listing:e,children:(0,t.jsx)("div",{onClick:L?e=>{e.stopPropagation(),L?.()}:void 0,className:(0,m.cn)("relative flex min-h-[382px] flex-row gap-4 overflow-hidden rounded-2xl border border-gray-100 bg-white p-6 shadow-xs",{"cursor-pointer":"modal"!==b&&L,"h-fit w-full border-none shadow-none":"modal"===b,"bg-gray-50":!!e.featured,"border-dashed border-primary-200 bg-primary-50":w},k),children:(0,t.jsxs)("div",{className:"flex min-h-0 flex-1 flex-col gap-4 overflow-hidden",children:[(0,t.jsxs)("div",{className:"absolute right-3 top-3 flex flex-row items-center gap-2 empty:hidden",children:[!!e.isGrantWinner&&(0,t.jsx)(c.Tooltip,{content:"Skip Grant Winner",children:(0,t.jsx)(i.Button,{variant:"unstyled",size:"none",onClick:J,"aria-label":"Skip Grant Winner",className:"flex h-8 w-8 items-center justify-center bg-transparent p-0 hover:bg-transparent",children:(0,t.jsx)(P.Ski
2pIcon,{name:"medal",className:"h-5 w-5 text-warning-500"})})}),(0,t.jsx)(es,{onManageBoostClick:X,featured:!!e.featured,onBoostYourBusinessClick:S,pinnedCard:w})]}),(0,t.jsx)("div",{className:"flex flex-row justify-between",children:(0,t.jsx)("div",{className:(0,m.cn)("relative h-[90px] max-h-[90px] w-[90px] max-w-[90px] overflow-hidden rounded-2xl border border-gray-100"),children:(0,t.jsx)(j.ImageErrorBoundary,{src:e.pictureUrl,fallback:(0,t.jsx)("div",{className:"bg-gray-50 p-6",children:(0,t.jsx)(Z.Store04Icon,{className:"size-10 text-gray-300"})}),children:(0,t.jsx)(F.default,{src:e.pictureUrl,alt:e.businessName,width:256,height:256,className:"h-[90px] max-h-[90px] w-[90px] max-w-[90px] rounded-2xl object-cover",loading:"lazy"})})})}),(0,t.jsxs)("span",{className:(0,m.cn)("mt-2 min-h-0 flex-1 overflow-hidden",{"min-w-[250px] max-w-[300px]":"modal"===b}),children:[(0,t.jsx)(y.BusinessTagLabel,{as:"h6",featuredBusiness:e,className:"mb-2 font-inter text-sm text-gray-400"}),(0,t.jsxs)("div",{className:"mb-2 flex items-baseline lg:line-clamp-2",children:[(0,t.jsx)("h5",{className:(0,m.cn)("inline align-middle font-inter-display text-md font-semibold text-gray-950 [&:not(:last-child)]:mr-1.5",{"!text-h7":"modal"===b}),children:e.businessName}),(0,t.jsx)(v.VerificationBadge,{businessId:e.businessId,showUpsell:w,verificationStatus:e.verificationStatus})]}),G&&(0,t.jsx)(x.GrantBadge,{isGrantWinner:!0,amount:e.grantWinAmount,grantName:e.grantWinName,awardType:e.grantWinType,onClick:J}),!G&&(0,t.jsx)("p",{className:(0,m.cn)("mt-2 line-clamp-2 overflow-hidden text-ellipsis text-sm text-gray-700",{"line-clamp-none max-lg:hidden":"modal"===b}),children:V}),(0,t.jsxs)("p",{className:(0,m.cn)("mt-4 w-full text-sm text-gray-400"),children:[e.businessCity,","," ",e.businessState]})]}),(0,t.jsxs)("div",{className:"flex flex-col justify-between gap-4 lg:mt-auto",children:[(0,t.jsx)("p",{className:(0,m.cn)("hidden",{"max-lg:block":"modal"===b}),children:V}),(0,t.jsxs)("div",{className:"flex w-full flex-row items-center justify-between",children:[(0,t.jsxs)("div",{className:"flex flex-row items-center gap-2",children:[(0,t.jsxs)("div",{className:"flex items-center gap-0.5",children:[(0,t.jsx)(ep,{}),w?(0,t.jsx)(c.Tooltip,{content:"See Likes",children:(0,t.jsx)(i.Button,{variant:"ghost",onClick:r=>{r.stopPropagation(),function(){if((0,n.eventRaven)("listingBusinessClick",{action:"likesCount"}),w){let r;(r={featuredBusinessId:e._id},(0,C.asyncModal)({id:"recent-likes",builder:()=>(0,t.jsx)(K,{...r})})).catch(e=>{e instanceof C.ModalError||a.captureException(e)})}}()},className:"min-h-8 min-w-8 bg-transparent px-2 text-sm text-gray-600 transition-all",children:(0,t.jsx)(em,{})})}):(0,t.jsx)("p",{className:"ml-1 text-sm text-gray-600 transition-all",children:(0,t.jsx)(em,{})})]}),!!w&&(0,t.jsx)(ey,{featuredBusinessId:e._id,onBoostYourBusinessClick:S,isFeatured:!!e.featured,beforeAction:A})]}),(0,t.jsxs)("div",{className:"flex flex-row items-center gap-1.5",children:["modal"!==b&&(!!w||!!e.hasCustomAgent)&&(0,t.jsx)(t.Fragment,{children:e.hasCustomAgent||w&&H?(0,t.jsxs)(l.Sheet,{children:[(0,t.jsx)(c.Tooltip,{content:"View AI Agent",children:(0,t.jsx)(l.SheetTrigger,{asChild:!0,onClick:e=>{e.stopPropagation(),(0,n.eventRaven)("listingBusinessClick",{action:"viewAiAgentClick"})},children:(0,t.jsx)(i.Button,{variant:"unstyled",size:"none",icon:!0,className:(0,m.cn)("size-8 cursor-pointer items-center justify-center rounded-lg p-px shadow-none transition-opacity hover:opacity-90",{"ai-gradient-bg":U.value||!w,"bg-gray-200":!U.value&&w}),children:(0,t.jsx)("div",{className:(0,m.cn)("flex h-full w-full items-center justify-center rounded-[calc(0.5rem-1px)] bg-white",{"hover:bg-gray-100":!U.value&&w}),children:!U.value&&w?(0,t.jsx)(ea,{className:"size-4"}):(0,t.jsx)(er,{className:"size-4"})})})})}),(0,t.jsx)(l.SheetContent,{ref:_,side:"right",className:"z-[999] my-8 overflow-hidden bg-white px-0 max-lg:w-full md:mx-4 md:mt-[20px] md:h-[calc(100vh-40px)] md:rounded-2xl md:px-0 md:py-0 lg:w-[780px]",children:(0,t.jsx)(ee.ChatAgentEmbed,{businessId:e.businessId,featuredBusiness:e,isInSheet:!0})})]}):(0,t.jsx)(c.Tooltip,{content:"Add AI Agent",disabled:!w,children:(0,t.jsx)(i.Button,{variant:"secondary",size:"xs",icon:!0,onClick:e=>{e.stopPropagation(),w&&T(`${R.routes.AI_CHAT}?prompt=Create an AI Agent for My Business`)},className:"rounded-lg",children:(0,t.jsx)(ea,{className:"size-4"})})})}),!!w&&!U.value&&(0,t.jsx)(c.Tooltip,{content:"Upgrade Your Agent",children:(0,t.jsx)(i.Button,{icon:!0,variant:"secondary",className:"min-h-8 !w-8 !min-w-8",onClick:e=>{e.stopPropagation(),(0,h.openModal)({options:{size:"full"},id:"pricingTableModal",content:(0,t.jsx)(et.PricingTable,{table:"agent"})})},children:(0,t.jsx)(o.HugeIcon,{name:"CrownIcon",className:"size-4 text-gray-600"})})}),!!w&&(0,t.jsxs)(d.DropdownMenu,{children:[(0,t.jsx)(d.DropdownMenuTrigger,{asChild:!0,children:(0,t.jsx)(i.Button,{variant:"secondary",icon:!0,className:"!h-[32px] min-h-[32px] !w-[32px] !min-w-[32px]",onClick:e=>e.stopPropagation(),children:(0,t.jsx)(o.HugeIcon,{name:"MoreVerticalCircle01Icon",fillColor:"text-gray-600",className:"h-6 w-6 text-gray-600"})})}),(0,t.jsxs)(d.DropdownMenuContent,{className:"w-56 rounded-lg border border-gray-200 bg-white p-2 shadow-lg",children:[(0,t.jsxs)(d.DropdownMenuItem,{onClick:e=>{e.stopPropagation(),u&&u()},className:"flex cursor-pointer items-center rounded-md px-3 py-2.5 text-sm font-medium text-gray-900 transition-colors hover:bg-gray-50",children:[(0,t.jsx)(o.HugeIcon,{name:"Store04Icon",className:"mr-3 h-4 w-4 text-gray-600"}),"Edit Listing"]}),(0,t.jsxs)(d.DropdownMenuItem,{onClick:r=>{r.stopPropagation(),(0,C.openModalSync)({id:"share-listing-modal",content:(0,t.jsx)(N.ShareListingModal,{featuredBusiness:e})})},className:"flex cursor-pointer items-center rounded-md px-3 py-2.5 text-sm font-medium text-gray-900 transition-colors hover:bg-gray-50",children:[(0,t.jsx)(o.HugeIcon,{name:"Share05Icon",className:"mr-3 h-4 w-4 text-gray-600"}),"Share Listing"]}),(0,t.jsxs)(d.DropdownMenuItem,{onClick:t=>{t.stopPropagation(),e.hasCustomAgent&&w?T(`${R.routes.AI_CHAT}?prompt=Edit My Custom Agent`):T(`${R.routes.AI_CHAT}?prompt=Create an AI Agent for My Business`)},className:"flex cursor-pointer items-center rounded-md px-3 py-2.5 text-sm font-medium text-gray-900 transition-colors hover:bg-gray-50",children:[(0,t.jsx)(o.HugeIcon,{name:"TabletPenIcon",className:"mr-3 h-4 w-4 text-gray-600"}),"Edit Agent"]}),(0,t.jsxs)(d.DropdownMenuItem,{onClick:async t=>{t.stopPropagation(),await eb.openModal("add-ai-chat-agent-modal",{featuredBusiness:e})},className:"flex cursor-pointer items-center rounded-md px-3 py-2.5 text-sm font-medium text-gray-900 transition-colors hover:bg-gray-50",children:[(0,t.jsx)(o.HugeIcon,{name:"SourceCodeIcon",className:"mr-3 h-4 w-4 text-gray-600"}),"Embed Agent on Site"]})]})]})]})]})]})]})})})})}),em=()=>{let{likeState:e}=ec();return(0,t.jsx)(t.Fragment,{children:e.count})},ep=$.default.memo(({className:e,...r})=>{let{likeState:a}=ec();return(0,t.jsx)(b.HeartButton,{onClick:a.toggle,filled:a.liked,...r})}),eh=$.default.memo(({className:e,disabled:r,...a})=>{let{likeState:n}=ec();
2return(0,t.jsx)(i.Button,{type:"button",variant:n.liked?"tertiary":"secondary",size:"sm","aria-pressed":n.liked,isLoading:n.isLoading,disabled:r||n.isDisabled||n.isLoading,onClick:n.toggle,className:(0,m.cn)("min-h-9 min-w-[75px]",e),...a,children:n.liked?"Following":"Follow"})});function ef({className:e}){return(0,t.jsxs)("p",{className:(0,m.cn)("flex flex-col gap-2 font-inter text-sm text-gray-950",e),"data-sentry-component":"BoostYourBusinessInfo","data-sentry-source-file":"FeaturedBusinessCardV2.tsx",children:[(0,t.jsx)("h6",{className:"font-inter-display text-h7 font-semibold",children:"Want to Reach Thousands of Potential Customers?"}),"Feature your business to:",(0,t.jsxs)("ul",{className:"ml-6 flex list-disc flex-col gap-2 font-inter",children:[(0,t.jsx)("li",{children:"Appear at the top of the listings page"}),(0,t.jsx)("li",{children:"Get spotlighted during live grant drawings seen by thousands"}),(0,t.jsx)("li",{children:"Get prime placement on the Instant Grants page"})]})]})}function eg({featuredBusiness:e}){let r=(0,$.useMemo)(()=>{if(!e.websiteUrl)return"";let t=e.websiteUrl.trim();return t.startsWith("http://")||t.startsWith("https://")?t:`https://${e.websiteUrl}`},[e.websiteUrl]);return(0,t.jsxs)("div",{className:"flex flex-1 flex-col gap-3 rounded-xl p-6 max-lg:pt-0 lg:w-[360px]","data-sentry-component":"AboutInfo","data-sentry-source-file":"FeaturedBusinessCardV2.tsx",children:[(0,t.jsx)("h6",{className:"font-inter-display text-h6 font-semibold lg:text-h7",children:"About"}),(0,t.jsx)("p",{className:"min-w-[280px] font-inter text-sm text-gray-900 lg:max-w-[360px]",children:e.aboutSection}),(0,t.jsx)("hr",{className:"mt-auto"}),(0,t.jsx)("div",{className:"g flex min-h-11 w-full items-end",children:(0,t.jsxs)("div",{className:"ml-auto grid grid-flow-col gap-2 max-lg:w-full lg:flex lg:flex-row",children:[r&&(0,t.jsx)(i.Button,{asChild:!0,size:"sm",variant:"secondary",children:(0,t.jsx)(U.default,{href:r,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),children:"Go To Website"})}),(0,t.jsx)(i.Button,{asChild:!0,size:"sm",variant:"neutral","data-sentry-element":"Button","data-sentry-source-file":"FeaturedBusinessCardV2.tsx",children:(0,t.jsx)(U.default,{href:`${R.routes.PUBLIC_LISTING_BUSINESS}/${e.customId||e._id}`,target:"_blank",rel:"noopener noreferrer",onClick:e=>e.stopPropagation(),"data-sentry-element":"Link","data-sentry-source-file":"FeaturedBusinessCardV2.tsx",children:"Learn More"})})]})})]})}function ey(e){let{featuredBusinessId:r}=e,{data:a,isLoading:s}=_.trpc.featuredBusinesses.viewCount.useQuery({featuredBusinessId:r},{enabled:r!=en._id});async function o(){return(0,n.eventRaven)("listingBusinessClick",{action:"viewCount"}),await e.beforeAction?.(),(0,h.closeModal)(),(0,B.openPublicListingMetricsModal)(e)}return(0,t.jsxs)("div",{className:(0,m.cn)("flex flex-row items-center gap-0.5 text-sm text-gray-600 opacity-0 transition-opacity",{"opacity-100":!s}),"data-sentry-component":"BusinessCardViewCount","data-sentry-source-file":"FeaturedBusinessCardV2.tsx",children:[(0,t.jsx)(P.SkipIcon,{name:"eyeShow",className:"size-[26px] text-gray-300","data-sentry-element":"SkipIcon","data-sentry-source-file":"FeaturedBusinessCardV2.tsx"}),(0,t.jsx)(c.Tooltip,{content:"See Views","data-sentry-element":"Tooltip","data-sentry-source-file":"FeaturedBusinessCardV2.tsx",children:(0,t.jsx)(i.Button,{variant:"unstyled",className:"textms-m min-h-8 bg-transparent px-1 text-gray-600",onClick:e=>{e.stopPropagation(),o()},"data-sentry-element":"Button","data-sentry-source-file":"FeaturedBusinessCardV2.tsx",children:a&&new Intl.NumberFormat("en-US").format(a)})})]})}let ex=e=>(0,C.openModalSync)({id:"featured-business-modal",content:(0,t.jsxs)("div",{className:"flex flex-col gap-2 p-2 max-lg:w-screen lg:flex-row",children:[(0,t.jsx)(eu,{...e,variant:"modal"}),(0,t.jsx)("div",{className:"my-6 hidden w-[1px] min-w-[1px] max-w-[1px] flex-1 bg-gray-100 lg:flex"}),(0,t.jsx)(eg,{featuredBusiness:e.featuredBusiness})]}),options:{dismissOnRouteChange:!0,containerClassname:"max-lg:self-end",modalClassname:"max-lg:rounded-b-none",dialogClassName:"max-md:justify-end max-md:items-end max-h-dvh",close:null}}),ev=async e=>{try{let t=await (0,q.getFeaturedBusiness)(e);if(!t)throw Error("Featured business not found");return ex({featuredBusiness:t})}catch(e){if(e instanceof C.ModalError)return;a.captureException(e),(0,u.toast)({variant:"destructive",title:"An error occurred",description:"Unable to load business listing. Please try again later."})}},eb=(0,C.registerModals)({id:"boost-your-business-mobile-info",builder:()=>(0,t.jsx)(ef,{className:"mb-24 mt-2 p-6"}),onAsyncModalPromise:e=>e.catch(console.error),options:{dismissOnRouteChange:!0,containerClassname:"max-lg:self-end",modalClassname:"max-lg:rounded-b-none"}},{id:"add-ai-chat-agent-modal",builder:(e,r,a)=>(0,t.jsx)(J,{featuredBusiness:a.featuredBusiness,onClose:r}),onAsyncModalPromise:e=>e.catch(console.error),options:{dismissOnRouteChange:!0,dismissOnClickOutside:!0,containerClassname:"max-lg:items-center",modalClassname:"max-lg:rounded-xl"}},{id:"share-this-funding-modal",builder:(e,r,a)=>(0,t.jsx)(S.ShareBusinessModal,{featuredBusiness:a.featuredBusiness}),onAsyncModalPromise:e=>e.catch(console.error),options:{dismissOnRouteChange:!0,size:"sm"}})},546554,e=>{"use strict";var t=e.i(613572),r=e.i(737259);e.i(581516);var a=e.i(359385),n=e.i(706770),s=e.i(673254),i=e.i(863601);e.s(["createAiAgentSummaryAtom",0,e=>{let s=(0,n.atom)(e);return(0,r.computedSnapshotAtom)(s,e=>e?(0,a.doc)((0,t.collection)("ai_agent_summary").ref,e):null)},"createBusinessFeaturedProductAtom",0,(e,s)=>{let i=(0,n.atom)({businessId:e,featuredProductId:s});return(0,r.computedSnapshotAtom)(i,({businessId:e,featuredProductId:r})=>e&&r?(0,a.doc)((0,t.collection)("business").s(e,"products").ref,r):null)},"createBusinessProductsAtom",0,e=>{let s=(0,n.atom)(e);return(0,r.computedSnapshotAtom)(s,e=>e?(0,a.query)((0,t.collection)("business").s(e,"products").ref):null)},"createPublicListingAtom",0,e=>{let s=(0,n.atom)(e);return(0,r.computedSnapshotAtom)(s,e=>e?(0,a.doc)((0,t.collection)("featured_business").ref,e):null)},"createRefreshablePublicListingAtom",0,(e,t)=>{let r=(0,n.atom)(e);return(0,s.onMount)(r,()=>{let a=(0,s.onSet)(i.$reviewedBusinessIds,async({newValue:a})=>{if(a[e._id])try{let a=await t(e._id);
2a&&(r.set(a),(0,i.cacheFeaturedBusiness)(a))}finally{(0,i.clearReviewedBusinessId)(e._id)}});return()=>{a()}}),r}])},863601,e=>{"use strict";var t=e.i(772807);let r=(0,t.map)({}),a=(0,t.map)({});e.s(["$cachedFeaturedBusinesses",0,a,"$reviewedBusinessIds",0,r,"cacheFeaturedBusiness",0,e=>{a.setKey(e._id,e)},"clearReviewedBusinessId",0,e=>{r.setKey(e,!1)}])},197081,325196,574264,741461,461030,135242,957097,211314,747732,e=>{"use strict";let t=(0,e.i(706770).atom)(null);e.s(["$applicationFeedbackInfo",0,t],197081);var r,a=e.i(391398),n=e.i(605628),s=e.i(464500),i=e.i(592288);e.i(753051);var o=e.i(593537),l=e.i(67681),c=e.i(659491),d=e.i(498817),u=e.i(198311),m=e.i(191788);function p(e){if(!e||!e.startsWith("§"))return null;try{if(!e.includes("§",1))return null;let t=e.slice(1);t.endsWith("§")&&(t=t.slice(0,-1)),t=t.replace(/\n/g," ").replace(/\r/g," ").replace(/\s+/g," ").trim();let r=(t=function(e){let t=e.indexOf(":");if(-1===t)return e.replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*\s][^*]*[^*\s])\*/g,"$1").replace(/\*([^*\s])\*/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/~~([^~]+)~~/g,"$1").replace(/__([^_]+)__/g,"$1").replace(/_([^_\s][^_]*[^_\s])_/g,"$1").replace(/_([^_\s])_/g,"$1").replace(/([^a-zA-Z0-9])\*+([^a-zA-Z0-9])/g,"$1$2").replace(/\s+/g," ").trim();let r=e.slice(0,t),a=e.slice(t+1),n=r.replace(/\*\*([^*]+)\*\*/g,"$1").replace(/\*([^*\s][^*]*[^*\s])\*/g,"$1").replace(/\*([^*\s])\*/g,"$1").replace(/`([^`]+)`/g,"$1").replace(/~~([^~]+)~~/g,"$1").replace(/__([^_]+)__/g,"$1").replace(/_([^_\s][^_]*[^_\s])_/g,"$1").replace(/_([^_\s])_/g,"$1").replace(/([^a-zA-Z0-9])\*+([^a-zA-Z0-9])/g,"$1$2").replace(/\s+/g," ").trim();return`${n}:${a}`}(t)).indexOf(":");if(-1===r)return{type:t.trim(),params:{}};let a=t.slice(0,r).trim(),n=t.slice(r+1).trim(),s={};if(!n)return{type:a,params:{}};if(!n.match(/\s+\w+\s*=/)){let e=n.indexOf("=");if(-1===e)return{type:a,params:{}};let t=n.slice(0,e).trim(),r=n.slice(e+1).trim();try{let e=JSON.parse(r);return{type:a,params:{[t]:e}}}catch{return{type:a,params:{[t]:r}}}}for(let e of n.matchAll(/(\w+)\s*=\s*("(?:[^"\\]|\\.)*"|'(?:[^'\\]|\\.)*'|\[[^\]]*\]|[^\s=]+)(?=\s+\w+\s*=|\s*$)/g)){let[,t,r]=e,a=r;(a.startsWith('"')&&a.endsWith('"')||a.startsWith("'")&&a.endsWith("'"))&&(a=(a=a.slice(1,-1)).replace(/\\"/g,'"').replace(/\\'/g,"'"));let n=a.trim();try{let e=JSON.parse(n);("items"===t||"variants"===t||"upsellType"===t||"keywords"===t||"images"===t||"pins"===t)&&Array.isArray(e)&&"items"===t?s[t]=e.filter(e=>"string"==typeof e):s[t]=e}catch{isNaN(Number(n))?("items"===t||"variants"===t||"upsellType"===t||"keywords"===t||"images"===t||"pins"===t)&&n.includes(",")?s[t]=n.split(",").map(e=>e.trim()).filter(Boolean):s[t]=n:s[t]=Number(n)}}return{type:a,params:s}}catch(e){return console.warn("Error parsing component:",e),null}}e.s(["AiChatDebugWidget",0,({className:e})=>{let{firebaseUser:t}=(0,c.useUser)(),r=(0,n.useStore)(l.$aiChatDebugTools),p=(0,n.use
2Store)(l.$aiChatComponentParserDebug),h=(0,n.useStore)(l.$aiChatMarkdownDebug),[f,g]=(0,m.useState)(!1);return(0,m.useMemo)(()=>!!t?.email&&t.email.endsWith("@helloskip.com"),[t?.email])?(0,a.jsx)("div",{className:(0,o.cn)("fixed right-8 top-36 z-50",e),"data-sentry-component":"AiChatDebugWidget","data-sentry-source-file":"AiChatDebugWidget.tsx",children:(0,a.jsx)(u.motion.div,{initial:!1,animate:{width:f?"auto":"48px",height:f?"auto":"48px"},transition:{duration:.2,ease:"easeInOut"},className:(0,o.cn)("overflow-hidden rounded-lg border border-gray-200 bg-white",f?"p-4":"p-0"),"data-sentry-element":"motion.div","data-sentry-source-file":"AiChatDebugWidget.tsx",children:(0,a.jsx)(d.AnimatePresence,{mode:"wait","data-sentry-element":"AnimatePresence","data-sentry-source-file":"AiChatDebugWidget.tsx",children:f?(0,a.jsxs)(u.motion.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},className:"min-w-[200px]",children:[(0,a.jsxs)("div",{className:"mb-3 flex items-center justify-between",children:[(0,a.jsx)("h3",{className:"text-sm font-medium text-gray-900",children:"Debug Controls"}),(0,a.jsx)("button",{onClick:()=>g(!1),className:"text-gray-400 hover:text-gray-600",children:(0,a.jsx)(s.HugeIcon,{name:"Cancel01Icon",className:"h-4 w-4"})})]}),(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("label",{htmlFor:"debug-messages-toggle",className:"text-sm font-medium text-gray-700",children:"Debug Tools"}),(0,a.jsx)("span",{className:"text-xs text-gray-500",children:"Show tool & system messages"})]}),(0,a.jsx)(i.Switch,{id:"debug-messages-toggle",checked:r,onCheckedChange:e=>{l.$aiChatDebugTools.set(e)}})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("label",{htmlFor:"markdown-toggle",className:"text-sm font-medium text-gray-700",children:"Debug Markdown"}),(0,a.jsx)("span",{className:"text-xs text-gray-500",children:"Show plain text without formatting"})]}),(0,a.jsx)(i.Switch,{id:"markdown-toggle",checked:h,onCheckedChange:e=>{l.$aiChatMarkdownDebug.set(e)}})]}),(0,a.jsxs)("div",{className:"flex items-center justify-between gap-4",children:[(0,a.jsxs)("div",{className:"flex flex-col",children:[(0,a.jsx)("label",{htmlFor:"component-parser-toggle",className:"text-sm font-medium text-gray-700",children:"Debug Component Parser"}),(0,a.jsx)("span",{className:"text-xs text-gray-500",children:"Show raw § notation without parsing"})]}),(0,a.jsx)(i.Switch,{id:"component-parser-toggle",checked:p,onCheckedChange:e=>{l.$aiChatComponentParserDebug.set(e)}})]})]})]},"expanded"):(0,a.jsx)(u.motion.button,{initial:{opacity:0}
2,animate:{opacity:1},exit:{opacity:0},onClick:()=>g(!0),className:"flex h-12 w-12 items-center justify-center text-gray-600 hover:text-gray-900",title:"AI Chat Debug Controls",children:(0,a.jsx)(s.HugeIcon,{name:"Settings02Icon",className:"h-5 w-5"})},"collapsed")})})}):null}],325196),e.s(["parseMessageContent",0,function(e,t=!0){let r;if(!e)return{content:"",components:[]};if(!t)return{content:e,components:[]};let a=[],n=[],s=e,i=/§\s*(\w+):\s*(\w+)=`([^`]*(?:\n[^`]*)*)`\s*§/g;for(;null!==(r=i.exec(e));){let[e,t,n,i]=r;a.push({type:t,params:{[n]:i.trim()}}),s=s.replace(e,"")}for(let e of s.split("\n")){if(!e.trim()){n.push(e);continue}if(e.includes("§")){if(e.includes("§")&&!e.match(/§[^§]*§/))continue;let t=function(e){let t=[],r=e.split("§").filter(e=>e.trim());for(let e=0;e<r.length;e++){let a=r[e].trim();if(!a)continue;let n=a.replace(/^[\s-]+/,"").trim();if(!n)continue;let s=p(`\xa7${n}\xa7`);s&&t.push(s)}return t}(e);if(a.push(...t),t.length>0)continue;let r=e.replace(/§[^§]*§/g,"").replace(/\s*-\s*/g," ").trim();r&&r.length>10&&n.push(r)}else{let t=p(e);t?a.push(t):n.push(e)}}let o=n.join("\n").trim();return o||a.length?{content:o||"",components:a}:{content:e,components:[]}}],574264);var h=e.i(613572),f=e.i(469311),g=e.i(324247),y=e.i(470867),x=e.i(364034);e.i(581516);var v=e.i(359385);let b=(0,e.i(931358).default)("DocumentCodeIcon",[["path",{d:"M18 16L19.8398 17.5858C20.6133 18.2525 21 18.5858 21 19C21 19.4142 20.6133 19.7475 19.8398 20.4142L18 22",stroke:"currentColor",key:"k0"}],["path",{d:"M14 16L12.1602 17.5858C11.3867 18.2525 11 18.5858 11 19C11 19.4142 11.3867 19.7475 12.1602 20.4142L14 22",stroke:"currentColor",key:"k1"}],["path",{d:"M20 13.0032L20 7.8199C20 6.12616 20 5.27929 19.732 4.60291C19.3013 3.51555 18.39
202 2.65784 17.2352 2.25228C16.5168 2 15.6173 2 13.8182 2C10.6698 2 9.09563 2 7.83836 2.44148C5.81714 3.15122 4.22281 4.6522 3.46894 6.55509C3 7.73875 3 9.22077 3 12.1848L3 14.731C3 17.8013 3 19.3364 3.8477 20.4025C4.09058 20.708 4.37862 20.9792 4.70307 21.2078C5.61506 21.8506 6.85019 21.9757 9 22",stroke:"currentColor",key:"k2"}],["path",{d:"M3 12C3 10.159 4.49238 8.66667 6.33333 8.66667C6.99912 8.66667 7.78404 8.78333 8.43137 8.60988C9.00652 8.45576 9.45576 8.00652 9.60988 7.43136C9.78333 6.78404 9.66667 5.99912 9.66667 5.33333C9.66667 3.49238 11.1591 2 13 2",stroke:"currentColor",key:"k3"}]]);e.s(["DocumentCodeIcon",0,b],741461),e.s(["CofounderDocumentPreview",0,({documentId:e})=>{let{data:t}=(0,x.useQuery)({queryKey:["user-document",e],queryFn:async()=>{let t=await (0,v.getDoc)((0,v.doc)((0,h.collection)("user_documents").ref,e)),r=t.data();return r?(0,g.toStoredUserDocument)(r,t.id):null}}),{data:r}=(0,x.useQuery)({queryKey:["user-document-url",e],queryFn:()=>t?(0,g.getFileUrl)(t):null,enabled:!!t});return(0,a.jsxs)("div",{className:"flex items-center gap-3 rounded-lg border border-gray-200 bg-white p-3 shadow-sm","data-sentry-component":"CofounderDocumentPreview","data-sentry-source-file":"DocumentPreview.tsx",children:[(0,a.jsx)("div",{className:"flex h-8 w-8 items-center justify-center rounded bg-blue-50",children:(0,a.jsx)(b,{className:"h-5 w-5 text-blue-600","data-sentry-element":"DocumentCodeIcon","data-sentry-source-file":"DocumentPreview.tsx"})}),(0,a.jsxs)("div",{className:"flex-1",children:[(0,a.jsx)("p",{className:"text-sm font-medium text-gray-900",children:t?.displayName||t?.name||"Business Plan"}),(0,a.jsx)("p",{className:"text-xs text-gray-500",children:"PDF ⢠Ready for preview"})]}),(0,a.jsx)(f.Button,{size:"sm",variant:"secondary",disabled:!r,className:"text-sm",onClick:()=>{r&&(0,y.openModalSync)({id:"pdf-preview-modal",content:(0,a.jsxs)("div",{className:"w-[95vw] max-w-4xl p-6",children:[(0,a.jsx)("div",{className:"mb-4 flex items-center justify-between",children:(0,a.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:t?.displayName||t?.name||"Business Plan"})}),(0,a.jsx)("div",{className:"rounded-lg border border-gray-200 bg-white",children:(0,a.jsx)("iframe",{src:r,className:"h-[80vh] w-full rounded-lg",title:"PDF Preview"})})]}),options:{fullscreen:!0}})},"data-sentry-element":"Button","data-sentry-source-file":"DocumentPreview.tsx",children:r?"Preview":"Loading..."})]})}],461030);var w=e.i(812500),j=e.i(321020),C=e.i(378097),S=m,N=e.i(56206),P=e.i(379472),A=m,k=e.i(106043),E=e.i(143338),I=e.i(630173),B=e.i(297974),O=e.i(497932),M=["direction","width","dataKey","isAnimationActive","animationBegin","animationDuration","animationEasing"];function D(e,t,r){var a;return(t="symbol"==typeof(a=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?a:a+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function L(){return(L=Object.assign.bind()).apply(null,arguments)}function T(e){var{direction:t,width:r,dataKey:a,isAnimationActive:n,animationBegin:s,animationDuration:i,animationEasing:o}=e,l=function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r={};for(var a in e)if(({}).hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,M),c=(0,k.filterProps)(l,!1),{data:d,dataPointFormatter:u,xAxisId:m,yAxisId:p,errorBarOffset:h}=(0,E.useErrorBarContext)(),f=(0,I.useXAxis)(m),g=(0,I.useYAxis)(p);if((null==f?void 0:f.scale)==null||(null==g?void 0:g.scale)==null||null==d||"x"===t&&"number"!==f.type)return null;var y=d.map(e=>{var l,d,{x:m,y:p,value:y,errorVal:x}=u(e,a,t);if(!x)return null;var v=[];if(Array.isArray(x)?[l,d]=x:l=d=x,"x"===t){var{scale:b}=f,w=p+h,j=w+r,C=w-r,S=b(y-l),N=b(y+d);v.push({x1:N,y1:j,x2:N,y2:C}),v.push({x1:S,y1:w,x2:N,y2:w}),v.push({x1:S,y1:j,x2:S,y2:C})}else if("y"===t){var{scale:k}=g,E=m+h,I=E-r,B=E+r,M=k(y-l),D=k(y+d);v.push({x1:I,y1:D,x2:B,y2:D}),v.push({x1:E,y1:M,x2:E,y2:D}),v.push({x1:I,y1:M,x2:B,y2:M})}var T="".concat(m+h,"px ").concat(p+h,"px");return A.createElement(P.Layer,L({className:"recharts-errorBar",key:"bar-".concat(v.map(e=>"".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2)))},c),v.map(e=>{var t=n?{transformOrigin:"".concat(e.x1-5,"px")}:void 0;return A.createElement(O.Animate,{from:{transform:"scaleY(0)",transformOrigin:T},to:{transform:"scaleY(1)",transformOrigin:T},begin:s,easing:o,isActive:n,duration:i,key:"line-".concat(e.x1,"-").concat(e.x2,"-").concat(e.y1,"-").concat(e.y2),style:{transformOrigin:T}},A.createElement("line",L({},e,{style:t})))}))});return A.createElement(P.Layer,{className:"recharts-errorBars"},y)}var R=(0,A.createContext)(void 0);function _(e){var{direction:t,children:r}=e;return A.createElement(R.Provider,{value:t},r)}var z={stroke:"black",strokeWidth:1.5,width:5,offset:0,isAnimationActive:!0,animationBegin:0,animationDuration:400,animationEasing:"ease-in-out"};function F(e){var t,r,a=(t=e.direction,r=(0,A.useContext)(R),null!=t?t:null!=r?r:"x"),{width:n,isAnimationActive:s,animationBegin:i,animationDuration:o,animationEasing:l}=(0,B.resolveDefaultProps)(e,z);return A.createElement(A.Fragment,null,A.createElement(E.ReportErrorBarSettings,{dataKey:e.dataKey,direction:a}),A.createElement(T,L({},e,{direction:a,width:n,isAnimationActive:s,animationBegin:i,animationDuration:o,animationEasing:l})))}class U extends A.Component{render(){return A.createElement(F,this.props)}}D(U,"defaultProps",z),D(U,"displayName","ErrorBar");var $=e=>null;$.displayName="Cell";var K=e.i(301426),H=e.i(270627),W=e.i(57216),V=e.i(516257),G=e.i(778979),q=e.i(322258),Y=e.i(355345);function Z(){return(Z=Object.assign.bind()).apply(null,arguments)}var X=(e,t,r,a,n)=>{var s=r-a;return"M ".concat(e,",").concat(t)+"L ".concat(e+r,",").concat(t)+"L ".concat(e+r-s/2,",").concat(t+n)+"L ".concat(e+r-s/2-a,",").concat(t+n)+"L ".concat(e,",").concat(t," Z")}
2,Q={x:0,y:0,upperWidth:0,lowerWidth:0,height:0,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},J=e=>{var t=(0,B.resolveDefaultProps)(e,Q),r=(0,m.useRef)(),[a,n]=(0,m.useState)(-1);(0,m.useEffect)(()=>{if(r.current&&r.current.getTotalLength)try{var e=r.current.getTotalLength();e&&n(e)}catch(e){}},[]);var{x:s,y:i,upperWidth:o,lowerWidth:l,height:c,className:d}=t,{animationEasing:u,animationDuration:p,animationBegin:h,isUpdateAnimationActive:f}=t;if(s!==+s||i!==+i||o!==+o||l!==+l||c!==+c||0===o&&0===l||0===c)return null;var g=(0,N.clsx)("recharts-trapezoid",d);return f?m.createElement(O.Animate,{canBegin:a>0,from:{upperWidth:0,lowerWidth:0,height:c,x:s,y:i},to:{upperWidth:o,lowerWidth:l,height:c,x:s,y:i},duration:p,animationEasing:u,isActive:f},e=>{var{upperWidth:n,lowerWidth:s,height:i,x:o,y:l}=e;return m.createElement(O.Animate,{canBegin:a>0,from:"0px ".concat(-1===a?1:a,"px"),to:"".concat(a,"px 0px"),attributeName:"strokeDasharray",begin:h,duration:p,easing:u},m.createElement("path",Z({},(0,k.filterProps)(t,!0),{className:g,d:X(o,l,n,s,i),ref:r})))}):m.createElement("g",null,m.createElement("path",Z({},(0,k.filterProps)(t,!0),{className:g,d:X(s,i,o,l,c)})))},ee=e.i(896915),et=e.i(285505),er=["option","shapeType","propTransformer","activeClassName","isActive"];function ea(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function en(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ea(Object(r),!0).forEach(function(t){var a,n,s;a=e,n=t,s=r[t],(n=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(n))in a?Object.defineProperty(a,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):a[n]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ea(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function es(e,t){return en(en({},t),e)}function ei(e){var{shapeType:t,elementProps:r}=e;switch(t){case"rectangle":return m.createElement(Y.Rectangle,r);case"trapezoid":return m.createElement(J,r);case"sector":return m.createElement(ee.Sector,r);case"symbols":if("symbols"===t)return m.createElement(et.Symbols,r);break;default:return null}}function eo(e){var t,{option:r,shapeType:a,propTransformer:n=es,activeClassName:s="recharts-active-shape",isActive:i}=e,o=function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r={};for(var a in e)if(({}).hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,er);if((0,m.isValidElement)(r))t=(0,m.cloneElement)(r,en(en({},o),(0,m.isValidElement)(r)?r.props:r));else if("function"==typeof r)t=r(o);else if((0,q.default)(r)&&"boolean"!=typeof r){var l=n(r,o);t=m.createElement(ei,{shapeType:a,elementProps:l})}else t=m.createElement(ei,{shapeType:a,elementProps:o});return i?m.createElement(P.Layer,{className:s},t):t}var el=["x","y"];function ec(){return(ec=Object.assign.bind()).apply(null,arguments)}function ed(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function eu(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ed(Object(r),!0).forEach(function(t){var a,n,s;a=e,n=t,s=r[t],(n=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(n))in a?Object.defineProperty(a,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):a[n]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ed(Object(r)).forEac
2h(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function em(e,t){var{x:r,y:a}=e,n=function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r={};for(var a in e)if(({}).hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,el),s=parseInt("".concat(r),10),i=parseInt("".concat(a),10),o=parseInt("".concat(t.height||n.height),10),l=parseInt("".concat(t.width||n.width),10);return eu(eu(eu(eu(eu({},t),n),s?{x:s}:{}),i?{y:i}:{}),{},{height:o,width:l,name:t.name,radius:t.radius})}function ep(e){return m.createElement(eo,ec({shapeType:"rectangle",propTransformer:em,activeClassName:"recharts-active-bar"},e))}var eh=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0;return(r,a)=>{if((0,H.isNumber)(e))return e;var n=(0,H.isNumber)(r)||(0,H.isNullish)(r);return n?e(r,a):(n||function(e){if(!e)throw Error("Invariant failed")}(!1),t)}},ef=e.i(543372),eg=e.i(134518),ey=(e,t)=>{var r=(0,ef.useAppDispatch)();return(a,n)=>s=>{null==e||e(a,n,s),r((0,eg.setActiveMouseOverItemIndex)({activeIndex:String(n),activeDataKey:t,activeCoordinate:a.tooltipPosition}))}},ex=e=>{var t=(0,ef.useAppDispatch)();return(r,a)=>n=>{null==e||e(r,a,n),t((0,eg.mouseLeaveItem)())}},ev=(e,t)=>{var r=(0,ef.useAppDispatch)();return(a,n)=>s=>{null==e||e(a,n,s),r((0,eg.setActiveClickItemIndex)({activeIndex:String(n),activeDataKey:t,activeCoordinate:a.tooltipPosition}))}},eb=e.i(128002),ew=e.i(120271),ej=()=>{var e=(0,ef.useAppDispatch)();return(0,m.useEffect)(()=>(e((0,ew.addBar)()),()=>{e((0,ew.removeBar)())})),null},eC=e.i(777814),eS=e.i(901841),eN=e.i(451400),eP=e.i(83727),eA=e.i(399479),ek=e.i(868413),eE=e.i(755335),eI=e.i(500678);function eB(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function eO(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?eB(Object(r),!0).forEach(function(t){var a,n,s;a=e,n=t,s=r[t],(n=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(n))in a?Object.defineProperty(a,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):a[n]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eB(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var eM=(e,t,r,a,n)=>n,eD=(e,t,r)=>{var a=null!=r?r:e;if(!(0,H.isNullish)(a))return(0,H.getPercentValue)(a,t,0)},eL=(0,eN.createSelector)([eS.selectChartLayout,eP.selectUnfilteredCartesianItems,(e,t)=>t,(e,t,r)=>r,(e,t,r,a)=>a],(e,t,r,a,n)=>t.filter(t=>"horizontal"===e?t.xAxisId===r:t.yAxisId===a).filter(e=>e.isPanorama===n).filter(e=>!1===e.hide).filter(e=>"bar"===e.type));function eT(e){return null!=e.stackId&&null!=e.dataKey}var eR=(0,eN.createSelector)([eL,eE.selectRootBarSize,(e,t,r)=>"horizontal"===(0,eS.selectChartLayout)(e)?(0,eP.selectCartesianAxisSize)(e,"xAxis",t):(0,eP.selectCartesianAxisSize)(e,"yAxis",r)],(e,t,r)=>{var a=e.filter(eT),n=e.filter(e=>null==e.stackId);return[...Object.entries(a.reduce((e,t)=>(e[t.stackId]||(e[t.stackId]=[]),e[t.stackId].push(t),e),{})).map(e=>{var[a,n]=e;return{stackId:a,dataKeys:n.map(e=>e.dataKey),barSize:eD(t,r,n[0].barSize)}}),...n.map(e=>({stackId:void 0,dataKeys:[e.dataKey].filter(e=>null!=e),barSize:eD(t,r,e.barSize)}))]}),e_=(e,t,r,a)=>{var n,s;return"horizontal"===(0,eS.selectChartLayout)(e)?(n=(0,eP.selectAxisWithScale)(e,"xAxis",t,a),s=(0,eP.selectTicksOfGraphicalItem)(e,"xAxis",t,a)):(n=(0,eP.selectAxisWithScale)(e,"yAxis",r,a),s=(0,eP.selectTicksOfGraphicalItem)(e,"yAxis",r,a)),(0,V.getBandSizeOfAxis)(n,s)},ez=(0,eN.createSelector)([eR,eE.selectRootMaxBarSize,eE.selectBarGap,eE.selectBarCategoryGap,(e,t,r,a,n)=>{var s,i,o,l,c=(0,eS.selectChartLayout)(e),d=(0,eE.selectRootMaxBarSize)(e),{maxBarSize:u}=n,m=(0,H.isNullish)(u)?d:u;return"horizontal"===c?(o=(0,eP.selectAxisWithScale)(e,"xAxis",t,a),l=(0,eP.selectTicksOfGraphicalItem)(e,"xAxis",t,a)):(o=(0,eP.selectAxisWithScale)(e,"yAxis",r,a),l=(0,eP.selectTicksOfGraphicalItem)(e,"yAxis",r,a)),null!=(s=null!=(i=(0,V.getBandSizeOfAxis)(o,l,!0))?i:m)?s:0},e_,(e,t,r,a,n)=>n.maxBarSize],(e,t,r,a,n,s,i)=>{var o=function(e,t,r,a,n){var s,i=a.length;if(!(i<1)){var o=(0,H.getPercentValue)(e,r,0,!0),l=[];
2if((0,eI.isWellBehavedNumber)(a[0].barSize)){var c=!1,d=r/i,u=a.reduce((e,t)=>e+(t.barSize||0),0);(u+=(i-1)*o)>=r&&(u-=(i-1)*o,o=0),u>=r&&d>0&&(c=!0,d*=.9,u=i*d);var m={offset:((r-u)/2|0)-o,size:0};s=a.reduce((e,t)=>{var r,a=[...e,{stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:m.offset+m.size+o,size:c?d:null!=(r=t.barSize)?r:0}}];return m=a[a.length-1].position,a},l)}else{var p=(0,H.getPercentValue)(t,r,0,!0);r-2*p-(i-1)*o<=0&&(o=0);var h=(r-2*p-(i-1)*o)/i;h>1&&(h>>=0);var f=(0,eI.isWellBehavedNumber)(n)?Math.min(h,n):h;s=a.reduce((e,t,r)=>[...e,{stackId:t.stackId,dataKeys:t.dataKeys,position:{offset:p+(h+o)*r+(h-f)/2,size:f}}],l)}return s}}(r,a,n!==s?n:s,e,(0,H.isNullish)(i)?t:i);return n!==s&&null!=o&&(o=o.map(e=>eO(eO({},e),{},{position:eO(eO({},e.position),{},{offset:e.position.offset-n/2})}))),o}),eF=(0,eN.createSelector)([ez,eM],(e,t)=>{if(null!=e){var r=e.find(e=>e.stackId===t.stackId&&e.dataKeys.includes(t.dataKey));if(null!=r)return r.position}}),eU=(0,eN.createSelector)([eP.selectUnfilteredCartesianItems,eM],(e,t)=>{if(e.some(e=>"bar"===e.type&&t.dataKey===e.dataKey&&t.stackId===e.stackId&&t.stackId===e.stackId))return t}),e$=(0,eN.createSelector)([(e,t,r,a)=>"horizontal"===(0,eS.selectChartLayout)(e)?(0,eP.selectStackGroups)(e,"yAxis",r,a):(0,eP.selectStackGroups)(e,"xAxis",t,a),eM],(e,t)=>{if(!e||(null==t?void 0:t.dataKey)==null)return;var{stackId:r}=t;if(null!=r){var a=e[r];if(a){var{stackedData:n}=a;if(n)return n.find(e=>e.key===t.dataKey)}}}),eK=(0,eN.createSelector)([ek.selectChartOffsetInternal,(e,t,r,a)=>(0,eP.selectAxisWithScale)(e,"xAxis",t,a),(e,t,r,a)=>(0,eP.selectAxisWithScale)(e,"yAxis",r,a),(e,t,r,a)=>(0,eP.selectTicksOfGraphicalItem)(e,"xAxis",t,a),(e,t,r,a)=>(0,eP.selectTicksOfGraphicalItem)(e,"yAxis",r,a),eF,eS.selectChartLayout,eA.selectChartDataWithIndexesIfNotInPanorama,e_,e$,eU,(e,t,r,a,n,s)=>s],(e,t,r,a,n,s,i,o,l,c,d,u)=>{var m,{chartData:p,dataStartIndex:h,dataEndIndex:f}=o;if(null!=d&&null!=s&&("horizontal"===i||"vertical"===i)&&null!=t&&null!=r&&null!=a&&null!=n&&null!=l){var{data:g}=d;if(null!=(m=null!=g&&g.length>0?g:null==p?void 0:p.slice(h,f+1)))return function(e){var{layout:t,barSettings:{dataKey:r,minPointSize:a},pos:n,bandSize:s,xAxis:i,yAxis:o,xAxisTicks:l,yAxisTicks:c,stackedData:d,displayedData:u,offset:m,cells:p}=e,h="horizontal"===t?o:i,f=d?h.scale.domain():null,g=(0,V.getBaseValueOfBar)({numericAxis:h});return u.map((e,u)=>{d?y=(0,V.truncateByDomain)(d[u],f):Array.isArray(y=(0,V.getValueByDataKey)(e,r))||(y=[g,y]);var h=eh(a,0)(y[1],u);if("horizontal"===t){var y,x,v,b,w,j,C,[S,N]=[o.scale(y[0]),o.scale(y[1])];x=(0,V.getCateCoordinateOfBar)({axis:i,ticks:l,bandSize:s,offset:n.offset,entry:e,index:u}),v=null!=(C=null!=N?N:S)?C:void 0,b=n.size;var P=S-N;if(w=(0,H.isNan)(P)?0:P,j={x,y:m.top,width:b,height:m.height},Math.abs(h)>0&&Math.abs(w)<Math.abs(h)){var A=(0,H.mathSign)(w||h)*(Math.abs(h)-Math.abs(w));v-=A,w+=A}}else{var[k,E]=[i.scale(y[0]),i.scale(y[1])];if(x=k,v=(0,V.getCateCoordinateOfBar)({axis:o,ticks:c,bandSize:s,offset:n.offset,entry:e,index:u}),b=E-k,w=n.size,j={x:m.left,y:v,width:m.width,height:w},Math.abs(h)>0&&Math.abs(b)<Math.abs(h)){var I=(0,H.mathSign)(b||h)*(Math.abs(h)-Math.abs(b));b+=I}}return eJ(eJ({},e),{},{x,y:v,width:b,height:w,value:d?y:y[1],payload:e,background:j,tooltipPosition:{x:x+b/2,y:v+w/2}},p&&p[u]&&p[u].props)})}({layout:i,barSettings:d,pos:s,bandSize:l,xAxis:t,yAxis:r,xAxisTicks:a,yAxisTicks:n,stackedData:c,displayedData:m,offset:e,cells:u})}}),eH=e.i(662688),eW=e.i(281695),eV=e.i(836094),eG=e.i(266719),eq=["onMouseEnter","onMouseLeave","onClick"],eY=["value","background","tooltipPosition"],eZ=["onMouseEnter","onClick","onMouseLeave"];function eX(){return(eX=Object.assign.bind()).apply(null,arguments)}function eQ(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function eJ(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
2t%2?eQ(Object(r),!0).forEach(function(t){e0(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):eQ(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function e0(e,t,r){var a;return(t="symbol"==typeof(a=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?a:a+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function e1(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r={};for(var a in e)if(({}).hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function e2(e){var{dataKey:t,stroke:r,strokeWidth:a,fill:n,name:s,hide:i,unit:o}=e;return{dataDefinedOnItem:void 0,positions:void 0,settings:{stroke:r,strokeWidth:a,fill:n,dataKey:t,nameKey:void 0,name:(0,V.getTooltipNameProp)(s,t),hide:i,type:e.tooltipType,color:e.fill,unit:o}}}function e5(e){var t=(0,ef.useAppSelector)(eW.selectActiveTooltipIndex),{data:r,dataKey:a,background:n,allOtherBarProps:s}=e,{onMouseEnter:i,onMouseLeave:o,onClick:l}=s,c=e1(s,eq),d=ey(i,a),u=ex(o),m=ev(l,a);if(!n||null==r)return null;var p=(0,k.filterProps)(n,!1);return S.createElement(S.Fragment,null,r.map((e,r)=>{var{value:s,background:i,tooltipPosition:o}=e,l=e1(e,eY);if(!i)return null;var h=d(e,r),f=u(e,r),g=m(e,r),y=eJ(eJ(eJ(eJ(eJ({option:n,isActive:String(r)===t},l),{},{fill:"#eee"},i),p),(0,G.adaptEventsOfChild)(c,e,r)),{},{onMouseEnter:h,onMouseLeave:f,onClick:g,dataKey:a,index:r,className:"recharts-bar-background-rectangle"});return S.createElement(ep,eX({key:"background-bar-".concat(r)},y))}))}function e3(e){var{data:t,props:r,showLabels:a}=e,n=(0,k.filterProps)(r,!1),{shape:s,dataKey:i,activeBar:o}=r,l=(0,ef.useAppSelector)(eW.selectActiveTooltipIndex),c=(0,ef.useAppSelector)(eW.selectActiveTooltipDataKey),{onMouseEnter:d,onClick:u,onMouseLeave:m}=r,p=e1(r,eZ),h=ey(d,i),f=ex(m),g=ev(u,i);return t?S.createElement(S.Fragment,null,t.map((e,t)=>{var r=o&&String(t)===l&&(null==c||i===c),a=eJ(eJ(eJ({},n),e),{},{isActive:r,option:r?o:s,index:t,dataKey:i});return S.createElement(P.Layer,eX({className:"recharts-bar-rectangle"},(0,G.adaptEventsOfChild)(p,e,t),{onMouseEnter:h(e,t),onMouseLeave:f(e,t),onClick:g(e,t),key:"rectangle-".concat(null==e?void 0:e.x,"-").concat(null==e?void 0:e.y,"-").concat(null==e?void 0:e.value,"-").concat(t)}),S.createElement(ep,a))}),a&&K.LabelList.renderCallByParent(r,t)):null}function e6(e){var{props:t,previousRectanglesRef:r}=e,{data:a,layout:n,isAnimationActive:s,animationBegin:i,animationDuration:o,animationEasing:l,onAnimationEnd:c,onAnimationStart:d}=t,u=r.current,m=(0,eG.useAnimationId)(t,"recharts-bar-"),[p,h]=(0,S.useState)(!1),f=(0,S.useCallback)(()=>{"function"==typeof c&&c(),h(!1)},[c]),g=(0,S.useCallback)(()=>{"function"==typeof d&&d(),h(!0)},[d]);return S.createElement(O.Animate,{begin:i,duration:o,isActive:s,easing:l,from:{t:0},to:{t:1},onAnimationEnd:f,onAnimationStart:g,key:m},e=>{var{t:s}=e,i=1===s?a:a.map((e,t)=>{var r=u&&u[t];if(r){var a=(0,H.interpolateNumber)(r.x,e.x),i=(0,H.interpolateNumber)(r.y,e.y),o=(0,H.interpolateNumber)(r.width,e.width),l=(0,H.interpolateNumber)(r.height,e.height);return eJ(eJ({},e),{},{x:a(s),y:i(s),width:o(s),height:l(s)})}if("horizontal"===n){var c=(0,H.interpolateNumber)(0,e.height)(s);return eJ(eJ({},e),{},{y:e.y+e.height-c,height:c})}var d=(0,H.interpolateNumber)(0,e.width)(s);return eJ(eJ({},e),{},{width:d})});return s>0&&(r.current=i),S.createElement(P.Layer,null,S.createElement(e3,{props:t,data:i,showLabels:!p}))})}function e4(e){var{data:t,isAnimationActive:r}=e,a=(0,S.useRef)(null);return r&&t&&t.length&&(null==a.current||a.current!==t)?S.createElement(e6,{previousRectanglesRef:a,props:e}):S.createElement(e3,{props:e,data:t,showLabels:!0})}var e7=(e,t)=>{var r=Array.isArray(e.value)?e.value[1]:e.value;return{x:e.x,y:e.y,value:r,errorVal:(0,V.getValueByDataKey)(e,t)}};class e8 extends S.PureComponent{constructor(){super(...arguments),e0(this,"id",(0,H.uniqueId)("recharts-bar-"))}render(){var{hide:e,data:t,dataKey:r,className:a,xAxisId:n,yAxisId:s,needClip:i,background:o,id:l,layout:c}=this.props;if(e)return null;var d=(0,N.clsx)("recharts-bar",a),u=(0,H.isNullish)(l)?this.id:l;return S.createElement(P.Layer,{className:d},i&&S.createElement("defs",null,S.createElement(eC.GraphicalItemClipPath,{clipPathId:u,xAxisId:n,yAxisId:s})),S.createElement(P.Layer,{className:"recharts-bar-rectangles",clipPath:i?"url(#clipPath-".concat(u,")"):null},S.createElement(e5,{data:t,dataKey:r,background:o,allOtherBarProps:this.props}),S.createElement(e4,this.props)),S.createElement(_,{direction:"horizontal"===c?"y":"x"},this.props.children))}}var e9={activeBar:!1,animationBegin:0,animationDuration:400,animationEasing:"ease",hide:!1,isAnimationActive:!W.Global.isSsr,legendType:"rect",minPointSize:0,xAxisId:0,yAxisId:0};
2function te(e){var t,{xAxisId:r,yAxisId:a,hide:n,legendType:s,minPointSize:i,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:d,isAnimationActive:u}=(0,B.resolveDefaultProps)(e,e9),{needClip:m}=(0,eC.useNeedsClip)(r,a),p=(0,eS.useChartLayout)(),h=(0,eH.useIsPanorama)(),f=(0,S.useMemo)(()=>({barSize:e.barSize,data:void 0,dataKey:e.dataKey,maxBarSize:e.maxBarSize,minPointSize:i,stackId:(0,V.getNormalizedStackId)(e.stackId)}),[e.barSize,e.dataKey,e.maxBarSize,i,e.stackId]),g=(0,k.findAllByType)(e.children,$),y=(0,ef.useAppSelector)(e=>eK(e,r,a,h,f,g));if("vertical"!==p&&"horizontal"!==p)return null;var x=null==y?void 0:y[0];return t=null==x||null==x.height||null==x.width?0:"vertical"===p?x.height/2:x.width/2,S.createElement(E.SetErrorBarContext,{xAxisId:r,yAxisId:a,data:y,dataPointFormatter:e7,errorBarOffset:t},S.createElement(e8,eX({},e,{layout:p,needClip:m,data:y,xAxisId:r,yAxisId:a,hide:n,legendType:s,minPointSize:i,activeBar:o,animationBegin:l,animationDuration:c,animationEasing:d,isAnimationActive:u})))}class tt extends S.PureComponent{render(){return S.createElement(E.CartesianGraphicalItemContext,{type:"bar",data:null,xAxisId:this.props.xAxisId,yAxisId:this.props.yAxisId,zAxisId:0,dataKey:this.props.dataKey,stackId:this.props.stackId,hide:this.props.hide,barSize:this.props.barSize},S.createElement(ej,null),S.createElement(eV.SetLegendPayload,{legendPayload:(e=>{var{dataKey:t,name:r,fill:a,legendType:n,hide:s}=e;return[{inactive:s,dataKey:t,type:n,color:a,value:(0,V.getTooltipNameProp)(r,t),payload:e}]})(this.props)}),S.createElement(eb.SetTooltipEntrySettings,{fn:e2,args:this.props}),S.createElement(te,this.props))}}e0(tt,"displayName","Bar"),e0(tt,"defaultProps",e9);var tr=e.i(723375),ta=e.i(437515),tn=["axis","item"],ts=(0,m.forwardRef)((e,t)=>m.createElement(ta.CartesianChart,{chartName:"BarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:tn,tooltipPayloadSearcher:tr.arrayTooltipSearcher,categoricalChartProps:e,ref:t})),ti=e.i(526626),to=e.i(881264),tl=m,tc=e.i(366998),td=e.i(328233),tu=e.i(482593),tm=(e,t,r,a)=>(0,eP.selectAxisWithScale)(e,"xAxis",t,a),tp=(e,t,r,a)=>(0,eP.selectTicksOfGraphicalItem)(e,"xAxis",t,a),th=(e,t,r,a)=>(0,eP.selectAxisWithScale)(e,"yAxis",r,a),tf=(e,t,r,a)=>(0,eP.selectTicksOfGraphicalItem)(e,"yAxis",r,a),tg=(0,eN.createSelector)([eS.selectChartLayout,tm,th,tp,tf],(e,t,r,a,n)=>(0,V.isCategoricalAxis)(e,"xAxis")?(0,V.getBandSizeOfAxis)(t,a,!1):(0,V.getBandSizeOfAxis)(r,n,!1)),ty=(0,eN.createSelector)([eP.selectUnfilteredCartesianItems,(e,t,r,a,n)=>n],(e,t)=>{if(e.some(e=>"line"===e.type&&t.dataKey===e.dataKey&&t.data===e.data))return t}),tx=(0,eN.createSelector)([eS.selectChartLayout,tm,th,tp,tf,ty,tg,eA.selectChartDataWithIndexesIfNotInPanorama],(e,t,r,a,n,s,i,o)=>{var l,{chartData:c,dataStartIndex:d,dataEndIndex:u}=o;if(null!=s&&null!=t&&null!=r&&null!=a&&null!=n&&0!==a.length&&0!==n.length&&null!=i){var{dataKey:m,data:p}=s;if(null!=(l=null!=p&&p.length>0?p:null==c?void 0:c.slice(d,u+1)))return function(e){var{layout:t,xAxis:r,yAxis:a,xAxisTicks:n,yAxisTicks:s,dataKey:i,bandSize:o,displayedData:l}=e;return l.map((e,l)=>{var c=(0,V.getValueByDataKey)(e,i);return"horizontal"===t?{x:(0,V.getCateCoordinateOfLine)({axis:r,ticks:n,bandSize:o,entry:e,index:l}),y:(0,H.isNullish)(c)?null:a.scale(c),value:c,payload:e}:{x:(0,H.isNullish)(c)?null:r.scale(c),y:(0,V.getCateCoordinateOfLine)({axis:a,ticks:s,bandSize:o,entry:e,index:l}),value:c,payload:e}})}({layout:e,xAxis:t,yAxis:r,xAxisTicks:a,yAxisTicks:n,dataKey:m,bandSize:i,displayedData:l})}}),tv=["type","layout","connectNulls","needClip"],tb=["activeDot","animateNewValues","animationBegin","animationDuration","animationEasing","connectNulls","dot","hide","isAnimationActive","label","legendType","xAxisId","yAxisId"];function tw(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r={};for(var a in e)if(({}).hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function tj(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function tC(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
2t%2?tj(Object(r),!0).forEach(function(t){tS(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):tj(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function tS(e,t,r){var a;return(t="symbol"==typeof(a=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?a:a+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function tN(){return(tN=Object.assign.bind()).apply(null,arguments)}function tP(e){var{dataKey:t,data:r,stroke:a,strokeWidth:n,fill:s,name:i,hide:o,unit:l}=e;return{dataDefinedOnItem:r,positions:void 0,settings:{stroke:a,strokeWidth:n,fill:s,dataKey:t,nameKey:void 0,name:(0,V.getTooltipNameProp)(i,t),hide:o,type:e.tooltipType,color:e.stroke,unit:l}}}var tA=(e,t)=>"".concat(t,"px ").concat(e-t,"px");function tk(e){var{clipPathId:t,points:r,props:a}=e,{dot:n,dataKey:s,needClip:i}=a;if(null==r||!n&&1!==r.length)return null;var o=(0,k.isClipDot)(n),l=(0,k.filterProps)(a,!1),c=(0,k.filterProps)(n,!0),d=r.map((e,t)=>{var a,i=tC(tC(tC({key:"dot-".concat(t),r:3},l),c),{},{index:t,cx:e.x,cy:e.y,dataKey:s,value:e.value,payload:e.payload,points:r});if(tl.isValidElement(n))a=tl.cloneElement(n,i);else if("function"==typeof n)a=n(i);else{var o=(0,N.clsx)("recharts-line-dot","boolean"!=typeof n?n.className:"");a=tl.createElement(td.Dot,tN({},i,{className:o}))}return a}),u={clipPath:i?"url(#clipPath-".concat(o?"":"dots-").concat(t,")"):null};return tl.createElement(P.Layer,tN({className:"recharts-line-dots",key:"dots"},u),d)}function tE(e){var{clipPathId:t,pathRef:r,points:a,strokeDasharray:n,props:s,showLabels:i}=e,{type:o,layout:l,connectNulls:c,needClip:d}=s,u=tw(s,tv),m=tC(tC({},(0,k.filterProps)(u,!0)),{},{fill:"none",className:"recharts-line-curve",clipPath:d?"url(#clipPath-".concat(t,")"):null,points:a,type:o,layout:l,connectNulls:c,strokeDasharray:null!=n?n:s.strokeDasharray});return tl.createElement(tl.Fragment,null,(null==a?void 0:a.length)>1&&tl.createElement(tc.Curve,tN({},m,{pathRef:r})),tl.createElement(tk,{points:a,clipPathId:t,props:s}),i&&K.LabelList.renderCallByParent(s,a))}function tI(e){var{clipPathId:t,props:r,pathRef:a,previousPointsRef:n,longestAnimatedLengthRef:s}=e,{points:i,strokeDasharray:o,isAnimationActive:l,animationBegin:c,animationDuration:d,animationEasing:u,animateNewValues:m,width:p,height:h,onAnimationEnd:f,onAnimationStart:g}=r,y=n.current,x=(0,eG.useAnimationId)(r,"recharts-line-"),[v,b]=(0,tl.useState)(!1),w=(0,tl.useCallback)(()=>{"function"==typeof f&&f(),b(!1)},[f]),j=(0,tl.useCallback)(()=>{"function"==typeof g&&g(),b(!0)},[g]),C=function(e){try{return e&&e.getTotalLength&&e.getTotalLength()||0}catch(e){return 0}}(a.current),S=s.current;return tl.createElement(O.Animate,{begin:c,duration:d,isActive:l,easing:u,from:{t:0},to:{t:1},onAnimationEnd:w,onAnimationStart:j,key:x},e=>{var l,{t:c}=e,d=Math.min((0,H.interpolateNumber)(S,C+S)(c),C);if(l=o?((e,t,r)=>{var a=r.reduce((e,t)=>e+t);if(!a)return tA(t,e);for(var n=Math.floor(e/a),s=e%a,i=t-e,o=[],l=0,c=0;l<r.length;c+=r[l],++l)if(c+r[l]>s){o=[...r.slice(0,l),s-c];break}var d=o.length%2==0?[0,i]:[i];return[...function(e,t){for(var r=e.length%2!=0?[...e,0]:e,a=[],n=0;n<t;++n)a=[...a,...r];return a}(r,n),...o,...d].map(e=>"".concat(e,"px")).join(", ")})(d,C,"".concat(o).split(/[,\s]+/gim).map(e=>parseFloat(e))):tA(C,d),y){var u=y.length/i.length,f=1===c?i:i.map((e,t)=>{var r=Math.floor(t*u);if(y[r]){var a=y[r],n=(0,H.interpolateNumber)(a.x,e.x),s=(0,H.interpolateNumber)(a.y,e.y);return tC(tC({},e),{},{x:n(c),y:s(c)})}if(m){var i=(0,H.interpolateNumber)(2*p,e.x),o=(0,H.interpolateNumber)(h/2,e.y);return tC(tC({},e),{},{x:i(c),y:o(c)})}return tC(tC({},e),{},{x:e.x,y:e.y})});return n.current=f,tl.createElement(tE,{props:r,points:f,clipPathId:t,pathRef:a,showLabels:!v,strokeDasharray:l})}return c>0&&C>0&&(n.current=i,s.current=d),tl.createElement(tE,{props:r,points:i,clipPathId:t,pathRef:a,showLabels:!v,strokeDasharray:l})})}function tB(e){var{clipPathId:t,props:r}
2=e,{points:a,isAnimationActive:n}=r,s=(0,tl.useRef)(null),i=(0,tl.useRef)(0),o=(0,tl.useRef)(null),l=s.current;return n&&a&&a.length&&l!==a?tl.createElement(tI,{props:r,clipPathId:t,previousPointsRef:s,longestAnimatedLengthRef:i,pathRef:o}):tl.createElement(tE,{props:r,points:a,clipPathId:t,pathRef:o,showLabels:!0})}var tO=(e,t)=>({x:e.x,y:e.y,value:e.value,errorVal:(0,V.getValueByDataKey)(e.payload,t)});class tM extends tl.Component{constructor(){super(...arguments),tS(this,"id",(0,H.uniqueId)("recharts-line-"))}render(){var e,{hide:t,dot:r,points:a,className:n,xAxisId:s,yAxisId:i,top:o,left:l,width:c,height:d,id:u,needClip:m,layout:p}=this.props;if(t)return null;var h=(0,N.clsx)("recharts-line",n),f=(0,H.isNullish)(u)?this.id:u,{r:g=3,strokeWidth:y=2}=null!=(e=(0,k.filterProps)(r,!1))?e:{r:3,strokeWidth:2},x=(0,k.isClipDot)(r),v=2*g+y;return tl.createElement(tl.Fragment,null,tl.createElement(P.Layer,{className:h},m&&tl.createElement("defs",null,tl.createElement(eC.GraphicalItemClipPath,{clipPathId:f,xAxisId:s,yAxisId:i}),!x&&tl.createElement("clipPath",{id:"clipPath-dots-".concat(f)},tl.createElement("rect",{x:l-v/2,y:o-v/2,width:c+v,height:d+v}))),tl.createElement(tB,{props:this.props,clipPathId:f}),tl.createElement(_,{direction:"horizontal"===p?"y":"x"},tl.createElement(E.SetErrorBarContext,{xAxisId:s,yAxisId:i,data:a,dataPointFormatter:tO,errorBarOffset:0},this.props.children))),tl.createElement(tu.ActivePoints,{activeDot:this.props.activeDot,points:a,mainColor:this.props.stroke,itemDataKey:this.props.dataKey}))}}var tD={activeDot:!0,animateNewValues:!0,animationBegin:0,animationDuration:1500,animationEasing:"ease",connectNulls:!1,dot:!0,fill:"#fff",hide:!1,isAnimationActive:!W.Global.isSsr,label:!1,legendType:"line",stroke:"#3182bd",strokeWidth:1,xAxisId:0,yAxisId:0};function tL(e){var t=(0,B.resolveDefaultProps)(e,tD),{activeDot:r,animateNewValues:a,animationBegin:n,animationDuration:s,animationEasing:i,connectNulls:o,dot:l,hide:c,isAnimationActive:d,label:u,legendType:m,xAxisId:p,yAxisId:h}=t,f=tw(t,tb),{needClip:g}=(0,eC.useNeedsClip)(p,h),{height:y,width:x,x:v,y:b}=(0,I.usePlotArea)(),w=(0,eS.useChartLayout)(),j=(0,eH.useIsPanorama)(),C=(0,tl.useMemo)(()=>({dataKey:e.dataKey,data:e.data}),[e.dataKey,e.data]),S=(0,ef.useAppSelector)(e=>tx(e,p,h,j,C));return"horizontal"!==w&&"vertical"!==w?null:tl.createElement(tM,tN({},f,{connectNulls:o,dot:l,activeDot:r,animateNewValues:a,animationBegin:n,animationDuration:s,animationEasing:i,isAnimationActive:d,hide:c,label:u,legendType:m,xAxisId:p,yAxisId:h,points:S,layout:w,height:y,width:x,left:v,top:b,needClip:g}))}class tT extends tl.PureComponent{render(){return tl.createElement(E.CartesianGraphicalItemContext,{type:"line",data:this.props.data,xAxisId:this.props.xAxisId,yAxisId:this.props.yAxisId,zAxisId:0,dataKey:this.props.dataKey,stackId:void 0,hide:this.props.hide,barSize:void 0},tl.createElement(eV.SetLegendPayload,{legendPayload:(e=>{var{dataKey:t,name:r,stroke:a,legendType:n,hide:s}=e;return[{inactive:s,dataKey:t,type:n,color:a,value:(0,V.getTooltipNameProp)(r,t),payload:e}]})(this.props)}),tl.createElement(eb.SetTooltipEntrySettings,{fn:tP,args:this.props}),tl.createElement(tL,this.props))}}tS(tT,"displayName","Line"),tS(tT,"defaultProps",tD);var tR=["axis"],t_=(0,m.forwardRef)((e,t)=>m.createElement(ta.CartesianChart,{chartName:"LineChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:tR,tooltipPayloadSearcher:tr.arrayTooltipSearcher,categoricalChartProps:e,ref:t})),tz=m,tF=e.i(449691),tU=e.i(708248),t$=e.i(349229),tK=e=>e.graphicalItems.polarItems,tH=(0,eN.createSelector)([tU.pickAxisType,t$.pickAxisId],eP.itemAxisPredicate),tW=(0,eN.createSelector)([tK,eP.selectBaseAxis,tH],eP.combineGraphicalItemsSettings),tV=(0,eN.createSelector)([tW],eP.combineGraphicalItemsData),tG=(0,eN.createSelector)([tV,eA.selectChartDataAndAlwaysIgnoreIndexes],eP.combineDisplayedData),tq=(0,eN.createSelector)([tG,eP.selectBaseAxis,tW],eP.combineAppliedValues),tY=(0,eN.createSelector)([tG,eP.selectBaseAxis,tW],(e,t,r)=>r.length>0?e.flatMap(e=>r.flatMap(r=>{var a;return{value:(0,V.getValueByDataKey)(e,null!=(a=t.dataKey)?a:r.dataKey),errorDomain:[]}}
2)).filter(Boolean):(null==t?void 0:t.dataKey)!=null?e.map(e=>({value:(0,V.getValueByDataKey)(e,t.dataKey),errorDomain:[]})):e.map(e=>({value:e,errorDomain:[]}))),tZ=()=>void 0,tX=(0,eN.createSelector)([eP.selectBaseAxis,eP.selectDomainDefinition,tZ,tY,tZ],eP.combineNumericalDomain),tQ=(0,eN.createSelector)([eP.selectBaseAxis,eS.selectChartLayout,tG,tq,eE.selectStackOffsetType,tU.pickAxisType,tX],eP.combineAxisDomain),tJ=(0,eN.createSelector)([tQ,eP.selectBaseAxis,eP.selectRealScaleType],eP.combineNiceTicks),t0=(0,eN.createSelector)([eP.selectBaseAxis,tQ,tJ,tU.pickAxisType],eP.combineAxisDomainWithNiceTicks);function t1(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function t2(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?t1(Object(r),!0).forEach(function(t){var a,n,s;a=e,n=t,s=r[t],(n=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(n))in a?Object.defineProperty(a,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):a[n]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):t1(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var t5=(e,t)=>t,t3=[],t6=(e,t,r)=>(null==r?void 0:r.length)===0?t3:r,t4=(0,eN.createSelector)([eA.selectChartDataAndAlwaysIgnoreIndexes,t5,t6],(e,t,r)=>{var a,{chartData:n}=e;if((a=(null==t?void 0:t.data)!=null&&t.data.length>0?t.data:n)&&a.length||null==r||(a=r.map(e=>t2(t2({},t.presentationProps),e.props))),null!=a)return a}),t7=(0,eN.createSelector)([t4,t5,t6],(e,t,r)=>{if(null!=e)return e.map((e,a)=>{var n,s,i=(0,V.getValueByDataKey)(e,t.nameKey,t.name);return s=null!=r&&null!=(n=r[a])&&null!=(n=n.props)&&n.fill?r[a].props.fill:"object"==typeof e&&null!=e&&"fill"in e?e.fill:t.fill,{value:(0,V.getTooltipNameProp)(i,t.dataKey),color:s,payload:e,type:t.legendType}})}),t8=(0,eN.createSelector)([tK,t5],(e,t)=>{if(e.some(e=>"pie"===e.type&&t.dataKey===e.dataKey&&t.data===e.data))return t}),t9=(0,eN.createSelector)([t4,t8,t6,ek.selectChartOffsetInternal],(e,t,r,a)=>{if(null!=t&&null!=e)return function(e){var t,r,a,{pieSettings:n,displayedData:s,cells:i,offset:o}=e,{cornerRadius:l,startAngle:c,endAngle:d,dataKey:u,nameKey:m,tooltipType:p}=n,h=Math.abs(n.minAngle),f=(0,H.mathSign)(d-c)*Math.min(Math.abs(d-c),360),g=Math.abs(f),y=s.length<=1?0:null!=(t=n.paddingAngle)?t:0,x=s.filter(e=>0!==(0,V.getValueByDataKey)(e,u,0)).length,v=g-x*h-(g>=360?x:x-1)*y,b=s.reduce((e,t)=>{var r=(0,V.getValueByDataKey)(t,u,0);return e+((0,H.isNumber)(r)?r:0)},0);return b>0&&(r=s.map((e,t)=>{var r,s=(0,V.getValueByDataKey)(e,u,0),d=(0,V.getValueByDataKey)(e,m,t),g=((e,t,r)=>{var a,{top:n,left:s,width:i,height:o}=t,l=(0,rr.getMaxRadius)(i,o),c=s+(0,H.getPercentValue)(e.cx,i,i/2),d=n+(0,H.getPercentValue)(e.cy,o,o/2),u=(0,H.getPercentValue)(e.innerRadius,l,0);return{cx:c,cy:d,innerRadius:u,outerRadius:(a=e.outerRadius,"function"==typeof a?a(r):(0,H.getPercentValue)(a,l,.8*l)),maxRadius:e.maxRadius||Math.sqrt(i*i+o*o)/2}})(n,o,e),x=((0,H.isNumber)(s)?s:0)/b,w=ri(ri({},e),i&&i[t]&&i[t].props),j=(r=t?a.endAngle+(0,H.mathSign)(f)*y*(0!==s):c)+(0,H.mathSign)(f)*((0!==s?h:0)+x*v),C=(r+j)/2,S=(g.innerRadius+g.outerRadius)/2,N=[{name:d,value:s,payload:w,dataKey:u,type:p}],P=(0,rr.polarToCartesian)(g.cx,g.cy,S,C);return a=ri(ri(ri(ri({},n.presentationProps),{},{percent:x,cornerRadius:l,name:d,tooltipPayload:N,midAngle:C,middleRadius:S,tooltipPosition:P},w),g),{},{value:(0,V.getValueByDataKey)(e,u),startAngle:r,endAngle:j,payload:w,paddingAngle:(0,H.mathSign)(f)*y})})),r}({offset:a,pieSettings:t,displayedData:e,cells:r})}),re=e.i(436323),rt=e.i(61320),rr=e.i(193555),ra=e.i(258111),rn=["onMouseEnter","onClick","onMouseLeave"];function rs(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function ri(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
2t%2?rs(Object(r),!0).forEach(function(t){ro(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rs(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function ro(e,t,r){var a;return(t="symbol"==typeof(a=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?a:a+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function rl(){return(rl=Object.assign.bind()).apply(null,arguments)}function rc(e){var t=(0,tz.useMemo)(()=>(0,k.filterProps)(e,!1),[e]),r=(0,tz.useMemo)(()=>(0,k.findAllByType)(e.children,$),[e.children]),a=(0,tz.useMemo)(()=>({name:e.name,nameKey:e.nameKey,tooltipType:e.tooltipType,data:e.data,dataKey:e.dataKey,cx:e.cx,cy:e.cy,startAngle:e.startAngle,endAngle:e.endAngle,minAngle:e.minAngle,paddingAngle:e.paddingAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,cornerRadius:e.cornerRadius,legendT
2ype:e.legendType,fill:e.fill,presentationProps:t}),[e.cornerRadius,e.cx,e.cy,e.data,e.dataKey,e.endAngle,e.innerRadius,e.minAngle,e.name,e.nameKey,e.outerRadius,e.paddingAngle,e.startAngle,e.tooltipType,e.legendType,e.fill,t]),n=(0,ef.useAppSelector)(e=>t7(e,a,r));return tz.createElement(eV.SetPolarLegendPayload,{legendPayload:n})}function rd(e){var{dataKey:t,nameKey:r,sectors:a,stroke:n,strokeWidth:s,fill:i,name:o,hide:l,tooltipType:c}=e;return{dataDefinedOnItem:null==a?void 0:a.map(e=>e.tooltipPayload),positions:null==a?void 0:a.map(e=>e.tooltipPosition),settings:{stroke:n,strokeWidth:s,fill:i,dataKey:t,nameKey:r,name:(0,V.getTooltipNameProp)(o,t),hide:l,type:c,color:i,unit:""}}}function ru(e){var{sectors:t,props:r,showLabels:a}=e,{label:n,labelLine:s,dataKey:i}=r;if(!a||!n||!t)return null;var o=(0,k.filterProps)(r,!1),l=(0,k.filterProps)(n,!1),c=(0,k.filterProps)(s,!1),d="object"==typeof n&&"offsetRadius"in n&&n.offsetRadius||20,u=t.map((e,t)=>{var r,a,u=(e.startAngle+e.endAngle)/2,m=(0,rr.polarToCartesian)(e.cx,e.cy,e.outerRadius+d,u),p=ri(ri(ri(ri({},o),e),{},{stroke:"none"},l),{},{index:t,textAnchor:(r=m.x)>(a=e.cx)?"start":r<a?"end":"middle"},m),h=ri(ri(ri(ri({},o),e),{},{fill:"none",stroke:e.fill},c),{},{index:t,points:[(0,rr.polarToCartesian)(e.cx,e.cy,e.outerRadius,u),m],key:"line"});return tz.createElement(P.Layer,{key:"label-".concat(e.startAngle,"-").concat(e.endAngle,"-").concat(e.midAngle,"-").concat(t)},s&&((e,t)=>{if(tz.isValidElement(e))return tz.cloneElement(e,t);if("function"==typeof e)return e(t);var r=(0,N.clsx)("recharts-pie-label-line","boolean"!=typeof e?e.className:"");return tz.createElement(tc.Curve,rl({},t,{type:"linear",className:r}))})(s,h),((e,t,r)=>{if(tz.isValidElement(e))return tz.cloneElement(e,t);var a=r;if("function"==typeof e&&(a=e(t),tz.isValidElement(a)))return a;var n=(0,N.clsx)("recharts-pie-label-text","boolean"!=typeof e&&"function"!=typeof e?e.className:"");return tz.createElement(rt.Text,rl({},t,{alignmentBaseline:"middle",className:n}),a)})(n,p,(0,V.getValueByDataKey)(e,i)))});return tz.createElement(P.Layer,{className:"recharts-pie-labels"},u)}function rm(e){var{sectors:t,activeShape:r,inactiveShape:a,allOtherPieProps:n,showLabels:s}=e,i=(0,ef.useAppSelector)(eW.selectActiveTooltipIndex),{onMouseEnter:o,onClick:l,onMouseLeave:c}=n,d=function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r={};for(var a in e)if(({}).hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(n,rn),u=ey(o,n.dataKey),m=ex(c),p=ev(l,n.dataKey);return null==t?null:tz.createElement(tz.Fragment,null,t.map((e,s)=>{if((null==e?void 0:e.startAngle)===0&&(null==e?void 0:e.endAngle)===0&&1!==t.length)return null;var o=r&&String(s)===i,l=o?r:i?a:null,c=ri(ri({},e),{},{stroke:e.stroke,tabIndex:-1,[ra.DATA_ITEM_INDEX_ATTRIBUTE_NAME]:s,[ra.DATA_ITEM_DATAKEY_ATTRIBUTE_NAME]:n.dataKey});return tz.createElement(P.Layer,rl({tabIndex:-1,className:"recharts-pie-sector"},(0,G.adaptEventsOfChild)(d,e,s),{onMouseEnter:u(e,s),onMouseLeave:m(e,s),onClick:p(e,s),key:"sector-".concat(null==e?void 0:e.startAngle,"-").concat(null==e?void 0:e.endAngle,"-").concat(e.midAngle,"-").concat(s)}),tz.createElement(eo,rl({option:l,isActive:o,shapeType:"sector"},c)))}),tz.createElement(ru,{sectors:t,props:n,showLabels:s}))}function rp(e){var{props:t,previousSectorsRef:r}=e,{sectors:a,isAnimationActive:n,animationBegin:s,animationDuration:i,animationEasing:o,activeShape:l,inactiveShape:c,onAnimationStart:d,onAnimationEnd:u}=t,m=(0,eG.useAnimationId)(t,"recharts-pie-"),p=r.current,[h,f]=(0,tz.useState)(!0),g=(0,tz.useCallback)(()=>{"function"==typeof u&&u(),f(!1)},[u]),y=(0,tz.useCallback)(()=>{"function"==typeof d&&d(),f(!0)},[d]);return tz.createElement(O.Animate,{begin:s,duration:i,isActive:n,easing:o,from:{t:0},to:{t:1},onAnimationStart:y,onAnimationEnd:g,key:m},e=>{var{t:n}=e,s=[],i=(a&&a[0]).startAngle;return a.forEach((e,t)=>{var r=p&&p[t],a=t>0?(0,tF.default)(e,"paddingAngle",0):0;if(r){var o=(0,H.interpolateNumber)(r.endAngle-r.startAngle,e.endAngle-e.startAngle),l=ri(ri({},e),{},{startAngle:i+a,endAngle:i+o(n)+a});s.push(l),i=l.endAngle}else{var{endAngle:c,startAngle:d}=e,u=(0,H.interpolateNumber)(0,c-d)(n),m=ri(ri({},e),{},{startAngle:i+a,endAngle:i+u+a});s.push(m),i=m.endAngle}}),r.current=s,tz.createElement(P.Layer,null,tz.createElement(rm,{sectors:s,activeShape:l,inactiveShape:c,allOtherPieProps:t,showLabels:!h}))})}function rh(e){var{sectors:t,isAnimationActive:r,activeShape:a,inactiveShape:n}=e,s=(0,tz.useRef)(null),i=s.current;return r&&t&&t.length&&(!i||i!==t)?tz.createElement(rp,{props:e,previousSectorsRef:s}):tz.createElement(rm,{sectors:t,activeShape:a,inactiveShape:n,allOtherPieProps:e,showLabels:!0})}function rf(e){var{hide:t,className:r,rootTabIndex:a}=e,n=(0,N.clsx)("recharts-pie",r);return t?null:tz.createElement(P.Layer,{tabIndex:a,className:n},tz.createElement(rh,e))}var rg={animationBegin:400,animationDuration:1500,animationEasing:"ease",cx:"50%",cy:"50%",dataKey:"value",endAngle:360,fill:"#808080",hide:!1,innerRadius:0,isAnimationActive:!W.Global.isSsr,labelLine:!0,legendT
2ype:"rect",minAngle:0,nameKey:"name",outerRadius:"80%",paddingAngle:0,rootTabIndex:0,startAngle:0,stroke:"#fff"};function ry(e){var t=(0,B.resolveDefaultProps)(e,rg),r=(0,tz.useMemo)(()=>(0,k.findAllByType)(e.children,$),[e.children]),a=(0,k.filterProps)(t,!1),n=(0,tz.useMemo)(()=>({name:t.name,nameKey:t.nameKey,tooltipType:t.tooltipType,data:t.data,dataKey:t.dataKey,cx:t.cx,cy:t.cy,startAngle:t.startAngle,endAngle:t.endAngle,minAngle:t.minAngle,paddingAngle:t.paddingAngle,innerRadius:t.innerRadius,outerRadius:t.outerRadius,cornerRadius:t.cornerRadius,legendType:t.legendType,fill:t.fill,presentationProps:a}),[t.cornerRadius,t.cx,t.cy,t.data,t.dataKey,t.endAngle,t.innerRadius,t.minAngle,t.name,t.nameKey,t.outerRadius,t.paddingAngle,t.startAngle,t.tooltipType,t.legendType,t.fill,a]),s=(0,ef.useAppSelector)(e=>t9(e,n,r));return tz.createElement(tz.Fragment,null,tz.createElement(eb.SetTooltipEntrySettings,{fn:rd,args:ri(ri({},t),{},{sectors:s})}),tz.createElement(rf,rl({},t,{sectors:s})))}class rx extends tz.PureComponent{constructor(){super(...arguments),ro(this,"id",(0,H.uniqueId)("recharts-pie-"))}render(){return tz.createElement(tz.Fragment,null,tz.createElement(re.SetPolarGraphicalItem,{data:this.props.data,dataKey:this.props.dataKey,hide:this.props.hide,angleAxisId:0,radiusAxisId:0,stackId:void 0,barSize:void 0,type:"pie"}),tz.createElement(rc,this.props),tz.createElement(ry,this.props),this.props.children)}}ro(rx,"displayName","Pie"),ro(rx,"defaultProps",rg);var rv=e.i(546189),rb=e.i(888494),rw=e.i(688532),rj=e.i(998227),rC=e.i(863751);function rS(e){var t=(0,ef.useAppDispatch)();return(0,m.useEffect)(()=>{t((0,rC.updatePolarOptions)(e))},[t,e]),null}var rN=e.i(390241),rP=["width","height","layout"];function rA(){return(rA=Object.assign.bind()).apply(null,arguments)}var rk={accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:{top:5,right:5,bottom:5,left:5},reverseStackOrder:!1,syncMethod:"index",layout:"radial"},rE=(0,m.forwardRef)(function(e,t){var r,a=(0,B.resolveDefaultProps)(e.categoricalChartProps,rk),{width:n,height:s,layout:i}=a,o=function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r={};for(var a in e)if(({}).hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(a,rP);if(!(0,eI.isPositiveNumber)(n)||!(0,eI.isPositiveNumber)(s))return null;var{chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:d,tooltipPayloadSearcher:u}=e;return m.createElement(rv.RechartsStoreProvider,{preloadedState:{options:{chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:d,tooltipPayloadSearcher:u,eventEmitter:void 0}},reduxStoreName:null!=(r=a.id)?r:l},m.createElement(rb.ChartDataContextProvider,{chartData:a.data}),m.createElement(rw.ReportMainChartProps,{width:n,height:s,layout:i,margin:a.margin}),m.createElement(rj.ReportChartProps,{accessibilityLayer:a.accessibilityLayer,barCategoryGap:a.barCategoryGap,maxBarSize:a.maxBarSize,stackOffset:a.stackOffset,barGap:a.barGap,barSize:a.barSize,syncId:a.syncId,syncMethod:a.syncMethod,className:a.className}),m.createElement(rS,{cx:a.cx,cy:a.cy,startAngle:a.startAngle,endAngle:a.endAngle,innerRadius:a.innerRadius,outerRadius:a.outerRadius}),m.createElement(rN.CategoricalChart,rA({width:n,height:s},o,{ref:t})))}),rI=["item"],rB={layout:"centric",startAngle:0,endAngle:360,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},rO=(0,m.forwardRef)((e,t)=>{var r=(0,B.resolveDefaultProps)(e,rB);return m.createElement(rE,{chartName:"PieChart",defaultTooltipEventType:"item",validateTooltipEventTypes:rI,tooltipPayloadSearcher:tr.arrayTooltipSearcher,categoricalChartProps:r,ref:t})}),rM=m,rD=["points","className","baseLinePoints","connectNulls"];function rL(){return(rL=Object.assign.bind()).apply(null,arguments)}var rT=e=>e&&e.x===+e.x&&e.y===+e.y,rR=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=[[]];
2return e.forEach(e=>{rT(e)?t[t.length-1].push(e):t[t.length-1].length>0&&t.push([])}),rT(e[0])&&t[t.length-1].push(e[0]),t[t.length-1].length<=0&&(t=t.slice(0,-1)),t},r_=(e,t)=>{var r=rR(e);t&&(r=[r.reduce((e,t)=>[...e,...t],[])]);var a=r.map(e=>e.reduce((e,t,r)=>"".concat(e).concat(0===r?"M":"L").concat(t.x,",").concat(t.y),"")).join("");return 1===r.length?"".concat(a,"Z"):a},rz=e=>{var{points:t,className:r,baseLinePoints:a,connectNulls:n}=e,s=function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r={};for(var a in e)if(({}).hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,rD);if(!t||!t.length)return null;var i=(0,N.clsx)("recharts-polygon",r);if(a&&a.length){var o,l=s.stroke&&"none"!==s.stroke,c=(o=r_(t,n),"".concat("Z"===o.slice(-1)?o.slice(0,-1):o,"L").concat(r_(a.reverse(),n).slice(1)));return m.createElement("g",{className:i},m.createElement("path",rL({},(0,k.filterProps)(s,!0),{fill:"Z"===c.slice(-1)?s.fill:"none",stroke:"none",d:c})),l?m.createElement("path",rL({},(0,k.filterProps)(s,!0),{fill:"none",d:r_(t,n)})):null,l?m.createElement("path",rL({},(0,k.filterProps)(s,!0),{fill:"none",d:r_(a,n)})):null)}var d=r_(t,n);return m.createElement("path",rL({},(0,k.filterProps)(s,!0),{fill:"Z"===d.slice(-1)?s.fill:"none",className:i,d:d}))},rF=e.i(763571),rU=e.i(586489),r$=(e,t,r)=>{switch(t){case"angleAxis":return(0,rU.selectAngleAxis)(e,r);case"radiusAxis":return(0,rU.selectRadiusAxis)(e,r);default:throw Error("Unexpected axis type: ".concat(t))}},rK=(e,t,r)=>{switch(t){case"angleAxis":return(0,rU.selectAngleAxisRangeWithReversed)(e,r);case"radiusAxis":return(0,rU.selectRadiusAxisRangeWithReversed)(e,r);default:throw Error("Unexpected axis type: ".concat(t))}},rH=(0,eN.createSelector)([r$,eP.selectRealScaleType,t0,rK],eP.combineScaleFunction),rW=(0,eN.createSelector)([eS.selectChartLayout,tq,eP.selectAxisSettings,tU.pickAxisType],eP.combineCategoricalDomain),rV=(0,eN.createSelector)([eS.selectChartLayout,r$,eP.selectRealScaleType,rH,tJ,rK,eP.selectDuplicateDomain,rW,tU.pickAxisType],eP.combineAxisTicks);(0,eN.createSelector)([eS.selectChartLayout,r$,rH,rK,eP.selectDuplicateDomain,rW,tU.pickAxisType],eP.combineGraphicalItemTicks);var rG=e.i(543905),rq=["children"];function rY(){return(rY=Object.assign.bind()).apply(null,arguments)}function rZ(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function rX(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?rZ(Object(r),!0).forEach(function(t){rQ(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):rZ(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function rQ(e,t,r){var a;return(t="symbol"==typeof(a=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?a:a+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var rJ=Math.PI/180,r0="angleAxis";function r1(e){var t=(0,ef.useAppDispatch)(),r=(0,rM.useMemo)(()=>{var{children:t}=e,r=e,a=rq;if(null==r)return{};var n,s,i=function(e,t){if(null==e)return{};var r={};for(var a in e)if(({}).hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(r,a);if(Object.getOwnPropertySymbols){var o=Object.getOwnPropertySymbols(r);for(s=0;s<o.length;s++)n=o[s],-1===a.indexOf(n)&&({}).propertyIsEnumerable.call(r,n)&&(i[n]=r[n])}return i},[e]),a=(0,ef.useAppSelector)(e=>(0,rU.selectAngleAxis)(e,r.id)),n=r===a;return((0,rM.useEffect)(()=>(t((0,rF.addAngleAxis)(r)),()=>{t((0,rF.removeAngleAxis)(r))}),[t,r]),n)?e.children:null}var r2=e=>
2{var{cx:t,cy:r,radius:a,axisLineType:n,axisLine:s,ticks:i}=e;if(!s)return null;var o=rX(rX({},(0,k.filterProps)(e,!1)),{},{fill:"none"},(0,k.filterProps)(s,!1));if("circle"===n)return rM.createElement(td.Dot,rY({className:"recharts-polar-angle-axis-line"},o,{cx:t,cy:r,r:a}));var l=i.map(e=>(0,rr.polarToCartesian)(t,r,a,e.coordinate));return rM.createElement(rz,rY({className:"recharts-polar-angle-axis-line"},o,{points:l}))},r5=e=>{var{tick:t,tickProps:r,value:a}=e;return t?rM.isValidElement(t)?rM.cloneElement(t,r):"function"==typeof t?t(r):rM.createElement(rt.Text,rY({},r,{className:"recharts-polar-angle-axis-tick-value"}),a):null},r3=e=>{var{tick:t,tickLine:r,tickFormatter:a,stroke:n,ticks:s}=e,i=(0,k.filterProps)(e,!1),o=(0,k.filterProps)(t,!1),l=rX(rX({},i),{},{fill:"none"},(0,k.filterProps)(r,!1)),c=s.map((s,c)=>{var d,u,m=((e,t)=>{var{cx:r,cy:a,radius:n,orientation:s,tickSize:i}=t,o=(0,rr.polarToCartesian)(r,a,n,e.coordinate),l=(0,rr.polarToCartesian)(r,a,n+("inner"===s?-1:1)*(i||8),e.coordinate);return{x1:o.x,y1:o.y,x2:l.x,y2:l.y}})(s,e),p=rX(rX(rX({textAnchor:(d=e.orientation,(u=Math.cos(-s.coordinate*rJ))>1e-5?"outer"===d?"start":"end":u<-1e-5?"outer"===d?"end":"start":"middle")},i),{},{stroke:"none",fill:n},o),{},{index:c,payload:s,x:m.x2,y:m.y2});return rM.createElement(P.Layer,rY({className:(0,N.clsx)("recharts-polar-angle-axis-tick",(0,rr.getTickClassName)(t)),key:"tick-".concat(s.coordinate)},(0,G.adaptEventsOfChild)(e,s,c)),r&&rM.createElement("line",rY({className:"recharts-polar-angle-axis-tick-line"},l,m)),rM.createElement(r5,{tick:t,tickProps:p,value:a?a(s.value,c):s.value}))});return rM.createElement(P.Layer,{className:"recharts-polar-angle-axis-ticks"},c)},r6=e=>{var{angleAxisId:t}=e,r=(0,ef.useAppSelector)(rU.selectPolarViewBox),a=(0,ef.useAppSelector)(e=>rH(e,"angleAxis",t)),n=(0,eH.useIsPanorama)(),s=(0,ef.useAppSelector)(e=>rV(e,"angleAxis",t,n));if(null==r||!s||!s.length)return null;var i=rX(rX(rX({},e),{},{scale:a},r),{},{radius:r.outerRadius});return rM.createElement(P.Layer,{className:(0,N.clsx)("recharts-polar-angle-axis",r0,i.className)},rM.createElement(r2,rY({},i,{ticks:s})),rM.createElement(r3,rY({},i,{ticks:s})))};class r4 extends rM.PureComponent{render(){return this.props.radius<=0?null:rM.createElement(r1,{id:this.props.angleAxisId,scale:this.props.scale,type:this.props.type,dataKey:this.props.dataKey,unit:void 0,name:this.props.name,allowDuplicatedCategory:!1,allowDataOverflow:!1,reversed:this.props.reversed,includeHidden:!1,allowDecimals:this.props.allowDecimals,tickCount:this.props.tickCount,ticks:this.props.ticks,tick:this.props.tick,domain:this.props.domain},rM.createElement(r6,this.props))}}rQ(r4,"displayName","PolarAngleAxis"),rQ(r4,"axisType",r0),rQ(r4,"defaultProps",rG.defaultPolarAngleAxisProps);var r7=(0,eN.createSelector)([(e,t)=>rV(e,"angleAxis",t,!1)],e=>{if(e)return e.map(e=>e.coordinate)}),r8=(0,eN.createSelector)([(e,t)=>rV(e,"radiusAxis",t,!1)],e=>{if(e)return e.map(e=>e.coordinate)}),r9=["gridType","radialLines","angleAxisId","radiusAxisId","cx","cy","innerRadius","outerRadius"];function ae(){return(ae=Object.assign.bind()).apply(null,arguments)}function at(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function ar(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?at(Object(r),!0).forEach(function(t){var a,n,s;a=e,n=t,s=r[t],(n=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(n))in a?Object.defineProperty(a,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):a[n]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):at(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var aa=e=>{var{cx:t,cy:r,innerRadius:a,outerRadius:n,polarAngles:s,radialLines:i}=e;if(!s||!s.length||!i)return null;var o=ar({stroke:"#ccc"},(0,k.filterProps)(e,!1));return m.createElement("g",{className:"recharts-polar-grid-angle"},s.map(e=>{var s=(0,rr.polarToCartesian)(t,r,a,e),i=(0,rr.polarToCartesian)(t,r,n,e);return m.createElement("line",ae({},o,{key:"line-".concat(e),x1:s.x,y1:s.y,x2:i.x,y2:i.y}))}))},an=e=>{var{cx:t,cy:r,radius:a,index:n}=e,s=ar(ar({stroke:"#ccc"},(0,k.filterProps)(e,!1)),{},{fill:"none"});return m.createElement("circle",ae({},s,{className:(0,N.clsx)("recharts-polar-grid-concentric-circle",e.className),key:"circle-".concat(n),cx:t,cy:r,r:a}))},as=e=>{var t,r,a,n,{radius:s,index:i}=e,o=ar(ar({stroke:"#ccc"},(0,k.filterProps)(e,!1)),{},{fill:"none"});return m.createElement("path",ae({},o,{className:(0,N.clsx)("recharts-polar-grid-concentric-polygon",e.className),key:"path-".concat(i),d:(t=e.cx,r=e.cy,a=e.polarAngles,n="",a.forEach((e,a)=>{var i=(0,rr.polarToCartesian)(t,r,s,e);a?n+="L ".concat(i.x,",").concat(i.y):n+="M ".concat(i.x,",").concat(i.y)}),n+="Z")}))},ai=e=>{var{polarRadius:t,gridType:r}=e;return t&&t.length?m.createElement("g",{className:"recharts-polar-grid-concentric"},t.map((t,a)=>"circle"===r?m.createElement(an,ae({key:a},e,{radius:t,index:a})):m.createElement(as,ae({key:a},e,{radius:t,index:a})))):null},ao=e=>
2{var t,r,a,n,s,i,o,l,{gridType:c="polygon",radialLines:d=!0,angleAxisId:u=0,radiusAxisId:p=0,cx:h,cy:f,innerRadius:g,outerRadius:y}=e,x=function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r={};for(var a in e)if(({}).hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,r9),v=(0,ef.useAppSelector)(rU.selectPolarViewBox),b=ar({cx:null!=(t=null!=(r=null==v?void 0:v.cx)?r:h)?t:0,cy:null!=(a=null!=(n=null==v?void 0:v.cy)?n:f)?a:0,innerRadius:null!=(s=null!=(i=null==v?void 0:v.innerRadius)?i:g)?s:0,outerRadius:null!=(o=null!=(l=null==v?void 0:v.outerRadius)?l:y)?o:0},x),{polarAngles:w,polarRadius:j,cx:C,cy:S,innerRadius:N,outerRadius:P}=b,A=(0,ef.useAppSelector)(e=>r7(e,u)),k=(0,ef.useAppSelector)(e=>r8(e,p)),E=Array.isArray(w)?w:A,I=Array.isArray(j)?j:k;return P<=0||null==E||null==I?null:m.createElement("g",{className:"recharts-polar-grid"},m.createElement(aa,ae({cx:C,cy:S,innerRadius:N,outerRadius:P,gridType:c,radialLines:d},b,{polarAngles:E,polarRadius:I})),m.createElement(ai,ae({cx:C,cy:S,innerRadius:N,outerRadius:P,gridType:c,radialLines:d},b,{polarAngles:E,polarRadius:I})))};ao.displayName="PolarGrid";var al=m,ac=e.i(767577),ad=e.i(152555),au=e.i(905e3),am=e.i(913001),ap=["cx","cy","angle","axisLine"],ah=["angle","tickFormatter","stroke","tick"];function af(){return(af=Object.assign.bind()).apply(null,arguments)}function ag(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function ay(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?ag(Object(r),!0).forEach(function(t){ax(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):ag(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function ax(e,t,r){var a;return(t="symbol"==typeof(a=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?a:a+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function av(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r={};for(var a in e)if(({}).hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}var ab="radiusAxis";function aw(e){var t=(0,ef.useAppDispatch)();return(0,al.useEffect)(()=>(t((0,rF.addRadiusAxis)(e)),()=>{t((0,rF.removeRadiusAxis)(e))})),null}var aj=e=>{var t,r,a,n,{radiusAxisId:s}=e,i=(0,ef.useAppSelector)(rU.selectPolarViewBox),o=(0,ef.useAppSelector)(e=>rH(e,"radiusAxis",s)),l=(0,ef.useAppSelector)(e=>rV(e,"radiusAxis",s,!1));if(null==i||!l||!l.length)return null;var c=ay(ay(ay({},e),{},{scale:o},i),{},{radius:i.outerRadius}),{tick:d,axisLine:u}=c;return al.createElement(P.Layer,{className:(0,N.clsx)("recharts-polar-radius-axis",ab,c.className)},u&&((e,t)=>{var{cx:r,cy:a,angle:n,axisLine:s}=e,i=av(e,ap),o=t.reduce((e,t)=>[Math.min(e[0],t.coordinate),Math.max(e[1],t.coordinate)],[1/0,-1/0]),l=(0,rr.polarToCartesian)(r,a,o[0],n),c=(0,rr.polarToCartesian)(r,a,o[1],n),d=ay(ay(ay({},(0,k.filterProps)(i,!1)),{},{fill:"none"},(0,k.filterProps)(s,!1)),{},{x1:l.x,y1:l.y,x2:c.x,y2:c.y});return al.createElement("line",af({className:"recharts-polar-radius-axis-line"},d))})(c,l),d&&((e,t)=>{var{angle:r,tickFormatter:a,stroke:n,tick:s}=e,i=av(e,ah),o=(e=>{var t;switch(e){case"left":t="end";break;case"right":t="start";break;default:t="middle"}return t})(e.orientation),l=(0,k.filterProps)(i,!1),c=(0,k.filterProps)(s,!1),d=t.map((t,i)=>{var d,u=((e,t,r,a)=>{var{coordinate:n}=e;return(0,rr.polarToCartesian)(r,a,n,t)})(t,e.angle,e.cx,e.cy),m=ay(ay(ay(ay({textAnchor:o,transform:"rotate(".concat(90-r,", ").concat(u.x,", ").concat(u.y,")")},l),{},{stroke:"none",fill:n},c),{},{index:i},u),{},{payload:t});return al.createElement(P.Layer,af({className:(0,N.clsx)("recharts-polar-radius-axis-tick",(0,rr.getTickClassName)(s)),key:"tick-".concat(t.coordinate)},(0,G.adaptEventsOfChild)(e,t,i)),(d=a?a(t.value,i):t.value,al.isValidElement(s)?al.cloneElement(s,m):"function"==typeof s?s(m):al.createElement(rt.Text,af({},m,{className:"recharts-polar-radius-axis-tick-value"}),d)))});return al.createElement(P.Layer,{className:"recharts-polar-radius-axis-ticks"},d)})(c,l),au.Label.renderCallByParent(c,(t=c.angle,r=c.cx,a=c.cy,n=(0,ac.default)(l,e=>e.coordinate||0),{cx:r,cy:a,startAngle:t,endAngle:t,innerRadius:(0,ad.default)(l,e=>e.coordinate||0).coordinate||0,outerRadius:n.coordinate||0})))};class aC extends al.PureComponent{render(){return al.createElement(al.Fragment,null,al.createElement(aw,{domain:this.props.domain,id:this.props.radiusAxisId,scale:this.props.scale,type:this.props.type,dataKey:this.props.dataKey,unit:void 0,name:this.props.name,allowDuplicatedCategory:this.props.allowDuplicatedCategory,allowDataOverflow:this.props.allowDataOverflow,reversed:this.props.reversed,includeHidden:this.props.includeHidden,allowDecimals:this.props.allowDecimals,tickCount:this.props.tickCount,ticks:this.props.ticks,tick:this.props.tick}),al.createElement(aj,this.props))}}ax(aC,"displayName","PolarRadiusAxis"),ax(aC,"axisType",ab),ax(aC,"defaultProps",am.defaultPolarRadiusAxisProps);var aS=m,aN=e.i(112439),aP=e=>m.createElement(re.SetPolarGraphicalItem,e);function aA(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function ak(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
2t%2?aA(Object(r),!0).forEach(function(t){var a,n,s;a=e,n=t,s=r[t],(n=function(e){var t=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(e,"string");return"symbol"==typeof t?t:t+""}(n))in a?Object.defineProperty(a,n,{value:s,enumerable:!0,configurable:!0,writable:!0}):a[n]=s}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):aA(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var aE=(e,t)=>rH(e,"radiusAxis",t),aI=(0,eN.createSelector)([aE],e=>{if(null!=e)return{scale:e}}),aB=(0,eN.createSelector)([rU.selectRadiusAxis,aE],(e,t)=>{if(null!=e&&null!=t)return ak(ak({},e),{},{scale:t})}),aO=(e,t,r)=>(0,rU.selectAngleAxis)(e,r),aM=(e,t,r)=>rH(e,"angleAxis",r),aD=(0,eN.createSelector)([aO,aM],(e,t)=>{if(null!=e&&null!=t)return ak(ak({},e),{},{scale:t})}),aL=(0,eN.createSelector)([aO,aM,rU.selectPolarViewBox],(e,t,r)=>{if(null!=r&&null!=t)return{scale:t,type:e.type,dataKey:e.dataKey,cx:r.cx,cy:r.cy}}),aT=(0,eN.createSelector)([eS.selectChartLayout,aB,(e,t,r,a)=>rV(e,"radiusAxis",t,a),aD,(e,t,r,a)=>rV(e,"angleAxis",r,a)],(e,t,r,a,n)=>(0,V.isCategoricalAxis)(e,"radiusAxis")?(0,V.getBandSizeOfAxis)(t,r,!1):(0,V.getBandSizeOfAxis)(a,n,!1)),aR=(0,eN.createSelector)([tK,(e,t,r,a,n)=>n],(e,t)=>{if(e.some(e=>"radar"===e.type&&t===e.dataKey))return t}),a_=(0,eN.createSelector)([aI,aL,eA.selectChartDataAndAlwaysIgnoreIndexes,aR,aT],(e,t,r,a,n)=>{var{chartData:s,dataStartIndex:i,dataEndIndex:o}=r;if(null!=e&&null!=t&&null!=s&&null!=n&&null!=a)return function(e){var{radiusAxis:t,angleAxis:r,displayedData:a,dataKey:n,bandSize:s}=e,{cx:i,cy:o}=r,l=!1,c=[],d="number"!==r.type&&null!=s?s:0;a.forEach((e,a)=>{var s=(0,V.getValueByDataKey)(e,r.dataKey,a),u=(0,V.getValueByDataKey)(e,n),m=r.scale(s)+d,p=Array.isArray(u)?(0,aN.default)(u):u,h=(0,H.isNullish)(p)?void 0:t.scale(p);Array.isArray(u)&&u.length>=2&&(l=!0),c.push(aF(aF({},(0,rr.polarToCartesian)(i,o,h,m)),{},{name:s,value:u,cx:i,cy:o,radius:h,angle:m,payload:e}))});var u=[];return l&&c.forEach(e=>{if(Array.isArray(e.value)){var r=e.value[0],a=(0,H.isNullish)(r)?void 0:t.scale(r);u.push(aF(aF({},e),{},{radius:a},(0,rr.polarToCartesian)(i,o,a,e.angle)))}else u.push(e)}),{points:c,isRange:l,baseLinePoints:u}}({radiusAxis:e,angleAxis:t,displayedData:s.slice(i,o+1),dataKey:a,bandSize:n})});function az(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function aF(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?az(Object(r),!0).forEach(function(t){aU(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):az(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function aU(e,t,r){var a;return(t="symbol"==typeof(a=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?a:a+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a$(){return(a$=Object.assign.bind()).apply(null,arguments)}function aK(e,t){return e&&"none"!==e?e:t}function aH(e){var{dataKey:t,stroke:r,strokeWidth:a,fill:n,name:s,hide:i,tooltipType:o}=e;return{dataDefinedOnItem:void 0,positions:void 0,settings:{stroke:r,strokeWidth:a,fill:n,nameKey:void 0,dataKey:t,name:(0,V.getTooltipNameProp)(s,t),hide:i,type:o,color:aK(r,n),unit:""}}}function aW(e){var{points:t,props:r}=e,{dot:a,dataKey:n}=r;if(!a)return null;var s=(0,k.filterProps)(r,!1),i=(0,k.filterProps)(a,!0),o=t.map((e,t)=>{var r=aF(aF(aF({key:"dot-".concat(t),r:3},s),i),{},{dataKey:n,cx:e.x,cy:e.y,index:t,payload:e});return aS.isValidElement(a)?aS.cloneElement(a,r):"function"==typeof a?a(r):aS.createElement(td.Dot,a$({},r,{className:(0,N.clsx)("recharts-radar-dot","boolean"!=typeof a?a.className:"")}))});return aS.createElement(P.Layer,{className:"recharts-radar-dots"},o)}function aV(e){var t,{points:r,props:a,showLabels:n}=e;if(null==r)return null;var{shape:s,isRange:i,baseLinePoints:o,connectNulls:l}=a;return t=aS.isValidElement(s)?aS.cloneElement(s,aF(aF({},a),{},{points:r})):"function"==typeof s?s(aF(aF({},a),{},{points:r})):aS.createElement(rz,a$({},(0,k.filterProps)(a,!0),{onMouseEnter:e=>{var{onMouseEnter:t}=a;t&&t(a,e)},onMouseLeave:e=>{var{onMouseLeave:t}=a;t&&t(a,e)},points:r,baseLinePoints:i?o:null,connectNulls:l})),aS.createElement(P.Layer,{className:"recharts-radar-polygon"},t,aS.createElement(aW,{props:a,points:r}),n&&K.LabelList.renderCallByParent(a,r))}function aG(e){var{props:t,previousPointsRef:r}
2=e,{points:a,isAnimationActive:n,animationBegin:s,animationDuration:i,animationEasing:o,onAnimationEnd:l,onAnimationStart:c}=t,d=r.current,u=(0,eG.useAnimationId)(t,"recharts-radar-"),[m,p]=(0,aS.useState)(!0),h=(0,aS.useCallback)(()=>{"function"==typeof l&&l(),p(!1)},[l]),f=(0,aS.useCallback)(()=>{"function"==typeof c&&c(),p(!0)},[c]);return aS.createElement(O.Animate,{begin:s,duration:i,isActive:n,easing:o,from:{t:0},to:{t:1},key:"radar-".concat(u),onAnimationEnd:h,onAnimationStart:f},e=>{var{t:n}=e,s=d&&d.length/a.length,i=1===n?a:a.map((e,t)=>{var r=d&&d[Math.floor(t*s)];if(r){var a=(0,H.interpolateNumber)(r.x,e.x),i=(0,H.interpolateNumber)(r.y,e.y);return aF(aF({},e),{},{x:a(n),y:i(n)})}var o=(0,H.interpolateNumber)(e.cx,e.x),l=(0,H.interpolateNumber)(e.cy,e.y);return aF(aF({},e),{},{x:o(n),y:l(n)})});return n>0&&(r.current=i),aS.createElement(aV,{points:i,props:t,showLabels:!m})})}function aq(e){var{points:t,isAnimationActive:r,isRange:a}=e,n=(0,aS.useRef)(void 0),s=n.current;return r&&t&&t.length&&!a&&(!s||s!==t)?aS.createElement(aG,{props:e,previousPointsRef:n}):aS.createElement(aV,{points:t,props:e,showLabels:!0})}var aY={angleAxisId:0,radiusAxisId:0,hide:!1,activeDot:!0,dot:!1,legendType:"rect",isAnimationActive:!W.Global.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"ease"};class aZ extends aS.PureComponent{render(){var{hide:e,className:t,points:r}=this.props;if(e)return null;var a=(0,N.clsx)("recharts-radar",t);return aS.createElement(aS.Fragment,null,aS.createElement(P.Layer,{className:a},aS.createElement(aq,this.props)),aS.createElement(tu.ActivePoints,{points:r,mainColor:aK(this.props.stroke,this.props.fill),itemDataKey:this.props.dataKey,activeDot:this.props.activeDot}))}}function aX(e){var t=(0,eH.useIsPanorama)(),r=(0,ef.useAppSelector)(r=>a_(r,e.radiusAxisId,e.angleAxisId,t,e.dataKey));return aS.createElement(aZ,a$({},e,{points:null==r?void 0:r.points,baseLinePoints:null==r?void 0:r.baseLinePoints,isRange:null==r?void 0:r.isRange}))}class aQ extends aS.PureComponent{render(){return aS.createElement(aS.Fragment,null,aS.createElement(aP,{data:void 0,dataKey:this.props.dataKey,hide:this.props.hide,angleAxisId:this.props.angleAxisId,radiusAxisId:this.props.radiusAxisId,stackId:void 0,barSize:void 0,type:"radar"}),aS.createElement(eV.SetPolarLegendPayload,{legendPayload:(e=>{var{dataKey:t,name:r,stroke:a,fill:n,legendType:s,hide:i}=e;return[{inactive:i,dataKey:t,type:s,color:aK(a,n),value:(0,V.getTooltipNameProp)(r,t),payload:e}]})(this.props)}),aS.createElement(eb.SetTooltipEntrySettings,{fn:aH,args:this.props}),aS.createElement(aX,this.props))}}aU(aQ,"displayName","Radar"),aU(aQ,"defaultProps",aY);var aJ=["axis"],a0={layout:"centric",startAngle:90,endAngle:-270,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},a1=(0,m.forwardRef)((e,t)=>{var r=(0,B.resolveDefaultProps)(e,a0);return m.createElement(rE,{chartName:"RadarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:aJ,tooltipPayloadSearcher:tr.arrayTooltipSearcher,categoricalChartProps:r,ref:t})}),a2=m,a5=e.i(240626),a3=e.i(197278),a6=e.i(218871);function a4(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function a7(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?a4(Object(r),!0).forEach(function(t){a8(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):a4(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function a8(e,t,r){var a;return(t="symbol"==typeof(a=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?a:a+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function a9(){return(a9=Object.assign.bind()).apply(null,arguments)}function ne(e){var t=(0,ef.useAppDispatch)();return(0,a2.useEffect)(()=>(t((0,a3.addLine)(e)),()=>{t((0,a3.removeLine)(e))})),null}function nt(e){var{x:t,y:r,segment:a,xAxisId:n,yAxisId:s,shape:i,className:o,ifOverflow:l}=e,c=(0,eH.useIsPanorama)(),d=(0,a6.useClipPathId)(),u=(0,ef.useAppSelector)(e=>(0,eP.selectXAxisSettings)(e,n)),m=(0,ef.useAppSelector)(e=>(0,eP.selectYAxisSettings)(e,s)),p=(0,ef.useAppSelector)(e=>(0,eP.selectAxisScale)(e,"xAxis",n,c)),h=(0,ef.useAppSelector)(e=>(0,eP.selectAxisScale)(e,"yAxis",s,c)),f=(0,eS.useViewBox)(),g=(0,H.isNumOrStr)(t),y=(0,H.isNumOrStr)(r);if(!d||!f||null==u||null==m||null==p||null==h)return null;var x=((e,t,r,a,n,s,i,o,l)=>{var{x:c,y:d,width:u,height:m}=n;if(r){var{y:p}
2=l,h=e.y.apply(p,{position:s});if((0,H.isNan)(h)||"discard"===l.ifOverflow&&!e.y.isInRange(h))return null;var f=[{x:c+u,y:h},{x:c,y:h}];return"left"===o?f.reverse():f}if(t){var{x:g}=l,y=e.x.apply(g,{position:s});if((0,H.isNan)(y)||"discard"===l.ifOverflow&&!e.x.isInRange(y))return null;var x=[{x:y,y:d+m},{x:y,y:d}];return"top"===i?x.reverse():x}if(a){var{segment:v}=l,b=v.map(t=>e.apply(t,{position:s}));return"discard"===l.ifOverflow&&b.some(t=>!e.isInRange(t))?null:b}return null})((0,a5.createLabeledScales)({x:p,y:h}),g,y,a&&2===a.length,f,e.position,u.orientation,m.orientation,e);if(!x)return null;var[{x:v,y:b},{x:w,y:j}]=x,C=a7(a7({clipPath:"hidden"===l?"url(#".concat(d,")"):void 0},(0,k.filterProps)(e,!0)),{},{x1:v,y1:b,x2:w,y2:j});return a2.createElement(P.Layer,{className:(0,N.clsx)("recharts-reference-line",o)},a2.isValidElement(i)?a2.cloneElement(i,C):"function"==typeof i?i(C):a2.createElement("line",a9({},C,{className:"recharts-reference-line-line"})),au.Label.renderCallByParent(e,(0,a5.rectWithCoords)({x1:v,y1:b,x2:w,y2:j})))}function nr(e){return a2.createElement(a2.Fragment,null,a2.createElement(ne,{yAxisId:e.yAxisId,xAxisId:e.xAxisId,ifOverflow:e.ifOverflow,x:e.x,y:e.y}),a2.createElement(nt,e))}class na extends a2.Component{render(){return a2.createElement(nr,this.props)}}a8(na,"displayName","ReferenceLine"),a8(na,"defaultProps",{ifOverflow:"discard",xAxisId:0,yAxisId:0,fill:"none",stroke:"#ccc",fillOpacity:1,strokeWidth:1,position:"middle"});var nn=e.i(723451),ns=m,ni=m,no=e.i(775538);function nl(e,t,r){var a;return(t="symbol"==typeof(a=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?a:a+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nc(e){var t=(0,ef.useAppDispatch)();return(0,ni.useEffect)(()=>(t((0,no.addZAxis)(e)),()=>{t((0,no.removeZAxis)(e))}),[e,t]),null}class nd extends ni.Component{render(){return ni.createElement(nc,{domain:this.props.domain,id:this.props.zAxisId,dataKey:this.props.dataKey,name:this.props.name,unit:this.props.unit,range:this.props.range,scale:this.props.scale,type:this.props.type,allowDuplicatedCategory:eP.implicitZAxis.allowDuplicatedCategory,allowDataOverflow:eP.implicitZAxis.allowDataOverflow,reversed:eP.implicitZAxis.reversed,includeHidden:eP.implicitZAxis.includeHidden})}}nl(nd,"displayName","ZAxis"),nl(nd,"defaultProps",{zAxisId:0,range:eP.implicitZAxis.range,scale:eP.implicitZAxis.scale,type:eP.implicitZAxis.type});var nu=["option","isActive"];function nm(){return(nm=Object.assign.bind()).apply(null,arguments)}function np(e){var{option:t,isActive:r}=e,a=function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r={};for(var a in e)if(({}).hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,nu);return"string"==typeof t?m.createElement(eo,nm({option:m.createElement(et.Symbols,nm({type:t},a)),isActive:r,shapeType:"symbols"},a)):m.createElement(eo,nm({option:t,isActive:r,shapeType:"symbols"},a))}var nh=(0,eN.createSelector)([eP.selectUnfilteredCartesianItems,(e,t,r,a,n)=>n],(e,t)=>{if(e.some(e=>"scatter"===e.type&&t.dataKey===e.dataKey&&t.data===e.data))return t}),nf=(0,eN.createSelector)([(e,t,r,a,n,s,i)=>(0,eA.selectChartDataWithIndexesIfNotInPanorama)(e,t,r,i),(e,t,r,a,n,s,i)=>(0,eP.selectAxisWithScale)(e,"xAxis",t,i),(e,t,r,a,n,s,i)=>(0,eP.selectTicksOfGraphicalItem)(e,"xAxis",t,i),(e,t,r,a,n,s,i)=>(0,eP.selectAxisWithScale)(e,"yAxis",r,i),(e,t,r,a,n,s,i)=>(0,eP.selectTicksOfGraphicalItem)(e,"yAxis",r,i),(e,t,r,a)=>(0,eP.selectZAxisWithScale)(e,"zAxis",a,!1),nh,(e,t,r,a,n,s)=>s],(e,t,r,a,n,s,i,o)=>{var l,{chartData:c,dataStartIndex:d,dataEndIndex:u}=e;if(null!=i&&null!=(l=(null==i?void 0:i.data)!=null&&i.data.length>0?i.data:null==c?void 0:c.slice(d,u+1))&&null!=t&&null!=a&&null!=r&&null!=n&&(null==r?void 0:r.length)!==0&&(null==n?void 0:n.length)!==0)return function(e){var{displayedData:t,xAxis:r,yAxis:a,zAxis:n,scatterSettings:s,xAxisTicks:i,yAxisTicks:o,cells:l}=e,c=(0,H.isNullish)(r.dataKey)?s.dataKey:r.dataKey,d=(0,H.isNullish)(a.dataKey)?s.dataKey:a.dataKey,u=n&&n.dataKey,m=n?n.range:nd.defaultProps.range,p=m&&m[0],h=r.scale.bandwidth?r.scale.bandwidth():0,f=a.scale.bandwidth?a.scale.bandwidth():0;return t.map((e,t)=>{var m=(0,V.getValueByDataKey)(e,c),g=(0,V.getValueByDataKey)(e,d),y=!(0,H.isNullish)(u)&&(0,V.getValueByDataKey)(e,u)||"-",x=[{name:(0,H.isNullish)(r.dataKey)?s.name:r.name||r.dataKey,unit:r.unit||"",value:m,payload:e,dataKey:c,type:s.tooltipType},{name:(0,H.isNullish)(a.dataKey)?s.name:a.name||a.dataKey,unit:a.unit||"",value:g,payload:e,dataKey:d,type:s.tooltipType}];
2"-"!==y&&x.push({name:n.name||n.dataKey,unit:n.unit||"",value:y,payload:e,dataKey:u,type:s.tooltipType});var v=(0,V.getCateCoordinateOfLine)({axis:r,ticks:i,bandSize:h,entry:e,index:t,dataKey:c}),b=(0,V.getCateCoordinateOfLine)({axis:a,ticks:o,bandSize:f,entry:e,index:t,dataKey:d}),w="-"!==y?n.scale(y):p,j=Math.sqrt(Math.max(w,0)/Math.PI);return nw(nw({},e),{},{cx:v,cy:b,x:v-j,y:b-j,width:2*j,height:2*j,size:w,node:{x:m,y:g,z:y},tooltipPayload:x,tooltipPosition:{x:v,y:b},payload:e},l&&l[t]&&l[t].props)})}({displayedData:l,xAxis:t,yAxis:a,zAxis:s,scatterSettings:i,xAxisTicks:r,yAxisTicks:n,cells:o})}),ng=["onMouseEnter","onClick","onMouseLeave"],ny=["animationBegin","animationDuration","animationEasing","hide","isAnimationActive","legendType","lineJointType","lineType","shape","xAxisId","yAxisId","zAxisId"];function nx(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r={};for(var a in e)if(({}).hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}function nv(){return(nv=Object.assign.bind()).apply(null,arguments)}function nb(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function nw(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?nb(Object(r),!0).forEach(function(t){nj(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nb(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function nj(e,t,r){var a;return(t="symbol"==typeof(a=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?a:a+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function nC(e){var t,r,{points:a,props:n}
2=e,{line:s,lineType:i,lineJointType:o}=n;if(!s)return null;var l=(0,k.filterProps)(n,!1),c=(0,k.filterProps)(s,!1);if("joint"===i)t=a.map(e=>({x:e.cx,y:e.cy}));else if("fitting"===i){var{xmin:d,xmax:u,a:m,b:p}=(0,H.getLinearRegression)(a);t=[{x:d,y:m*d+p},{x:u,y:m*u+p}]}var h=nw(nw(nw({},l),{},{fill:"none",stroke:l&&l.fill},c),{},{points:t});return r=ns.isValidElement(s)?ns.cloneElement(s,h):"function"==typeof s?s(h):ns.createElement(tc.Curve,nv({},h,{type:o})),ns.createElement(P.Layer,{className:"recharts-scatter-line",key:"recharts-scatter-line"},r)}function nS(e){var{points:t,showLabels:r,allOtherScatterProps:a}=e,{shape:n,activeShape:s,dataKey:i}=a,o=(0,k.filterProps)(a,!1),l=(0,ef.useAppSelector)(eW.selectActiveTooltipIndex),{onMouseEnter:c,onClick:d,onMouseLeave:u}=a,m=nx(a,ng),p=ey(c,a.dataKey),h=ex(u),f=ev(d,a.dataKey);return null==t?null:ns.createElement(ns.Fragment,null,ns.createElement(nC,{points:t,props:a}),t.map((e,t)=>{var r=s&&l===String(t),a=r?s:n,c=nw(nw(nw({key:"symbol-".concat(t)},o),e),{},{[ra.DATA_ITEM_INDEX_ATTRIBUTE_NAME]:t,[ra.DATA_ITEM_DATAKEY_ATTRIBUTE_NAME]:String(i)});return ns.createElement(P.Layer,nv({className:"recharts-scatter-symbol"},(0,G.adaptEventsOfChild)(m,e,t),{onMouseEnter:p(e,t),onMouseLeave:h(e,t),onClick:f(e,t),key:"symbol-".concat(null==e?void 0:e.cx,"-").concat(null==e?void 0:e.cy,"-").concat(null==e?void 0:e.size,"-").concat(t)}),ns.createElement(np,nv({option:a,isActive:r},c)))}),r&&K.LabelList.renderCallByParent(a,t))}function nN(e){var{previousPointsRef:t,props:r}=e,{points:a,isAnimationActive:n,animationBegin:s,animationDuration:i,animationEasing:o}=r,l=t.current,c=(0,eG.useAnimationId)(r,"recharts-scatter-"),[d,u]=(0,ns.useState)(!1),m=(0,ns.useCallback)(()=>{u(!1)},[]),p=(0,ns.useCallback)(()=>{u(!0)},[]);return ns.createElement(O.Animate,{begin:s,duration:i,isActive:n,easing:o,from:{t:0},to:{t:1},onAnimationEnd:m,onAnimationStart:p,key:c},e=>{var{t:n}=e,s=1===n?a:a.map((e,t)=>{var r=l&&l[t];if(r){var a=(0,H.interpolateNumber)(r.cx,e.cx),s=(0,H.interpolateNumber)(r.cy,e.cy),i=(0,H.interpolateNumber)(r.size,e.size);return nw(nw({},e),{},{cx:a(n),cy:s(n),size:i(n)})}var o=(0,H.interpolateNumber)(0,e.size);return nw(nw({},e),{},{size:o(n)})});return n>0&&(t.current=s),ns.createElement(P.Layer,null,ns.createElement(nS,{points:s,allOtherScatterProps:r,showLabels:!d}))})}function nP(e){var{points:t,isAnimationActive:r}=e,a=(0,ns.useRef)(null),n=a.current;return r&&t&&t.length&&(!n||n!==t)?ns.createElement(nN,{props:e,previousPointsRef:a}):ns.createElement(nS,{points:t,allOtherScatterProps:e,showLabels:!0})}function nA(e){var{dataKey:t,points:r,stroke:a,strokeWidth:n,fill:s,name:i,hide:o,tooltipType:l}=e;return{dataDefinedOnItem:null==r?void 0:r.map(e=>e.tooltipPayload),positions:null==r?void 0:r.map(e=>e.tooltipPosition),settings:{stroke:a,strokeWidth:n,fill:s,nameKey:void 0,dataKey:t,name:(0,V.getTooltipNameProp)(i,t),hide:o,type:l,color:s,unit:""}}}var nk=(e,t,r)=>({x:e.cx,y:e.cy,value:"x"===r?+e.node.x:+e.node.y,errorVal:(0,V.getValueByDataKey)(e,t)});function nE(e){var t=(0,ns.useRef)((0,H.uniqueId)("recharts-scatter-")),{hide:r,points:a,className:n,needClip:s,xAxisId:i,yAxisId:o,id:l,children:c}=e;if(r)return null;var d=(0,N.clsx)("recharts-scatter",n),u=(0,H.isNullish)(l)?t.current:l;return ns.createElement(P.Layer,{className:d,clipPath:s?"url(#clipPath-".concat(u,")"):null},s&&ns.createElement("defs",null,ns.createElement(eC.GraphicalItemClipPath,{clipPathId:u,xAxisId:i,yAxisId:o})),ns.createElement(E.SetErrorBarContext,{xAxisId:i,yAxisId:o,data:a,dataPointFormatter:nk,errorBarOffset:0},c),ns.createElement(P.Layer,{key:"recharts-scatter-symbols"},ns.createElement(nP,e)))}var nI={xAxisId:0,yAxisId:0,zAxisId:0,legendType:"circle",lineType:"joint",lineJointType:"linear",data:[],shape:"circle",hide:!1,isAnimationActive:!W.Global.isSsr,animationBegin:0,animationDuration:400,animationEasing:"linear"};function nB(e){var t=(0,B.resolveDefaultProps)(e,nI),{animationBegin:r,animationDuration:a,animationEasing:n,hide:s,isAnimationActive:i,legendType:o,lineJointType:l,lineType:c,shape:d,xAxisId:u,yAxisId:m,zAxisId:p}=t,h=nx(t,ny),{needClip:f}=(0,eC.useNeedsClip)(u,m),g=(0,ns.useMemo)(()=>(0,k.findAllByType)(e.children,$),[e.children]),y=(0,ns.useMemo)(()=>({name:e.name,tooltipType:e.tooltipType,data:e.data,dataKey:e.dataKey}),[e.data,e.dataKey,e.name,e.tooltipType]),x=(0,eH.useIsPanorama)(),v=(0,ef.useAppSelector)(e=>nf(e,u,m,p,y,g,x));return null==f?null:ns.createElement(ns.Fragment,null,ns.createElement(eb.SetTooltipEntrySettings,{fn:nA,args:nw(nw({},e),{},{points:v})}),ns.createElement(nE,nv({},h,{xAxisId:u,yAxisId:m,zAxisId:p,lineType:c,lineJointType:l,legendType:o,shape:d,hide:s,isAnimationActive:i,animationBegin:r,animationDuration:a,animationEasing:n,points:v,needClip:f})))}class nO extends ns.Component{render(){return ns.createElement(E.CartesianGraphicalItemContext,{type:"scatter",data:this.props.data,xAxisId:this.props.xAxisId,yAxisId:this.props.yAxisId,zAxisId:this.props.zAxisId,dataKey:this.props.dataKey,stackId:void 0,hide:this.props.hide,barSize:void 0},ns.createElement(eV.SetLegendPayload,{legendPayload:(e=>
2{var{dataKey:t,name:r,fill:a,legendType:n,hide:s}=e;return[{inactive:s,dataKey:t,type:n,color:a,value:(0,V.getTooltipNameProp)(r,t),payload:e}]})(this.props)}),ns.createElement(nB,this.props))}}nj(nO,"displayName","Scatter"),nj(nO,"defaultProps",nI);var nM=["item"],nD=(0,m.forwardRef)((e,t)=>m.createElement(ta.CartesianChart,{chartName:"ScatterChart",defaultTooltipEventType:"item",validateTooltipEventTypes:nM,tooltipPayloadSearcher:tr.arrayTooltipSearcher,categoricalChartProps:e,ref:t})),nL=e.i(694713),nT=m,nR=e.i(337174),n_=e.i(777541),nz=e.i(602227),nF=e.i(492900),nU=e.i(458985),n$=["width","height","className","style","children","type"];function nK(){return(nK=Object.assign.bind()).apply(null,arguments)}function nH(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(e);t&&(a=a.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,a)}return r}function nW(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?nH(Object(r),!0).forEach(function(t){nV(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):nH(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function nV(e,t,r){var a;return(t="symbol"==typeof(a=function(e,t){if("object"!=typeof e||!e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var a=r.call(e,t||"default");if("object"!=typeof a)return a;throw TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}(t,"string"))?a:a+"")in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}var nG="value",nq=(e,t)=>(0,tF.default)(e,t),nY=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"";return"".concat(t,"children[").concat(e,"]")},nZ={chartName:"Treemap",defaultTooltipEventType:"item",validateTooltipEventTypes:["item"],tooltipPayloadSearcher:nq,eventEmitter:void 0},nX=e=>{var t,{depth:r,node:a,index:n,dataKey:s,nameKey:i,nestedActiveTooltipIndex:o}=e,l=0===r?"":nY(n,o),{children:c}=a,d=r+1,u=c&&c.length?c.map((e,t)=>nX({depth:d,node:e,index:t,dataKey:s,nameKey:i,nestedActiveTooltipIndex:l})):null;return t=c&&c.length?u.reduce((e,t)=>e+t[nG],0):(0,H.isNan)(a[s])||a[s]<=0?0:a[s],nW(nW({},a),{},{children:u,name:(0,V.getValueByDataKey)(a,i,""),[nG]:t,depth:r,index:n,tooltipIndex:l})},nQ=(e,t,r)=>{var a=t*t,n=e.area*e.area,{min:s,max:i}=e.reduce((e,t)=>({min:Math.min(e.min,t.area),max:Math.max(e.max,t.area)}),{min:1/0,max:0});return n?Math.max(a*i*r/n,n/(a*s*r)):1/0},nJ=(e,t,r,a)=>t===r.width?((e,t,r,a)=>{var n,s=t?Math.round(e.area/t):0;(a||s>r.height)&&(s=r.height);for(var i=r.x,o=0,l=e.length;o<l;o++)(n=e[o]).x=i,n.y=r.y,n.height=s,n.width=Math.min(s?Math.round(n.area/s):0,r.x+r.width-i),i+=n.width;return n.width+=r.x+r.width-i,nW(nW({},r),{},{y:r.y+s,height:r.height-s})})(e,t,r,a):((e,t,r,a)=>{var n,s=t?Math.round(e.area/t):0;(a||s>r.width)&&(s=r.width);for(var i=r.y,o=0,l=e.length;o<l;o++)(n=e[o]).x=r.x,n.y=i,n.width=s,n.height=Math.min(s?Math.round(n.area/s):0,r.y+r.height-i),i+=n.height;return n&&(n.height+=r.y+r.height-i),nW(nW({},r),{},{x:r.x+s,width:r.width-s})})(e,t,r,a),n0=(e,t)=>{var{children:r}=e;if(r&&r.length){var a,n,s,i,o={x:e.x,y:e.y,width:e.width,height:e.height},l=[],c=1/0,d=Math.min(o.width,o.height),u=(n=(a=o.width*o.height/e[nG])<0?0:a,r.map(e=>{var t=e[nG]*n;return nW(nW({},e),{},{area:(0,H.isNan)(t)||t<=0?0:t})})),m=u.slice();for(l.area=0;m.length>0;)l.push(s=m[0]),l.area+=s.area,(i=nQ(l,d,t))<=c?(m.shift(),c=i):(l.area-=l.pop().area,d=Math.min((o=nJ(l,d,o,!1)).width,o.height),l.length=l.area=0,c=1/0);return l.length&&(o=nJ(l,d,o,!0),l.length=l.area=0),nW(nW({},e),{},{children:u.map(e=>n0(e,t))})}return e},n1={isAnimationFinished:!1,formatRoot:null,currentRoot:null,nestIndex:[]};function n2(e){var{content:t,nodeProps:r,type:a,colorPanel:n,onMouseEnter:s,onMouseLeave:i,onClick:o}=e;if(nT.isValidElement(t))return nT.createElement(P.Layer,{onMouseEnter:s,onMouseLeave:i,onClick:o},nT.cloneElement(t,r));if("function"==typeof t)return nT.createElement(P.Layer,{onMouseEnter:s,onMouseLeave:i,onClick:o},t(r));var{x:l,y:c,width:d,height:u,index:m}=r,p=null;d>10&&u>10&&r.children&&"nest"===a&&(p=nT.createElement(rz,{points:[{x:l+2,y:c+u/2},{x:l+6,y:c+u/2+3},{x:l+2,y:c+u/2+6}]}));var h=null,f=(0,nz.getStringSize)(r.name);d>20&&u>20&&f.width<d&&f.height<u&&(h=nT.createElement("text",{x:l+8,y:c+u/2+7,fontSize:14},r.name));var g=n||ra.COLOR_PANEL;return nT.createElement("g",null,nT.createElement(Y.Rectangle,nK({fill:r.depth<2?g[m%g.length]:"rgba(255,255,255,0)",stroke:"#fff"},(0,nR.default)(r,["children"]),{onMouseEnter:s,onMouseLeave:i,onClick:o,"data-recharts-item-index":r.tooltipIndex})),p,h)}function n5(e){var t=(0,ef.useAppDispatch)(),r=e.nodeProps?{x:e.nodeProps.x+e.nodeProps.width/2,y:e.nodeProps.y+e.nodeProps.height/2}:null;return nT.createElement(n2,nK({},e,{onMouseEnter:()=>{t((0,eg.setActiveMouseOverItemIndex)({activeIndex:e.nodeProps.tooltipIndex,activeDataKey:e.dataKey,activeCoordinate:r}))},onMouseLeave:()=>{},onClick:()=>{t((0,eg.setActiveClickItemIndex)({activeIndex:e.nodeProps.tooltipIndex,activeDataKey:e.dataKey,activeCoordinate:r}))}}))}function n3(e){var{props:t,currentRoot:r}=e,{dataKey:a,nameKey:n,stroke:s,fill:i}=t;return{dataDefinedOnItem:r,positions:void 0,settings:{stroke:s,strokeWidth:void 0,fill:i,dataKey:a,nameKey:n,name:void 0,hide:!1,type:void 0,color:i,unit:""}}
2}var n6={top:0,right:0,bottom:0,left:0};class n4 extends nT.PureComponent{constructor(){super(...arguments),nV(this,"state",nW({},n1)),nV(this,"handleAnimationEnd",()=>{var{onAnimationEnd:e}=this.props;this.setState({isAnimationFinished:!0}),"function"==typeof e&&e()}),nV(this,"handleAnimationStart",()=>{var{onAnimationStart:e}=this.props;this.setState({isAnimationFinished:!1}),"function"==typeof e&&e()}),nV(this,"handleTouchMove",(e,t)=>{var r=t.touches[0],a=document.elementFromPoint(r.clientX,r.clientY);if(a&&a.getAttribute){var n=a.getAttribute("data-recharts-item-index"),s=nq(this.state.formatRoot,n);if(s){var{dataKey:i,dispatch:o}=this.props,l={x:s.x+s.width/2,y:s.y+s.height/2};o((0,eg.setActiveMouseOverItemIndex)({activeIndex:n,activeDataKey:i,activeCoordinate:l}))}}})}static getDerivedStateFromProps(e,t){if(e.data!==t.prevData||e.type!==t.prevType||e.width!==t.prevWidth||e.height!==t.prevHeight||e.dataKey!==t.prevDataKey||e.aspectRatio!==t.prevAspectRatio){var r=nX({depth:0,node:{children:e.data,x:0,y:0,width:e.width,height:e.height},index:0,dataKey:e.dataKey,nameKey:e.nameKey}),a=n0(r,e.aspectRatio);return nW(nW({},t),{},{formatRoot:a,currentRoot:r,nestIndex:[r],prevAspectRatio:e.aspectRatio,prevData:e.data,prevWidth:e.width,prevHeight:e.height,prevDataKey:e.dataKey,prevType:e.type})}return null}handleMouseEnter(e,t){t.persist();var{onMouseEnter:r}=this.props;r&&r(e,t)}handleMouseLeave(e,t){t.persist();var{onMouseLeave:r}=this.props;r&&r(e,t)}handleClick(e){var{onClick:t,type:r}=this.props;if("nest"===r&&e.children){var{width:a,height:n,dataKey:s,nameKey:i,aspectRatio:o}=this.props,l=nX({depth:0,node:nW(nW({},e),{},{x:0,y:0,width:a,height:n}),index:0,dataKey:s,nameKey:i,nestedActiveTooltipIndex:e.tooltipIndex}),c=n0(l,o),{nestIndex:d}=this.state;d.push(e),this.setState({formatRoot:c,currentRoot:l,nestIndex:d})}t&&t(e)}handleNestIndex(e,t){var{nestIndex:r}=this.state,{width:a,height:n,dataKey:s,nameKey:i,aspectRatio:o}=this.props,l=n0(nX({depth:0,node:nW(nW({},e),{},{x:0,y:0,width:a,height:n}),index:0,dataKey:s,nameKey:i,nestedActiveTooltipIndex:e.tooltipIndex}),o);r=r.slice(0,t+1),this.setState({formatRoot:l,currentRoot:e,nestIndex:r})}renderItem(e,t,r){var{isAnimationActive:a,animationBegin:n,animationDuration:s,animationEasing:i,isUpdateAnimationActive:o,type:l,animationId:c,colorPanel:d,dataKey:u}=this.props,{isAnimationFinished:m}=this.state,{width:p,height:h,x:f,y:g,depth:y}=t,x=parseInt("".concat((2*Math.random()-1)*p),10),v={};return((r||"nest"===l)&&(v={onMouseEnter:this.handleMouseEnter.bind(this,t),onMouseLeave:this.handleMouseLeave.bind(this,t),onClick:this.handleClick.bind(this,t)}),a)?nT.createElement(O.Animate,{begin:n,duration:s,isActive:a,easing:i,key:"treemap-".concat(c),from:{x:f,y:g,width:p,height:h},to:{x:f,y:g,width:p,height:h},onAnimationStart:this.handleAnimationStart,onAnimationEnd:this.handleAnimationEnd},r=>{var{x:c,y:p,width:h,height:f}=r;return nT.createElement(O.Animate,{from:"translate(".concat(x,"px, ").concat(x,"px)"),to:"translate(0, 0)",attributeName:"transform",begin:n,easing:i,isActive:a,duration:s},nT.createElement(P.Layer,v,y>2&&!m?null:nT.createElement(n5,{content:e,dataKey:u,nodeProps:nW(nW({},t),{},{isAnimationActive:a,isUpdateAnimationActive:!o,width:h,height:f,x:c,y:p}),type:l,colorPanel:d})))}):nT.createElement(P.Layer,v,nT.createElement(n5,{content:e,dataKey:u,nodeProps:nW(nW({},t),{},{isAnimationActive:!1,isUpdateAnimationActive:!1,width:p,height:h,x:f,y:g}),type:l,colorPanel:d}))}renderNode(e,t){var{content:r,type:a}=this.props,n=nW(nW(nW({},(0,k.filterProps)(this.props,!1)),t),{},{root:e}),s=!t.children||!t.children.length,{currentRoot:i}=this.state;return!(i.children||[]).filter(e=>e.depth===t.depth&&e.name===t.name).length&&e.depth&&"nest"===a?null:nT.createElement(P.Layer,{key:"recharts-treemap-node-".concat(n.x,"-").concat(n.y,"-").concat(n.name),className:"recharts-treemap-depth-".concat(t.depth)},this.renderItem(r,n,s),t.children&&t.children.length?t.children.map(e=>this.renderNode(t,e)):null)}renderAllNodes(){var{formatRoot:e}=this.state;return e?this.renderNode(e,e):null}renderNestIndex(){var{nameKey:e,nestIndexContent:t}=this.props,{nestIndex:r}=this.state;return nT.createElement("div",{className:"recharts-treemap-nest-index-wrapper",style:{marginTop:"8px",textAlign:"center"}},r.map((r,a)=>{var n=(0,tF.default)(r,e,"root"),s=null;return nT.isValidElement(t)&&(s=nT.cloneElement(t,r,a)),s="function"==typeof t?t(r,a):n,nT.createElement("div",{onClick:this.handleNestIndex.bind(this,r,a),key:"nest-index-".concat((0,H.uniqueId)()),className:"recharts-treemap-nest-index-box",style:{cursor:"pointer",display:"inline-block",padding:"0 7px",background:"#000",color:"#fff",marginRight:"3px"}},s)}))}render(){var e=this.props,{width:t,height:r,className:a,style:n,children:s,type:i}=e,o=function(e,t){if(null==e)return{};var r,a,n=function(e,t){if(null==e)return{};var r={};for(var a in e)if(({}).hasOwnProperty.call(e,a)){if(-1!==t.indexOf(a))continue;r[a]=e[a]}return r}(e,t);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(a=0;a<s.length;a++)r=s[a],-1===t.indexOf(r)&&({}).propertyIsEnumerable.call(e,r)&&(n[r]=e[r])}return n}(e,n$),l=(0,k.filterProps)(o,!1);return nT.createElement(nF.TooltipPortalContext.Provider,{value:this.state.tooltipPortal},nT.createElement(eb.SetTooltipEntrySettings,{fn:n3,args:{props:this.props,currentRoot:this.state.currentRoot}}),nT.createElement(nU.RechartsWrapper,{className:a,style:n,width:t,height:r,ref:e=>{null==this.state.tooltipPortal&&this.setState({tooltipPortal:e})},onMouseEnter:void 0,onMouseLeave:void 0,onClick:void 0,onMouseMove:void 0,onMouseDown:void 0,onMouseUp:void 0,onContextMenu:void 0,onDoubleClick:void 0,onTouchStart:void 0,onTouchMove:this.handleTouchMove,onTouchEnd:void 0},nT.createElement(n_.Surface,nK({},l,{width:t,height:"nest"===i?r-30:r}),this.renderAllNodes(),s),"nest"===i&&this.renderNestIndex()))}}function n7(e){var t=(0,ef.useAppDispatch)();return nT.createElement(n4,nK({},e,{dispatch:t}))}function n8(e){var t,{width:r,height:a}=e;return(0,eI.isPositiveNumber)(r)&&(0,eI.isPositiveNumber)(a)?nT.createElement(rv.RechartsStoreProvider,{preloadedState:{options:nZ},reduxStoreName:null!=(t=e.className)?t:"Treemap"},nT.createElement(eS.ReportChartSize,{width:r,height:a}),nT.createElement(eS.ReportChartMargin,{margin:n6}),nT.createElement(n7,e)):null}nV(n4,"displayName","Treemap"),nV(n4,"defaultProps",{aspectRatio:.5*(1+Math.sqrt(5)),dataKey:"value",nameKey:"name",type:"flat",isAnimationActive:!W.Global.isSsr,isUpdateAnimationActive:!W.Global.isSsr,animationBegin:0,animationDuration:1500,animationEasing:"linear"});var n9=e.i(756902),se=e.i(976835),st=e.i(879812);let sr={default:[st.theme.colors.primary[500],st.theme.colors.purple[500],st.theme.colors.success[500],st.theme.colors.warning[500],st.theme.colors.orange[500],st.theme.colors.danger[500]],business:[st.theme.colors.primary[800],st.theme.colors.teal[700],st.theme.colors.info[600],st.theme.colors.purple[600],st.theme.colors.danger[600],st.theme.colors.orange[600]],growth:[st.theme.colors.teal[600],st.theme.colors.teal[700],st.theme.colors.teal[800],st.theme.colors.teal[900],st.theme.colors.teal[950],st.theme.colors.success[950]],funding:[st.theme.colors.purple[700],st.theme.colors.primary[800],st.theme.colors.primary[700],st.theme.colors.primary[600],st.theme.colors.primary[500],st.theme.colors.primary[400]],warning:[st.theme.colors.warning[500],st.theme.colors.orange[500],st.theme.colors.danger[500],st.theme.colors.danger[600],st.theme.colors.danger[700],st.theme.colors.danger[800]],success:[st.theme.colors.teal[700],st.theme.colors.teal[600],st.theme.colors.teal[500],st.theme.colors.teal[400],st.theme.colors.teal[300],st.theme.colors.success[100]],gradient:[st.theme.colors.primary[400],st.theme.colors.purple[400],st.theme.colors.orange[300],st.theme.colors.danger[400],st.theme.colors.info[400],st.theme.colors.teal[500]]},sa=({active:e,payload:t,label:r,currency:n,percentage:s})=>e&&t&&t.length?(0,a.jsxs)("div",{className:"max-w-xs rounded-lg border border-gray-200 bg-base-white p-3",children:[(0,a.jsx)("p",{className:"mb-2 truncate text-sm font-semibold text-gray-900",children:r}),t.map((e,t)=>(0,a.jsxs)("div",{className:"mb-1 flex items-center justify-between gap-3 last:mb-0",children:[(0,a.jsxs)("div",{className:"flex min-w-0 flex-1 items-center gap-2",children:[(0,a.jsx)("div",{className:"h-3 w-3 flex-shrink-0 rounded-full",style:{backgroundColor:e.color}}),(0,a.jsx)("span",{className:"truncate text-sm text-gray-700",children:e.name})]}),(0,a.jsx)("span",{className:"flex-shrink-0 text-sm font-medium text-gray-900",children:n?`$${e.value.toLocaleStr
2ing()}`:s?`${e.value}%`:e.value.toLocaleString()})]},t))]}):null,sn=(e,t,r)=>t?`$${e.toLocaleString()}`:r?`${e}%`:e.toLocaleString();e.s(["ChatChart",0,({config:e,className:t})=>{let r=sr[e.colorPalette]||sr.default,n=(0,w.useIsMobile)(),s=n?{top:10,right:10,left:10,bottom:30}:{top:20,right:30,left:20,bottom:20},i=n?10:12,l=n?5:10,c=(0,m.useMemo)(()=>{if(e.hasCategories){let t=e.data.reduce((e,t)=>{let r=t.category||"Default";return e[r]||(e[r]=[]),e[r].push(t),e},{});return[...new Set(e.data.map(e=>e.name))].map(e=>{let r={name:e};return Object.keys(t).forEach(a=>{let n=t[a].find(t=>t.name===e);r[a]=n?.value||0}),r})}return e.data.map(e=>({name:e.name,value:e.value,percentage:e.percentage,date:e.date}))},[e.data,e.hasCategories]);return(0,a.jsxs)("div",{className:(0,o.cn)("w-full rounded-lg border border-gray-200 bg-base-white p-2 sm:p-4",t),"data-sentry-component":"ChatChart","data-sentry-source-file":"ChatChart.tsx",children:[(0,a.jsxs)("div",{className:"mb-2 sm:mb-4",children:[(0,a.jsx)("h3",{className:"truncate text-base font-semibold text-gray-900 sm:text-lg",children:e.title}),e.subtitle&&(0,a.jsx)("p",{className:"mt-1 line-clamp-2 text-xs text-gray-600 sm:text-sm",children:e.subt
2itle})]}),(0,a.jsx)("div",{style:{width:"100%",height:n?Math.min(e.height,300):e.height},children:(0,a.jsx)(nn.ResponsiveContainer,{width:"100%",height:"100%","data-sentry-element":"ResponsiveContainer","data-sentry-source-file":"ChatChart.tsx",children:(()=>{let t={data:c,margin:s};switch(e.type){case"line":return(0,a.jsxs)(t_,{...t,children:[e.showGrid&&(0,a.jsx)(ti.CartesianGrid,{strokeDasharray:"3 3",stroke:st.theme.colors.gray[200]}),(0,a.jsx)(n9.XAxis,{dataKey:"name",stroke:st.theme.colors.gray[500],fontSize:i,tickFormatter:e=>e.length>l?`${e.slice(0,l)}...`:e}),(0,a.jsx)(se.YAxis,{stroke:st.theme.colors.gray[500],fontSize:i,tickFormatter:t=>sn(t,e.currency,e.percentage)}),(0,a.jsx)(nL.Tooltip,{content:(0,a.jsx)(sa,{currency:e.currency,percentage:e.percentage})}),e.showLegend&&(0,a.jsx)(to.Legend,{}),e.hasCategories?Object.keys(c[0]||{}).filter(e=>"name"!==e).map((t,n)=>(0,a.jsx)(tT,{type:e.smooth?"monotone":"linear",dataKey:t,stroke:r[n%r.length],strokeWidth:2,dot:{fill:r[n%r.length],strokeWidth:2,r:4},activeDot:{r:6},animationDuration:1e3*!!e.animated},t)):(0,a.jsx)(tT,{type:e.smooth?"monotone":"linear",dataKey:"value",stroke:r[0],strokeWidth:2,dot:{fill:r[0],strokeWidth:2,r:4},activeDot:{r:6},animationDuration:1e3*!!e.animated}),e.trend&&(0,a.jsx)(na,{stroke:st.theme.colors.warning[500],strokeDasharray:"5 5",strokeWidth:1})]});case"bar":return(0,a.jsxs)(ts,{...t,children:[e.showGrid&&(0,a.jsx)(ti.CartesianGrid,{strokeDasharray:"3 3",stroke:st.theme.colors.gray[200]}),(0,a.jsx)(n9.XAxis,{dataKey:"name",stroke:st.theme.colors.gray[500],fontSize:i,angle:c.length>5?-45:0,textAnchor:c.length>5?"end":"middle",height:c.length>5?n?60:80:n?40:60,tickFormatter:e=>e.length>l?`${e.slice(0,l)}...`:e}),(0,a.jsx)(se.YAxis,{stroke:st.theme.colors.gray[500],fontSize:i,tickFormatter:t=>sn(t,e.currency,e.percentage)}),(0,a.jsx)(nL.Tooltip,{content:(0,a.jsx)(sa,{currency:e.currency,percentage:e.percentage})}),e.showLegend&&(0,a.jsx)(to.Legend,{}),e.hasCategories?Object.keys(c[0]||{}).filter(e=>"name"!==e).map((t,n)=>(0,a.jsx)(tt,{dataKey:t,fill:r[n%r.length],stackId:e.stacked?"stack":void 0,animationDuration:1e3*!!e.animated,radius:[2,2,0,0]},t)):(0,a.jsx)(tt,{dataKey:"value",fill:r[0],animationDuration:1e3*!!e.animated,radius:[2,2,0,0],children:c.map((e,t)=>(0,a.jsx)($,{fill:r[t%r.length]},`cell-${t}`))})]});case"area":return(0,a.jsxs)(C.AreaChart,{...t,children:[e.showGrid&&(0,a.jsx)(ti.CartesianGrid,{strokeDasharray:"3 3",stroke:st.theme.colors.gray[200]}),(0,a.jsx)(n9.XAxis,{dataKey:"name",stroke:st.theme.colors.gray[500],fontSize:i,tickFormatter:e=>e.length>l?`${e.slice(0,l)}...`:e}),(0,a.jsx)(se.YAxis,{stroke:st.theme.colors.gray[500],fontSize:i,tickFormatter:t=>sn(t,e.currency,e.percentage)}),(0,a.jsx)(nL.Tooltip,{content:(0,a.jsx)(sa,{currency:e.currency,percentage:e.percentage})}),e.showLegend&&(0,a.jsx)(to.Legend,{}),e.hasCategories?Object.keys(c[0]||{}).filter(e=>"name"!==e).map((t,n)=>(0,a.jsx)(j.Area,{type:e.smooth?"monotone":"linear",dataKey:t,stackId:e.stacked?"stack":void 0,stroke:r[n%r.length],fill:r[n%r.length],fillOpacity:.3,animationDuration:1e3*!!e.animated},t)):(0,a.jsx)(j.Area,{type:e.smooth?"monotone":"linear",dataKey:"value",stroke:r[0],fill:r[0],fillOpacity:.3,animationDuration:1e3*!!e.animated})]});case"pie":case"doughnut":return(0,a.jsxs)(rO,{...t,children:[(0,a.jsx)(rx,{data:c,dataKey:"value",nameKey:"name",cx:"50%",cy:"50%",innerRadius:60*("doughnut"===e.type),outerRadius:100,animationDuration:1e3*!!e.animated,label:!1,children:c.map((e,t)=>(0,a.jsx)($,{fill:r[t%r.length]},`cell-${t}`))}),(0,a.jsx)(nL.Tooltip,{content:(0,a.jsx)(sa,{currency:e.currency,percentage:e.percentage})}),e.showLegend&&!(n&&"doughnut"===e.type)&&(0,a.jsx)(to.Legend,{})]});case"scatter":return(0,a.jsxs)(nD,{...t,children:[e.showGrid&&(0,a.jsx)(ti.CartesianGrid,{strokeDasharray:"3 3",stroke:st.theme.colors.gray[200]}),(0,a.jsx)(n9.XAxis,{dataKey:"name",stroke:st.theme.colors.gray[500],fontSize:i}),(0,a.jsx)(se.YAxis,{stroke:st.theme.colors.gray[500],fontSize:i,tickFormatter:t=>sn(t,e.currency,e.percentage)}),(0,a.jsx)(nL.Tooltip,{content:(0,a.jsx)(sa,{currency:e.currency,percentage:e.percentage})}),e.showLegend&&(0,a.jsx)(to.Legend,{}),e.hasCategories?Object.keys(c[0]||{}).filter(e=>"name"!==e).map((t,n)=>(0,a.jsx)(nO,{dataKey:t,fill:r[n%r.length],animationDuration:1e3*!!e.animated},t)):(0,a.jsx)(nO,{dataKey:"value",fill:r[0],animationDuration:1e3*!!e.animated,children:c.map((e,t)=>(0,a.jsx)($,{fill:r[t%r.length]},`cell-${t}`))})]});case"radar":return(0,a.jsxs)(a1,{data:c,children:[(0,a.jsx)(ao,{}),(0,a.jsx)(r4,{dataKey:"name",fontSize:i}),(0,a.jsx)(aC,{angle:90,domain:[0,Math.max(...c.map(t=>e.hasCategories?Math.max(...Object.values(t).filter(e=>"number"==typeof e)):t.value||0))],fontSize:i-2}),e.hasCategories?Object.keys(c[0]||{}).filter(e=>"name"!==e).map((t,n)=>(0,a.jsx)(aQ,{dataKey:t,stroke:r[n%r.length],fill:r[n%r.length],fillOpacity:.2,animationDuration:1e3*!!e.animated},t)):(0,a.jsx)(aQ,{dataKey:"value",stroke:r[0],fill:r[0],fillOpacity:.3,animationDuration:1e3*!!e.animated}),(0,a.jsx)(nL.Tooltip,{content:(0,a.jsx)(sa,{currency:e.currency,percentage:e.percentage})}),e.showLegend&&(0,a.jsx)(to.Legend,{})]});case"treemap":return(0,a.jsx)(n8,{data:c,dataKey:"value",stroke:st.theme.colors.base.white,animationDuration:1e3*!!e.animated,content:e=>{let{x:t,y:n,width:s,height:i,name:o,value:l,index:c}=e,d=s<60||i<40,u=r[c%r.length];return(0,a.jsxs)("g",{children:[(0,a.jsx)("rect",{x:t,y:n,width:s,height:i,fill:u,stroke:st.theme.colors.base.white,strokeWidth:1}),!d&&(0,a.jsxs)(a.Fragment,{children:[(0,a.jsx)("text",{x:t+s/2,y:n+i/2-6,textAnchor:"middle",dominantBaseline:"middle",fill:"#ffffff",fontSize:Math.min(13,s/5,i/3.5),children:o}),(0,a.jsx)("text",{x:t+s/2,y:n+i/2+8,textAnchor:"middle",dominantBaseline:"middle",fill:"#ffffff",fontSize:Math.min(11,s/7,i/4.5),children:l})]})]})}});default:return(0,a.jsx)("div",{className:"flex h-full items-center justify-center text-gray-500",children:(0,a.jsxs)("p",{children:['Chart type "',e.type,'" not yet implemented']})})}})()})}),(0,a.jsx)("div",{className:"mt-2 border-t border-gray-100 pt-2 sm:mt-4 sm:pt-3",children:(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 text-xs text-gray-500 sm:gap-4",children:[(0,a.jsxs)("span",{children:["Data points: ",e.data.length]}),e.currency&&(0,a.jsxs)("span",{className:"truncate",children:["Total: $",e.data.reduce((e,t)=>
2e+t.value,0).toLocaleString()]}),e.percentage&&(0,a.jsxs)("span",{children:["Avg:"," ",(e.data.reduce((e,t)=>e+t.value,0)/e.data.length).toFixed(1),"%"]}),(0,a.jsxs)("span",{className:"hidden text-xs text-gray-400 sm:inline",children:["Generated: ",new Date().toLocaleDateString()]})]})})]})}],135242);var ss=e.i(304130),si=e.i(178644),so=e.i(771371);e.i(804690),e.i(127302);var sl=((r={}).ADD_BUSINESS="ADD_BUSINESS",r.AI_FEEDBACK="AI_FEEDBACK",r.AI_FEEDBACK_GRANT="AI_FEEDBACK_GRANT",r);e.s(["ChatDataEntry",0,({flow:e,label:t})=>{let r=(0,so.useTypeformModal)();if(!e||!t)return console.warn("ChatDataEntry: both flow and label are required"),null;if("string"!=typeof e||"string"!=typeof t)return console.error("ChatDataEntry: flow and label must be strings, received:",typeof e,typeof t),null;if(!Object.values(sl).includes(e))return console.error("ChatDataEntry: invalid flow value. Must be one of:",Object.values(sl),"received:",e),null;let n=async()=>{try{switch(e){case"ADD_BUSINESS":(0,ss.goToAddBusiness)();break;case"AI_FEEDBACK_GRANT":try{await r("https://form.typeform.com/to/kBSdTAn0#email={{email}}"),si.currentAiChatActions.sendMessage("I've finished with the feedback")}catch(e){console.log("AI feedback instant grant cancelled or failed:",e),si.currentAiChatActions.sendMessage("I've finished with the feedback")}break;case"AI_FEEDBACK":try{await r("https://form.typeform.com/to/bT7kRoRY#email={{email}}"),si.currentAiChatActions.sendMessage("I've finished with the feedback")}catch(e){console.log("AI feedback cancelled or failed:",e),si.currentAiChatActions.sendMessage("I've finished with the feedback")}break;default:console.error("ChatDataEntry: unhandled flow:",e),si.currentAiChatActions.sendMessage("I've cancelled the data insertion")}}catch(e){console.error("ChatDataEntry: Error handling data entry click:",e),si.currentAiChatActions.sendMessage("I've cancelled the data insertion")}};return(0,a.jsx)(f.Button,{variant:"secondary",size:"sm",onClick:n,className:"mr-2 inline-flex items-center gap-2 bg-white",style:{fontSize:"16px"},"data-sentry-element":"Button","data-sentry-component":"ChatDataEntry","data-sentry-source-file":"ChatDataEntry.tsx",children:t})}],957097);var sc=e.i(275885),sd=e.i(189461),su=e.i(572361),sm=e.i(123436),sp=e.i(525695);e.s(["ChatEmailCapture",0,({label:e="Enter your email",placeholder:t="[email protected]",submitLabel:r="Send"})=>{let[i,o]=(0,m.useState)(""),[l,c]=(0,m.useState)(!1),[d,u]=(0,m.useState)(!1),[p,h]=(0,m.useState)(null),g=(0,m.useMemo)(()=>sm.$aiChatConversationId.get(),[]),y=(0,n.useStore)(sm.$aiChatConversationUserId),x=(0,m.useMemo)(()=>(0,sd.validateEmail)(i)&&!l&&!!g,[i,l,g]),v=sp.trpc.aiChat.saveInquiryEmail.useMutation(),b=(0,m.useCallback)(async()=>{if(h(null),x){if(!g)return void h("Not able to save your email right now.");try{c(!0),await v.mutateAsync({conversationId:g,email:i.trim()}),si.currentAiChatActions.sendMessage(`I've provided my email \xa7 hidden: (${i.trim()}) \xa7`),u(!0)}catch(e){console.error("Failed to save inquiry email",e),sc.captureException(e),h("Something went wrong. Please try again.")}finally{c(!1)}}},[x,g,i,v]);return y||d?null:(0,a.jsxs)("div",{className:"w-full max-w-[360px]","data-sentry-component":"ChatEmailCapture","data-sentry-source-file":"ChatEmailCapture.tsx",children:[(0,a.jsx)(su.Input,{"data-sentry-element":"Input","data-sentry-source-file":"ChatEmailCapture.tsx",children:(0,a.jsxs)(su.Input.Container,{className:"h-[52px] rounded-[10px] border-[#576072] px-[14px] py-[10px] shadow-sm",size:"lg","data-sentry-element":"Input.Container","data-sentry-source-file":"ChatEmailCapture.tsx",children:[(0,a.jsx)(su.Input.Field,{type:"email",inputMode:"email",value:i,onChange:e=>o(e.target.value),placeholder:t,"aria-label":e,disabled:l,className:"text-[16px] leading-6 text-[#212429] placeholder:text-gray-500",onKeyDown:e=>{"Enter"===e.key&&x&&b()},"data-sentry-element":"Input.Field","data-sentry-source-file":"ChatEmailCapture.tsx"}),(0,a.jsx)(su.Input.Right,{"data-sentry-element":"Input.Right","data-sentry-source-file":"ChatEmailCapture.tsx",children:(0,a.jsx)(f.Button,{disabled:!x,onClick:b,variant:"neutral",size:"xs",icon:!0,className:"h-8 w-8 rounded-full","aria-label":r,"data-sentry-element":"Button","data-sentry-source-file":"ChatEmailCapture.tsx",children:(0,a.jsx)(s.HugeIcon,{name:"ArrowUp02Icon",className:"h-4 w-4","data-sentry-element":"HugeIcon","data-sentry-source-file":"ChatEmailCapture.tsx"})})})]})}),p?(0,a.jsx)("div",{className:"mt-1 text-xs text-red-600",children:p}):null]})}],211314);var sh=e.i(984965),sf=e.i(572765),sg=e.i(407654),sy=e.i(85506);e.s(["ChatOpportunityCard",0,({fundingId:e})=>{let[t,r]=(0,m.useState)(!0);(0,m.useEffect)(()=>{r(!0),(0,sh.fetchSingleOpportunity)(e).catch(console.error).finally(()=>r(!1))},[e]);
2let s=(0,n.useStore)(sh.$fundingOpportunities),i=(0,n.useStore)(l.$aiChatDebugTools),{funding:o,loading:c,error:d}=(0,m.useMemo)(()=>{if(!e)return console.error("ChatOpportunityCard: fundingId is required"),{funding:null,loading:!1,error:"Invalid funding ID"};if(s.isLoading||t)return{funding:null,loading:!0,error:null};let r=s.value?.find(t=>t._id===e);return r?{funding:r,loading:!1,error:null}:(console.error("ChatOpportunityCard: Funding not found:",e),{funding:null,loading:!1,error:i?`Funding opportunity not found ${e}`:null})},[e,s,i,t]);return c?(0,a.jsxs)("div",{className:"relative flex w-[254px] [&>div]:min-h-0",children:[(0,a.jsx)(sf.OpportunityCard,{funding:sf.mockFunding}),(0,a.jsx)("div",{className:"absolute left-0 top-0 h-full w-full bg-white",children:(0,a.jsxs)("div",{className:"flex h-full w-full animate-pulse flex-col rounded-2xl bg-gray-100 transition-opacity",children:[(0,a.jsx)("div",{className:"w-full flex-1 rounded-t-2xl bg-gray-200"}),(0,a.jsxs)("div",{className:"w-full flex-1 space-y-2 p-4",children:[(0,a.jsx)("div",{className:"h-4 rounded bg-gray-200"}),(0,a.jsx)("div",{className:"h-4 w-3/4 rounded bg-gray-200"})]})]})})]}):d||!o?i&&(0,a.jsx)("div",{className:"rounded-2xl border border-red-200 bg-red-50 p-4 text-center",children:(0,a.jsx)("p",{className:"text-sm text-red-600",children:d||"Unable to load opportunity"})}):(0,a.jsx)("div",{className:"flex w-[254px] [&>div]:min-h-0","data-sentry-component":"ChatOpportunityCard","data-sentry-source-file":"ChatOpportunityCard.tsx",children:(0,a.jsx)(sf.OpportunityCard,{funding:o,onClick:()=>{(0,y.openModalSync)({id:"funding-application-details",options:{fullscreen:!0},content:(0,a.jsxs)("div",{className:"max-w-[600px] p-4 font-inter md:p-8",children:[(0,a.jsx)("h2",{className:"font-inter-display text-h7 font-semibold md:text-h6",children:"Details"}),(0,a.jsx)("hr",{className:"my-4 border-gray-100 md:my-6"}),(0,a.jsx)(sg.default,{components:sy.markdownComponents,children:o.additionalInfo?.replace(/<br\s*\/?>/g,"\n")})]})})},"data-sentry-element":"OpportunityCard","data-sentry-source-file":"ChatOpportunityCard.tsx"})})}],747732)},359250,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.maxBy=function(e,t){if(0===e.length)return;let r=e[0],a=t(r);for(let n=1;n<e.length;n++){let s=e[n],i=t(s);i>a&&(a=i,r=s)}return r}},159629,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let a=e.r(467341);r.getSymbolsIn=function(e){let t=[];for(;e;)t.push(...a.getSymbols(e)),e=Object.getPrototypeOf(e);return t}},29300,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let a=e.r(232040);r.flatten=function(e,t=1){let r=[],n=Math.floor(t);if(!a.isArrayLike(e))return r;let s=(e,t)=>{for(let a=0;a<e.length;a++){let i=e[a];t<n&&(Array.isArray(i)||i?.[Symbol.isConcatSpreadable]||null!==i&&"object"==typeof i&&"[object Arguments]"===Object.prototype.toString.call(i))?Array.isArray(i)?s(i,t+1):s(Array.from(i),t+1):r.push(i)}};return s(Array.from(e),0),r}},71917,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let a=e.r(828021),n=e.r(254663),s=e.r(339978),i=e.r(159629),o=e.r(819206),l=e.r(29300),c=e.r(824188);r.omit=function(e,...t){var r;if(null==e)return{};let d=(r=e,(t=l.flatten(t)).some(e=>Array.isArray(e)||o.isDeepKey(e))?function(e){let t={},r=[...n.keysIn(e),...i.getSymbolsIn(e)];for(let n=0;n<r.length;n++){let s=r[n];t[s]=a.cloneDeepWith(e[s],e=>{if(!c.isPlainObject(e))return e})}return t}(r):function(e){let t={},r=[...n.keysIn(e),...i.getSymbolsIn(e)];for(let a=0;a<r.length;a++){let n=r[a];t[n]=e[n]}return t}(r));for(let e=0;e<t.length;e++){let r=t[e];switch(typeof r){case"object":Array.isArray(r)||(r=Array.from(r));for(let e=0;e<r.length;e++){let t=r[e];s.unset(d,t)}break;case"string":case"symbol":case"number":s.unset(d,r)}}return d}},337174,(e,t,r)=>{t.exports=e.r(71917).omit},446106,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let a=e.r(359250),n=e.r(387022),s=e.r(20972);r.maxBy=function(e,t){if(null!=e)return a.maxBy(Array.from(e),s.iteratee(t??n.identity))}},767577,(e,t,r)=>{t.exports=e.r(446106).maxBy},805294,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.minBy=function(e,t){if(0===e.length)return;let r=e[0],a=t(r);for(let n=1;n<e.length;n++){let s=e[n],i=t(s);i<a&&(a=i,r=s)}return r}},972745,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let a=e.r(805294),n=e.r(387022),s=e.r(20972);r.minBy=function(e,t){if(null!=e)return a.minBy(Array.from(e),s.iteratee(t??n.identity))}},152555,(e,t,r)=>{t.exports=e.r(972745).minBy},339978,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let a=e.r(461119),n=e.r(568716),s=e.r(819206),i=e.r(810613),o=e.r(323247);function l(e,t){let r=1===t.length?e:a.get(e,t.slice(0,-1)),s=t[t.length-1];if(r?.[s]===void 0)return!0;
2if(n.isUnsafeProperty(s))return!1;try{return delete r[s],!0}catch{return!1}}r.unset=function(e,t){if(null==e)return!0;switch(typeof t){case"symbol":case"number":case"object":if(Array.isArray(t))return l(e,t);if("number"==typeof t?t=i.toKey(t):"object"==typeof t&&(t=Object.is(t?.valueOf(),-0)?"-0":String(t)),n.isUnsafeProperty(t))return!1;if(e?.[t]===void 0)return!0;try{return delete e[t],!0}catch{return!1}case"string":if(e?.[t]===void 0&&s.isDeepKey(t))return l(e,o.toPath(t));if(n.isUnsafeProperty(t))return!1;try{return delete e[t],!0}catch{return!1}}}},824188,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.isPlainObject=function(e){if("object"!=typeof e||null==e)return!1;if(null===Object.getPrototypeOf(e))return!0;if("[object Object]"!==Object.prototype.toString.call(e)){let t=e[Symbol.toStringTag];return null!=t&&!!Object.getOwnPropertyDescriptor(e,Symbol.toStringTag)?.writable&&e.toString()===`[object ${t}]`}let t=e;for(;null!==Object.getPrototypeOf(t);)t=Object.getPrototypeOf(t);return Object.getPrototypeOf(e)===t}},322258,(e,t,r)=>{t.exports=e.r(824188).isPlainObject},72852,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let a=e.r(181825);r.isTypedArray=function(e){return a.isTypedArray(e)}},690071,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let a=e.r(877115);r.toInteger=function(e){let t=a.toFinite(e),r=t%1;return r?t-r:t}},252532,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let a=e.r(690071);r.times=function(e,t){if((e=a.toInteger(e))<1||!Number.isSafeInteger(e))return[];let r=Array(e);for(let a=0;a<e;a++)r[a]="function"==typeof t?t(a):a;return r}},254663,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"});let a=e.r(857006),n=e.r(857811),s=e.r(232040),i=e.r(72852),o=e.r(252532);function l(e){let t=[];for(let r in e)t.push(r);return t}r.keysIn=function(e){if(null==e)return[];switch(typeof e){case"object":case"function":if(s.isArrayLike(e)){var t;let r,n,s;return t=e,n=new Set(r=o.times(t.length,e=>`${e}`)),a.isBuffer(t)&&(n.add("offset"),n.add("parent")),i.isTypedArray(t)&&(n.add("buffer"),n.add("byteLength"),n.add("byteOffset")),s=l(t).filter(e=>!n.has(e)),Array.isArray(t)?[...r,...s]:[...r.filter(e=>Object.hasOwn(t,e)),...s]}if(n.isPrototype(e))return l(e).filter(e=>"constructor"!==e);return l(e);default:return l(Object(e))}}},857006,(e,t,r)=>{"use strict";var a=e.i(221168);Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.isBuffer=function(e){return void 0!==a.Buffer&&a.Buffer.isBuffer(e)}},857811,(e,t,r)=>{"use strict";Object.defineProperty(r,Symbol.toStringTag,{value:"Module"}),r.isPrototype=function(e){let t=e?.constructor;return e===("function"==typeof t?t.prototype:Object.prototype)}},115266,95495,871292,789347,647289,200280,214115,e=>{"use strict";var t=e.i(191788);let r=t.createContext(null);var a=e.i(350461);function n(e,t){if(e===t)return!0;if(!e||!t)return!1;if(Array.isArray(e)){if(!Array.isArray(t)||e.length!==t.length)return!1;for(let r=0;r<e.length;r++)if(!n(e[r],t[r]))return!1;return!0}if(Array.isArray(t))return!1;if("object"==typeof e&&"object"==typeof t){let r=Object.keys(e),a=Object.keys(t);if(r.length!==a.length)return!1;for(let a of r)if(!t.hasOwnProperty(a)||!n(e[a],t[a]))return!1;return!0}return!1}function s(e,t){if(!e.getProjection)return;let r=e.getProjection();n(r,t.getProjection())||t.setProjection(r)}function i(e){return{longitude:e.center.lng,latitude:e.center.lat,zoom:e.zoom,pitch:e.pitch,bearing:e.bearing,padding:e.padding}}function o(e,t){let r=t.viewState||t,a=!1;if("zoom"in r){let t=e.zoom;e.zoom=r.zoom,a=a||t!==e.zoom}if("bearing"in r){let t=e.bearing;e.bearing=r.bearing,a=a||t!==e.bearing}if("pitch"in r){let t=e.pitch;e.pitch=r.pitch,a=a||t!==e.pitch}if(r.padding&&!e.isPaddingEqual(r.padding)&&(a=!0,e.padding=r.padding),"longitude"in r&&"latitude"in r){let t=e.center;e.center=new t.constructor(r.longitude,r.latitude),a=a||t!==e.center}return a}let l=["type","source","source-layer","minzoom","maxzoom","filter","layout"];function c(e){if(!e)return null;
2if("string"==typeof e||("toJS"in e&&(e=e.toJS()),!e.layers))return e;let t={};for(let r of e.layers)t[r.id]=r;let r=e.layers.map(e=>{let r=null;"interactive"in e&&(r=Object.assign({},e),delete r.interactive);let a=t[e.ref];if(a)for(let t of(r=r||Object.assign({},e),delete r.ref,l))t in a&&(r[t]=a[t]);return r||e});return{...e,layers:r}}let d={version:8,sources:{},layers:[]},u={mousedown:"onMouseDown",mouseup:"onMouseUp",mouseover:"onMouseOver",mousemove:"onMouseMove",click:"onClick",dblclick:"onDblClick",mouseenter:"onMouseEnter",mouseleave:"onMouseLeave",mouseout:"onMouseOut",contextmenu:"onContextMenu",touchstart:"onTouchStart",touchend:"onTouchEnd",touchmove:"onTouchMove",touchcancel:"onTouchCancel"},m={movestart:"onMoveStart",move:"onMove",moveend:"onMoveEnd",dragstart:"onDragStart",drag:"onDrag",dragend:"onDragEnd",zoomstart:"onZoomStart",zoom:"onZoom",zoomend:"onZoomEnd",rotatestart:"onRotateStart",rotate:"onRotate",rotateend:"onRotateEnd",pitchstart:"onPitchStart",pitch:"onPitch",pitchend:"onPitchEnd"},p={wheel:"onWheel",boxzoomstart:"onBoxZoomStart",boxzoomend:"onBoxZoomEnd",boxzoomcancel:"onBoxZoomCancel",resize:"onResize",load:"onLoad",render:"onRender",idle:"onIdle",remove:"onRemove",data:"onData",styledata:"onStyleData",sourcedata:"onSourceData",error:"onError"},h=["minZoom","maxZoom","minPitch","maxPitch","maxBounds","projection","renderWorldCopies"],f=["scrollZoom","boxZoom","dragRotate","dragPan","keyboard","doubleClickZoom","touchZoomRotate","touchPitch"];class g{constructor(e,t,r){this._map=null,this._internalUpdate=!1,this._inRender=!1,this._hoveredFeatures=null,this._deferredEvents={move:!1,zoom:!1,pitch:!1,rotate:!1},this._onEvent=e=>{let t=this.props[p[e.type]];t?t(e):"error"===e.type&&console.error(e.error)},this._onPointerEvent=e=>{("mousemove"===e.type||"mouseout"===e.type)&&this._updateHover(e);let t=this.props[u[e.type]];t&&(this.props.interactiveLayerIds&&"mouseover"!==e.type&&"mouseout"!==e.type&&(e.features=this._hoveredFeatures||this._queryRenderedFeatures(e.point)),t(e),delete e.features)},this._onCameraEvent=e=>{if(!this._internalUpdate){let t=this.props[m[e.type]];t&&t(e)}e.type in this._deferredEvents&&(this._deferredEvents[e.type]=!1)},this._MapClass=e,this.props=t,this._initialize(r)}get map(){return this._map}get transform(){return this._renderTransform}setProps(e){let t=this.props;this.props=e;let r=this._updateSettings(e,t);r&&this._createShadowTransform(this._map);let a=this._updateSize(e),n=this._updateViewState(e,!0);this._updateStyle(e,t),this._updateStyleComponents(e,t),this._updateHandlers(e,t),(r||a||n&&!this._map.isMoving())&&this.redraw()}static reuse(e,t){let r=g.savedMaps.pop();if(!r)return null;let a=r.map,n=a.getContainer();for(t.className=n.className;n.childNodes.length>0;)t.appendChild(n.childNodes[0]);a._container=t,r.setProps({...e,styleDiffing:!1}),a.resize();let{initialViewState:s}=e;return s&&(s.bounds?a.fitBounds(s.bounds,{...s.fitBoundsOptions,duration:0}):r._updateViewState(s,!1)),a.isStyleLoaded()?a.fire("load"):a.once("styledata",()=>a.fire("load")),a._update(),r}_initialize(e){let{props:t}=this,{mapStyle:r=d}=t,n={...t,...t.initialViewState,accessToken:t.mapboxAccessToken||function(){let e=null;if("u">typeof location){let t=/access_token=([^&\/]*)/.exec(location.search);e=t&&t[1]}try{e=e||a.default.env.MapboxAccessToken}catch{}try{e=e||a.default.env.REACT_APP_MAPBOX_ACCESS_TOKEN}catch{}return e}()||null,container:e,style:c(r)},i=n.initialViewState||n.viewState||n;if(Object.assign(n,{center:[i.longitude||0,i.latitude||0],zoom:i.zoom||0,pitch:i.pitch||0,bearing:i.bearing||0}),t.gl){let e=HTMLCanvasElement.prototype.getContext;HTMLCanvasElement.prototype.getContext=()=>(HTMLCanvasElement.prototype.getContext=e,t.gl)}let o=new this._MapClass(n);i.padding&&o.setPadding(i.padding),t.cursor&&(o.getCanvas().style.cursor=t.cursor),this._createShadowTransform(o);let l=o._render;o._render=e=>{this._inRender=!0,l.call(o,e),this._inRender=!1};let h=o._renderTaskQueue.run;o._renderTaskQueue.run=e=>{h.call(o._renderTaskQueue,e),this._onBeforeRepaint()},o.on("render",()=>this._onAfterRepaint());let f=o.fire;
2for(let e in o.fire=this._fireEvent.bind(this,f),o.on("resize",()=>{this._renderTransform.resize(o.transform.width,o.transform.height)}),o.on("styledata",()=>{this._updateStyleComponents(this.props,{}),s(o.transform,this._renderTransform)}),o.on("sourcedata",()=>this._updateStyleComponents(this.props,{})),u)o.on(e,this._onPointerEvent);for(let e in m)o.on(e,this._onCameraEvent);for(let e in p)o.on(e,this._onEvent);this._map=o}recycle(){let e=this.map.getContainer().querySelector("[mapboxgl-children]");e?.remove(),g.savedMaps.push(this)}destroy(){this._map.remove()}redraw(){let e=this._map;!this._inRender&&e.style&&(e._frame&&(e._frame.cancel(),e._frame=null),e._render())}_createShadowTransform(e){var t;let r,a=((r=(t=e.transform).clone()).pixelsToGLUnits=t.pixelsToGLUnits,r);e.painter.transform=a,this._renderTransform=a}_updateSize(e){let{viewState:t}=e;if(t){let e=this._map;if(t.width!==e.transform.width||t.height!==e.transform.height)return e.resize(),!0}return!1}_updateViewState(e,t){if(this._internalUpdate)return!1;let r=this._map,a=this._renderTransform,{zoom:n,pitch:s,bearing:l}=a,c=r.isMoving();c&&(a.cameraElevationReference="sea");let d=o(a,{...i(r.transform),...e});if(c&&(a.cameraElevationReference="ground"),d&&t){let e=this._deferredEvents;e.move=!0,e.zoom||(e.zoom=n!==a.zoom),e.rotate||(e.rotate=l!==a.bearing),e.pitch||(e.pitch=s!==a.pitch)}return c||o(r.transform,e),d}_updateSettings(e,t){let r=this._map,a=!1;for(let s of h)if(s in e&&!n(e[s],t[s])){a=!0;let t=r[`set${s[0].toUpperCase()}${s.slice(1)}`];t?.call(r,e[s])}return a}_updateStyle(e,t){if(e.cursor!==t.cursor&&(this._map.getCanvas().style.cursor=e.cursor||""),e.mapStyle!==t.mapStyle){let{mapStyle:t=d,styleDiffing:r=!0}=e,a={diff:r};return"localIdeographFontFamily"in e&&(a.localIdeographFontFamily=e.localIdeographFontFamily),this._map.setStyle(c(t),a),!0}return!1}_updateStyleComponents(e,t){let r=this._map,a=!1;return r.isStyleLoaded()&&("light"in e&&r.setLight&&!n(e.light,t.light)&&(a=!0,r.setLight(e.light)),"fog"in e&&r.setFog&&!n(e.fog,t.fog)&&(a=!0,r.setFog(e.fog)),"terrain"in e&&r.setTerrain&&!n(e.terrain,t.terrain)&&(!e.terrain||r.getSource(e.terrain.source))&&(a=!0,r.setTerrain(e.terrain))),a}_updateHandlers(e,t){let r=this._map,a=!1;for(let s of f){let i=e[s]??!0;n(i,t[s]??!0)||(a=!0,i?r[s].enable(i):r[s].disable())}return a}_queryRenderedFeatures(e){let t=this._map,r=t.transform,{interactiveLayerIds:a=[]}=this.props;try{return t.transform=this._renderTransform,t.queryRenderedFeatures(e,{layers:a.filter(t.getLayer.bind(t))})}catch{return[]}finally{t.transform=r}}_updateHover(e){let{props:t}=this;if(t.interactiveLayerIds&&(t.onMouseMove||t.onMouseEnter||t.onMouseLeave)){let t=e.type,r=this._hoveredFeatures?.length>0,a=this._queryRenderedFeatures(e.point),n=a.length>0;!n&&r&&(e.type="mouseleave",this._onPointerEvent(e)),this._hoveredFeatures=a,n&&!r&&(e.type="mouseenter",this._onPointerEvent(e)),e.type=t}else this._hoveredFeatures=null}_fireEvent(e,t,r){let a=this._map,n=a.transform,s="string"==typeof t?t:t.type;return("move"===s&&this._updateViewState(this.props,!1),s in m&&("object"==typeof t&&(t.viewState=i(n)),this._map.isMoving()))?(a.transform=this._renderTransform,e.call(a,t,r),a.transform=n,a):(e.call(a,t,r),a)}_onBeforeRepaint(){let e=this._map;for(let t in this._internalUpdate=!0,this._deferredEvents)this._deferredEvents[t]&&e.fire(t);this._internalUpdate=!1;let t=this._map.transform;e.transform=this._renderTransform,this._onAfterRepaint=()=>{s(this._renderTransform,t),e.transform=t}}}g.savedMaps=[];let y=["setMaxBounds","setMinZoom","setMaxZoom","setMinPitch","setMaxPitch","setRenderWorldCopies","setProjection","setStyle","addSource","removeSource","addLayer","removeLayer","setLayerZoomRange","setFilter","setPaintProperty","setLayoutProperty","setLight","setTerrain","setFog","remove"],x="u">typeof document?t.useLayoutEffect:t.useEffect,v=["baseApiUrl","maxParallelImageRequests","workerClass","workerCount","workerUrl"],b=t.createContext(null),w=t.forwardRef(function(a,n){let s=(0,t.useContext)(r),[i,o]=(0,t.useState)(null),l=(0,t.useRef)(),{current:c}=(0,t.useRef)({mapLib:null,map:null});(0,t.useEffect)(()=>{let t,r=a.mapLib,n=!0;return Promise.resolve(r||e.A(915785)).then(e=>{if(!n)return;if(!e)throw Error("Invalid mapLib");let r="Map"in e?e:e.default;if(!r.Map)throw Error("Invalid mapLib");!function(e,t){for(let r of v)r in t&&(e[r]=t[r]);
2let{RTLTextPlugin:r="https://api.mapbox.com/mapbox-gl-js/plugins/mapbox-gl-rtl-text/v0.2.3/mapbox-gl-rtl-text.js"}=t;r&&e.getRTLTextPluginStatus&&"unavailable"===e.getRTLTextPluginStatus()&&e.setRTLTextPlugin(r,e=>{e&&console.error(e)},!0)}(r,a),a.reuseMaps&&(t=g.reuse(a,l.current)),t||(t=new g(r.Map,a,l.current)),c.map=function(e){if(!e)return null;let t=e.map,r={getMap:()=>t,getCenter:()=>e.transform.center,getZoom:()=>e.transform.zoom,getBearing:()=>e.transform.bearing,getPitch:()=>e.transform.pitch,getPadding:()=>e.transform.padding,getBounds:()=>e.transform.getBounds(),project:r=>{let a=t.transform;t.transform=e.transform;let n=t.project(r);return t.transform=a,n},unproject:r=>{let a=t.transform;t.transform=e.transform;let n=t.unproject(r);return t.transform=a,n},queryTerrainElevation:(r,a)=>{let n=t.transform;t.transform=e.transform;let s=t.queryTerrainElevation(r,a);return t.transform=n,s},queryRenderedFeatures:(r,a)=>{let n=t.transform;t.transform=e.transform;let s=t.queryRenderedFeatures(r,a);return t.transform=n,s}};for(let e of function(e){let t=new Set,r=e;for(;r;){for(let a of Object.getOwnPropertyNames(r))"_"!==a[0]&&"function"==typeof e[a]&&"fire"!==a&&"setEventedParent"!==a&&t.add(a);r=Object.getPrototypeOf(r)}return Array.from(t)}(t))e in r||y.includes(e)||(r[e]=t[e].bind(t));return r}(t),c.mapLib=r,o(t),s?.onMapMount(c.map,a.id)}).catch(e=>{let{onError:t}=a;t?t({type:"error",target:null,error:e}):console.error(e)}),()=>{n=!1,t&&(s?.onMapUnmount(a.id),a.reuseMaps?t.recycle():t.destroy())}},[]),x(()=>{i&&i.setProps(a)}),(0,t.useImperativeHandle)(n,()=>c.map,[i]);let d=(0,t.useMemo)(()=>({position:"relative",width:"100%",height:"100%",...a.style}),[a.style]);return t.createElement("div",{id:a.id,ref:l,style:d},i&&t.createElement(b.Provider,{value:c},t.createElement("div",{"mapboxgl-children":"",style:{height:"100%"}},a.children)))});var j=e.i(730943);let C=/box|flex|grid|column|lineHeight|fontWeight|opacity|order|tabSize|zIndex/;function S(e,t){if(!e||!t)return;let r=e.style;for(let e in t){let a=t[e];Number.isFinite(a)&&!C.test(e)?r[e]=`${a}px`:r[e]=a}}function N(e,t){if(e===t)return null;let r=P(e),a=P(t),n=[];for(let e of a)r.has(e)||n.push(e);for(let e of r)a.has(e)||n.push(e);return 0===n.length?null:n}function P(e){return new Set(e?e.trim().split(/\s+/):[])}let A=(0,t.memo)((0,t.forwardRef)((e,r)=>{var a;let n,s,i,o,{map:l,mapLib:c}=(0,t.useContext)(b),d=(0,t.useRef)({props:e}),u=(0,t.useMemo)(()=>{let r=!1;t.Children.forEach(e.children,e=>{e&&(r=!0)});let a={...e,element:r?document.createElement("div"):null},n=new c.Marker(a);return n.setLngLat([e.longitude,e.latitude]),n.getElement().addEventListener("click",e=>{d.current.props.onClick?.({type:"click",target:n,originalEvent:e})}),n.on("dragstart",e=>{e.lngLat=u.getLngLat(),d.current.props.onDragStart?.(e)}),n.on("drag",e=>{e.lngLat=u.getLngLat(),d.current.props.onDrag?.(e)}),n.on("dragend",e=>{e.lngLat=u.getLngLat(),d.current.props.onDragEnd?.(e)}),n},[]);(0,t.useEffect)(()=>(u.addTo(l.getMap()),()=>{u.remove()}),[]);let{longitude:m,latitude:p,offset:h,style:f,draggable:g=!1,popup:y=null,rotation:x=0,rotationAlignment:v="auto",pitchAlignment:w="auto"}=e;(0,t.useEffect)(()=>{S(u.getElement(),f)},[f]),(0,t.useImperativeHandle)(r,()=>u,[]);let C=d.current.props;(u.getLngLat().lng!==m||u.getLngLat().lat!==p)&&u.setLngLat([m,p]),h&&(a=u.getOffset(),n=Array.isArray(a)?a[0]:a?a.x:0,s=Array.isArray(a)?a[1]:a?a.y:0,i=Array.isArray(h)?h[0]:h?h.x:0,o=Array.isArray(h)?h[1]:h?h.y:0,n!==i||s!==o)&&u.setOffset(h),u.isDraggable()!==g&&u.setDraggable(g),u.getRotation()!==x&&u.setRotation(x),u.getRotationAlignment()!==v&&u.setRotationAlignment(v),u.getPitchAlignment()!==w&&u.setPitchAlignment(w),u.getPopup()!==y&&u.setPopup(y);let P=N(C.className,e.className);if(P)for(let e of P)u.toggleClassName(e);return d.current.props=e,(0,j.createPortal)(e.children,u.getElement())}));e.s(["Marker",0,A],95495);let k=(0,t.memo)((0,t.forwardRef)((e,r)=>{let{map:a,mapLib:s}=(0,t.useContext)(b),i=(0,t.useMemo)(()=>document.createElement("div"),[]),o=(0,t.useRef)({props:e}),l=(0,t.useMemo)(()=>{let t={...e},r=new s.Popup(t);return r.setLngLat([e.longitude,e.latitude]),r.once("open",e=>{o.current.props.onOpen?.(e)}),r},[]);if((0,t.useEffect)(()=>{let e=e=>{o.current.props.onClose?.(e)};return l.on("close",e),l.setDOMContent(i).addTo(a.getMap()),()=>{l.off("close",e),l.isOpen()&&l.remove()}},[]),(0,t.useEffect)(()=>{S(l.getElement(),e.style)},[e.style]),(0,t.useImperativeHandle)(r,()=>
2l,[]),l.isOpen()){let t=o.current.props;(l.getLngLat().lng!==e.longitude||l.getLngLat().lat!==e.latitude)&&l.setLngLat([e.longitude,e.latitude]),e.offset&&!n(t.offset,e.offset)&&(l.options.anchor=e.anchor,l.setOffset(e.offset)),(t.anchor!==e.anchor||t.maxWidth!==e.maxWidth)&&l.setMaxWidth(e.maxWidth);let r=N(t.className,e.className);if(r)for(let e of r)l.toggleClassName(e);o.current.props=e}return(0,j.createPortal)(e.children,i)}));function E(e,r,a,n){let s=(0,t.useContext)(b),i=(0,t.useMemo)(()=>e(s),[]);return(0,t.useEffect)(()=>{let e="function"==typeof r&&"function"==typeof a?r:null,t="function"==typeof a?a:"function"==typeof r?r:null,{map:o}=s;return!o.hasControl(i)&&(o.addControl(i,(n||a||r)?.position),e&&e(s)),()=>{t&&t(s),o.hasControl(i)&&o.removeControl(i)}},[]),i}e.s(["Popup",0,k],871292),(0,t.memo)(function(e){let r=E(({mapLib:t})=>new t.AttributionControl(e),{position:e.position});return(0,t.useEffect)(()=>{S(r._container,e.style)},[e.style]),null}),(0,t.memo)(function(e){let r=E(({mapLib:t})=>new t.FullscreenControl({container:e.containerId&&document.getElementById(e.containerId)}),{position:e.position});return(0,t.useEffect)(()=>{S(r._controlContainer,e.style)},[e.style]),null}),(0,t.memo)((0,t.forwardRef)(function(e,r){let a=(0,t.useRef)({props:e}),n=E(({mapLib:t})=>{let r=new t.GeolocateControl(e),n=r._setupUI.bind(r);return r._setupUI=e=>{r._container.hasChildNodes()||n(e)},r.on("geolocate",e=>{a.current.props.onGeolocate?.(e)}),r.on("error",e=>{a.current.props.onError?.(e)}),r.on("outofmaxbounds",e=>{a.current.props.onOutOfMaxBounds?.(e)}),r.on("trackuserlocationstart",e=>{a.current.props.onTrackUserLocationStart?.(e)}),r.on("trackuserlocationend",e=>{a.current.props.onTrackUserLocationEnd?.(e)}),r},{position:e.position});return a.current.props=e,(0,t.useImperativeHandle)(r,()=>n,[]),(0,t.useEffect)(()=>{S(n._container,e.style)},[e.style]),null}));let I=(0,t.memo)(function(e){let r=E(({mapLib:t})=>new t.NavigationControl(e),{position:e.position});return(0,t.useEffect)(()=>{S(r._container,e.style)},[e.style]),null});function B(e,t){if(!e)throw Error(t)}e.s(["NavigationControl",0,I],789347),(0,t.memo)(function(e){let r=E(({mapLib:t})=>new t.ScaleControl(e),{position:e.position}),a=(0,t.useRef)(e),n=a.current;a.current=e;let{style:s}=e;return void 0!==e.maxWidth&&e.maxWidth!==n.maxWidth&&(r.options.maxWidth=e.maxWidth),void 0!==e.unit&&e.unit!==n.unit&&r.setUnit(e.unit),(0,t.useEffect)(()=>{S(r._container,s)},[s]),null});let O=0;e.s(["Source",0,function(e){let r=(0,t.useContext)(b).map.getMap(),a=(0,t.useRef)(e),[,s]=(0,t.useState)(0),i=(0,t.useMemo)(()=>e.id||`jsx-source-${O++}`,[]);(0,t.useEffect)(()=>{if(r){let e=()=>setTimeout(()=>s(e=>e+1),0);return r.on("styledata",e),e(),()=>{if(r.off("styledata",e),r.style&&r.style._loaded&&r.getSource(i)){let e=r.getStyle()?.layers;if(e)for(let t of e)t.source===i&&r.removeLayer(t.id);r.removeSource(i)}}}},[r]);let o=r&&r.style&&r.getSource(i);return o?!function(e,t,r){B(t.id===r.id,"source id changed"),B(t.type===r.type,"source type changed");let a="",s=0;for(let e in t)"children"!==e&&"id"!==e&&!n(r[e],t[e])&&(a=e,s++);if(!s)return;let i=t.type;"geojson"===i?e.setData(t.data):"image"===i?e.updateImage({url:t.url,coordinates:t.coordinates}):"setCoordinates"in e&&1===s&&"coordinates"===a?e.setCoordinates(t.coordinates):"setUrl"in e&&"url"===a?e.setUrl(t.url):"setTiles"in e&&"tiles"===a?e.setTiles(t.tiles):console.warn(`Unable to update <Source> prop: ${a}`)}(o,e,a.current):o=function(e,t,r){if(e.style&&e.style._loaded){let a={...r};return delete a.id,delete a.children,e.addSource(t,a),e.getSource(t)}return null}(r,i,e),a.current=e,o&&t.Children.map(e.children,e=>e&&(0,t.cloneElement)(e,{source:i}))||null}],647289);let M=0;e.s(["Layer",0,function(e){let r=(0,t.useContext)(b).map.getMap(),a=(0,t.useRef)(e),[,s]=(0,t.useState)(0),i=(0,t.useMemo)(()=>e.id||`jsx-layer-${M++}`,[]);if((0,t.useEffect)(()=>{if(r){let e=()=>s(e=>e+1);return r.on("styledata",e),e(),()=>{r.off("styledata",e),r.style&&r.style._loaded&&r.getLayer(i)&&r.removeLayer(i)}}},[r]),r&&r.style&&r.getLayer(i))try{!function(e,t,r,a){if(B(r.id===a.id,"layer id changed"),B(r.type===a.type,"layer type changed"),"custom"===r.type||"custom"===a.type)return;let{layout:s={},paint:i={},filter:o,minzoom:l,maxzoom:c,beforeId:d}=r;if(d!==a.beforeId&&e.moveLayer(t,d),s!==a.layout){let r=a.layout||{};for(let a in s)n(s[a],r[a])||e.setLayoutProperty(t,a,s[a]);for(let a in r)s.hasOwnProperty(a)||e.setLayoutProperty(t,a,void 0)}if(i!==a.paint){let r=a.paint||{};for(let a in i)n(i[a],r[a])||e.setPaintProperty(t,a,i[a]);for(let a in r)i.hasOwnProperty(a)||e.setPaintProperty(t,a,void 0)}n(o,a.filter)||e.setFilter(t,o),(l!==a.minzoom||c!==a.maxzoom)&&e.setLayerZoomRange(t,l,c)}(r,i,e,a.current)}catch(e){console.warn(e)}else if(r.style&&r.style._loaded&&(!("source"in e)||r.getSource(e.source))){let t={...e,id:i};delete t.beforeId,r.addLayer(t,e.beforeId)}return a.current=e,null}],200280),e.s([],115266),e.s(["default",0,w],214115)}]); 3 4//# debugId=4d038fc6-1a97-f40e-1e97-3c0eb64cc853
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.