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]="4d65a009-eea2-b554-20d6-7ce94b5d96d0")}catch(e){}}(); 2(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,862682,e=>{"use strict";var t=e.i(45113),r=e.i(413701),n=e.i(17772),i=e.i(477130),a=e.i(117741),o=e.i(159159),s=e.i(907074),l=e.i(458904);let c={trainingWords:{featureName:"Training Words",at:"You've reached your word count limit on your current plan.",near:"You're approaching your word count limit."},collaborators:{featureName:"Collaborators",at:"You've reached your collaborator limit on your current plan.",near:"You're approaching your collaborator limit."},embedChannels:{featureName:"Website Integrations",at:"You've reached your website integration limit on your current plan.",near:"You're approaching your website integration limit."},affiliateProducts:{featureName:"Products",at:"You've reached your product limit on your current plan.",near:"You're approaching your product limit."}},u=e=>e.toLocaleString("en-US");e.s(["QuotaLimitBadge",0,function(e){let d,m,p,h,g,f,b,y,v=(0,r.c)(29),{quotaKey:x,label:w,format:S,className:k}=e,C=void 0===S?u:S,M=(0,a.useOwnerUserId)(),R=(0,l.useQuota)(x,M),{targetTier:A}=(0,s.useNextTier)(M),[z,N]=(0,n.useState)(!1);if(R.isLoading)return null;v[0]!==C||v[1]!==w||v[2]!==R.limit||v[3]!==R.used?(d=null===R.limit?`${C(R.used)} ${w}`:`${C(R.used)} of ${C(R.limit)} ${w}`,v[0]=C,v[1]=w,v[2]=R.limit,v[3]=R.used,v[4]=d):d=v[4];let P=d,I=R.isAtLimit?"destructive":R.isNearLimit?"warning":"subtle";if(!("trainingWords"!==x&&(R.isAtLimit||R.isNearLimit))){let e;return v[5]!==I||v[6]!==k||v[7]!==P?(e=(0,t.jsx)(i.Badge,{variant:I,className:k,children:P}),v[5]=I,v[6]=k,v[7]=P,v[8]=e):e=v[8],e}let T=c[x];v[9]===Symbol.for("react.memo_cache_sentinel")?(m=()=>N(!0),v[9]=m):m=v[9],v[10]!==P?(p=(0,t.jsx)("span",{children:P}),v[10]=P,v[11]=p):p=v[11];let j=R.isAtLimit?"⢠Increase limit â":"⢠Add more â";v[12]!==j?(h=(0,t.jsx)("span",{className:"font-medium",children:j}),v[12]=j,v[13]=h):h=v[13],v[14]!==p||v[15]!==h?(g=(0,t.jsxs)("span",{className:"inline-flex items-center gap-1",children:[p,h]}),v[14]=p,v[15]=h,v[16]=g):g=v[16],v[17]!==I||v[18]!==g?(f=(0,t.jsx)("button",{type:"button",onClick:m,className:"cursor-pointer border-0 bg-transparent p-0",children:(0,t.jsx)(i.Badge,{variant:I,className:"whitespace-nowrap hover:opacity-90",children:g})}),v[17]=I,v[18]=g,v[19]=f):f=v[19];let E=R.isAtLimit?T.at:T.near;return v[20]!==T.featureName||v[21]!==z||v[22]!==E||v[23]!==A?(b=(0,t.jsx)(o.PlanPreviewDialog,{open:z,onOpenChange:N,targetTier:A,featureName:T.featureName,currentLimitText:E}),v[20]=T.featureName,v[21]=z,v[22]=E,v[23]=A,v[24]=b):b=v[24],v[25]!==k||v[26]!==b||v[27]!==f?(y=(0,t.jsxs)("span",{className:k,children:[f,b]}),v[25]=k,v[26]=b,v[27]=f,v[28]=y):y=v[28],y}])},488181,e=>{"use strict";var t=e.i(413701),r=e.i(117741);function n(e){return`${e}/settings/plan/manage`}e.s(["upgradeHref",0,n,"useUpgradeHref",0,function(){let e,i=(0,t.c)(2),a=(0,r.useScopeBasePath)();return i[0]!==a?(e=n(a),i[0]=a,i[1]=e):e=i[1],e}])},7621,86054,e=>{"use strict";var t=e.i(45113),r=e.i(413701),n=e.i(17772),i=e.i(403773),a=e.i(981831),o=e.i(148277),s=e.i(159159);let l={slackIntegration:"builder",telegramIntegration:"builder",smsIntegration:"immortal",whatsappIntegration:"immortal",contactImport:"builder",accessGroups:"builder",analytics:"free",proVoice:"scaler",youtubePodcastFeeds:"free",broadcasts:"builder",alerts:"builder",actions:"builder",products:"builder",integrations:"builder",usageLimits:"builder",embedCustomBranding:"scaler",embedWhiteLabel:"immortal",sso:"immortal",developerPlatform:"builder",standardTierApi:"immortal",automationTierApi:"immortal",phoneVerificationBypass:"builder",lookupUserUpsert:"free"},c={slackIntegration:"Slack Integration",telegramIntegration:"Telegram Integration",smsIntegration:"SMS Integration",whatsappIntegration:"WhatsApp Integration",contactImport:"Contact Import",accessGroups:"Access Groups",analytics:"Analytics",proVoice:"Pro Voice",youtubePodcastFeeds:"YouTube & Podcast Feeds",broadcasts:"Broadcasts",alerts:"Alerts",actions:"Actions",products:"Products",integrations:"Integrations",usageLimits:"Usage Limits",embedCustomBranding:"Embed Custom Branding",embedWhiteLabel:"Embed White Label",sso:"SSO",developerPlatform:"Actions",standardTierApi:"API Keys",automationTierApi:"API Keys",phoneVerificationBypass:"Phone Verification Bypass",lookupUserUpsert:"Lookup User Upsert"};e.s(["FEATURE_LABELS",0,c,"FEATURE_UPGRADE_TARGET",0,l],86054);let u=new Set(["slackIntegration","telegramIntegration","smsIntegration","whatsappIntegration"]),d={integrations:{title:"Let Your Delphi Plug Into Everything",description:"Connect your Delphi to the tools you already use: email, CRMs, Slack, Zapier and beyond. Automate busywork, sync insights, and keep everything flowing through one smart brain: yours.",benefits:[{title:"Works With Your Stack",description:"Connect Delphi to Zapier, Stripe, Kit, Calendly, Notion, and more so your Digital Mind can book calls, send emails, tag contacts, or deliver products automatically."},{title:"Automate the Repetitive",description:"Trigger actions, send messages, and capture leads automatically."},{title:"One Mind, Everywhere",description:"Your Delphi stays in sync across tools, teams, and touchpoints."}]},products:{title:"Turn Conversations Into Customers",description:"Whether it's books, courses, merch, tickets, or a membership to you, your Delphi can help promote, explain, and sell it. 24/7. In your voice. No links lost. No leads left behind.",benefits:[{title:"Everything You Offer, All in One Place",description:"Add any productâdigital or physicalâand let your Delphi do the talking (and selling)."},{title:"Always-On Sales Assistant",description:"Your Delphi can recommend the right offer at the right moment, automatically."},{title:"Seamless, Conversational Checkout",description:"No cold redirects. No drop-offs. Just fluid, personal transactions, powered by your digital mind."}]},broadcasts:{title:"Engage Your Audience and Trigger Engagement at Scale",description:"Segment your audience and send blasts across multiple channels with personalized outreach. Seamlessly engage through email, SMS, and WhatsApp. Your Delphi can continue the conversation if replied to.",benefits:[{title:"Multi-Channel Outreach",description:"Send targeted messages through email, SMS, and WhatsApp to reach your audience where they are."},{title:"Smart Segmentation",description:"Target the right people with filters for tags, access tier, and engagement history."},{title:"Conversation Continuity",description:"When someone replies, your Delphi can pick up the thread and keep the relationship warm."}]},alerts:{title:"Never Miss a High-Intent Moment",description:"Set keyword and contextual alerts so your Delphi flags the conversations that matter â pricing questions, partnership asks, or any signal you care about.",benefits:[{title:"Catch What Matters",description:"Define alerts in plain language and get notified when a conversation matches."},{title:"Act While It's Hot",description:"See alert hits inline in Conversations and jump in before the moment passes."},{title:"Stay in Control",description:"Enable, disable, and refine alerts anytime as your business priorities shift."}]},usageLimits:{title:"Smart Access Control",description:"Create usage limits to manage who can interact with your Digital Mind and control content visibility across different audience segments.",benefits:[{title:"Granular Content Control",description:"Set different access levels for your contentâfrom public to invite-onlyâso the right people see the right information."},{title:"Audience Segmentation",description:"Create distinct groups like insiders or collaborators with customized access and interaction limits."},{title:"Usage Management",description:"Control interaction limits per group so your most engaged audiences get priority access while managing costs effectively."}]}
2,developerPlatform:{title:"Build on Delphi with Actions",description:"Manage API keys, webhooks, and hosted integrations so your Delphi can power custom apps, automations, and production workflows.",benefits:[{title:"Programmatic Access",description:"Create and rotate API keys to connect your Delphi to external systems securely."},{title:"Real-Time Webhooks",description:"React to conversations, contacts, and events as they happen in your stack."},{title:"Production-Ready Integrations",description:"Ship custom experiences without rebuilding Delphi's core chat and voice stack."}]},standardTierApi:{title:"Programmatic API Access",description:"Mint API keys to call Delphi from your own code â read contacts and transcripts, send messages, and drive automations against your Digital Mind.",benefits:[{title:"Mint & Manage API Keys",description:"Create scoped, revocable keys to connect your Delphi to your own scripts and services."},{title:"The Full API Surface",description:"Read profile, contacts, and transcripts, send messages, and call the LLM over a typed API and the delphi SDK."},{title:"Built for Automation",description:"Per-key scopes and rate tiers let you run scheduled jobs and production workflows safely."}]}};function m(e){return(0,t.jsxs)("div",{className:"flex items-start gap-3 p-4",children:[(0,t.jsx)(i.CheckIcon,{className:"mt-0.5 size-4 shrink-0 text-brand-accent","aria-hidden":!0}),(0,t.jsxs)("div",{className:"flex flex-col gap-1 text-left",children:[(0,t.jsx)("p",{className:"text-sm font-medium text-fg-high",children:e.title}),(0,t.jsx)("p",{className:"text-xs leading-relaxed text-fg-mid",children:e.description})]})]},e.title)}e.s(["FeatureUpsell",0,function(e){let p,h,g,f,b,y,v,x,w,S,k=(0,r.c)(27),{feature:C}=e,[M,R]=(0,n.useState)(!1),A=c[C],z=l[C];if(k[0]!==C||k[1]!==A){let e,r,n=function(e){let t=d[e];if(t)return t;if(u.has(e)){let t=d.integrations;return{title:`Unlock ${c[e]}`,description:t.description,benefits:t.benefits}}let r=c[e];return{title:`Unlock ${r}`,description:`Upgrade your plan to unlock ${r.toLowerCase()} and get the most out of your Delphi.`,benefits:[]}}(C);p=o.NarrowPageContainer,b="flex flex-1 items-center justify-center py-16",h="flex w-full max-w-lg flex-col gap-6 rounded-2xl border border-subtle bg-surface-primary p-8",k[7]===Symbol.for("react.memo_cache_sentinel")?(e=(0,t.jsx)(i.LockIcon,{className:"size-4","aria-hidden":!0}),k[7]=e):e=k[7],k[8]!==A?(r=(0,t.jsxs)("span",{className:"inline-flex items-center gap-2 text-sm font-medium text-brand-accent",children:[e,A]}),k[8]=A,k[9]=r):r=k[9],g=(0,t.jsxs)("header",{className:"flex flex-col items-center gap-3 text-center",children:[r,(0,t.jsx)("h1",{className:"text-2xl font-semibold text-fg-high",children:n.title}),(0,t.jsx)("p",{className:"text-sm leading-relaxed text-fg-mid",children:n.description})]}),f=n.benefits.length>0?(0,t.jsx)("div",{className:"divide-y divide-subtle overflow-hidden rounded-xl border border-subtle",children:n.benefits.map(m)}):null,k[0]=C,k[1]=A,k[2]=p,k[3]=h,k[4]=g,k[5]=f,k[6]=b}else p=k[2],h=k[3],g=k[4],f=k[5],b=k[6];return k[10]===Symbol.for("react.memo_cache_sentinel")?(y=()=>R(!0),k[10]=y):y=k[10],k[11]!==A?(v=(0,t.jsxs)(a.Button,{size:"lg",className:"w-full",onClick:y,children:["Unlock ",A]}),k[11]=A,k[12]=v):v=k[12],k[13]!==h||k[14]!==g||k[15]!==f||k[16]!==v?(x=(0,t.jsxs)("section",{className:h,children:[g,f,v]}),k[13]=h,k[14]=g,k[15]=f,k[16]=v,k[17]=x):x=k[17],k[18]!==A||k[19]!==M||k[20]!==z?(w=(0,t.jsx)(s.PlanPreviewDialog,{open:M,onOpenChange:R,targetTier:z,featureName:A}),k[18]=A,k[19]=M,k[20]=z,k[21]=w):w=k[21],k[22]!==p||k[23]!==b||k[24]!==x||k[25]!==w?(S=(0,t.jsxs)(p,{className:b,children:[x,w]}),k[22]=p,k[23]=b,k[24]=x,k[25]=w,k[26]=S):S=k[26],S}],7621)},328327,e=>{"use strict";var t=e.i(413701),r=e.i(593854),n=e.i(38129);e.s(["useIsPaidPlan",0,function(e){let i,a,o,s=(0,t.c)(10),l=""===e,c=l?void 0:e;s[0]!==c?(i=(0,n.planSubscriptionOptions)(c),s[0]=c,s[1]=i):i=s[1];let u=!l;s[2]!==i||s[3]!==u?(a={...i,enabled:u},s[2]=i,s[3]=u,s[4]=a):a=s[4];let{data:d,isLoading:m,isError:p}=(0,r.useQuery)(a);if(l){let e;return s[5]===Symbol.for("react.memo_cache_sentinel")?(e={isPaid:!1,isLoading:!0,isError:!1},s[5]=e):e=s[5],e}let h="free"!==(d?.data.plan??"free"),g=p&&void 0===d;return s[6]!==m||s[7]!==h||s[8]!==g?(o={isPaid:h,isLoading:m,isError:g},s[6]=m,s[7]=h,s[8]=g,s[9]=o):o=s[9],o}])},402503,e=>{"use strict";var t=e.i(413701),r=e.i(593854),n=e.i(38129);e.s(["useCurrentPlan",0,function(e){let i,a,o=(0,t.c)(5);o[0]!==e?(i=(0,n.planSubscriptionOptions)(e),o[0]=e,o[1]=i):i=o[1];let{data:s,isLoading:l}=(0,r.useQuery)(i),c=s?.data.plan??"free";return o[2]!==l||o[3]!==c?(a={plan:c,isLoading:l},o[2]=l,o[3]=c,o[4]=a):a=o[4],a}])},361273,159419,e=>{"use strict";e.i(738864),e.i(273291),e.i(159159),e.i(862682),e.i(458904),e.i(907074);var t=e.i(817422),r=e.i(187014);let n=t.z.object({code:t.z.literal("entitlement_quota_exceeded"),message:t.z.string().optional(),details:t.z.object({quotaKey:t.z.string(),used:t.z.number().optional(),limit:t.z.number().nullable().optional(),requested:t.z.number().optional(),currentPlan:t.z.string().optional(),upgradeTo:t.z.string().nullable().optional()}).passthrough().optional()}),i=t.z.object({code:t.z.literal("feature_gated"),message:t.z.string().optional(),details:t.z.object({feature:t.z.string(),currentPlan:t.z.string().optional(),upgradeTo:t.z.string().nullable().optional()}).passthrough().optional()});function a(e){let t=function(e){if(!(e instanceof Error))return e;try{return JSON.parse(e.message)}catch{return e}}(e),r=n.safeParse(t).data;if(r)return{kind:"quota",quotaKey:r.details?.quotaKey,used:r.details?.used,limit:r.details?.limit??null,requested:r.details?.requested,upgradeTo:r.details?.upgradeTo??null,message:r.message??"You've reached a limit on your current plan."};let a=i.safeParse(t).data;return a?{kind:"feature",feature:a.details?.feature,upgradeTo:a.details?.upgradeTo??null,message:a.message??"This feature isn't available on your current plan."}:null}e.s(["isEntitlementError",0,function(e){return null!==a(e)},"toastQuotaError",0,function(e,t={}){let n=a(e);return n?(r.toast.error(n.message,t.upgradeHref?{action:{label:"Upgrade",onClick:()=>{window.location.assign(t.upgradeHref)}}}:void 0),!0):(r.toast.error(t.fallback??"Something went wrong. Please try again."),!1)}],159419),e.i(488181),e.i(7621),e.i(328327),e.i(402503),e.i(97908),e.s([],361273)},653065,e=>{"use strict";var t=e.i(45113),r=e.i(632137),n=e.i(17772);function i(e,t,r){let n=new Uint8Array(e.fftSize);e.getByteTimeDomainData(n);let i=Math.max(1,Math.floor(t/2)),a=Math.max(1,Math.floor(n.length/i)),o=[],s=(e,t)=>{let i=0;for(let r=e;r<t;r++){let e=Math.abs((n[r]??128)-128)/128;e>i&&(i=e)}return Math.max(.05,Math.min(1,i*r))};for(let e=i-1;e>=0;e--){let t=e*a;o.push(s(t,Math.min(n.length,t+a)))}for(let e=0;e<i;e++){let t=e*a;o.push(s(t,Math.min(n.length,t+a)))}return o}function a(e){return e&&"transparent"!==e&&"rgba(0, 0, 0, 0)"!==e?e:null}e.s(["LiveWaveform",0,({active:e=!1,processing:o=!1,stream:s=null,deviceId:l,barWidth:c=3,barGap:u=1,barRadius:d=1.5,barColor:m,barClassName:p,dotClassName:h,fadeEdges:g=!0,fadeWidth:f=24,barHeight:b=4,height:y=64,sensitivity:v=1,smoothingTimeConstant:x=.8,fftSize:w=256,historySize:S=60,updateRate:k=30,mode:C="static",analyzer
2:M="frequency",onError:R,onStreamReady:A,onStreamEnd:z,className:N,...P})=>{let I=(0,n.useRef)(null),T=(0,n.useRef)(null),j=(0,n.useRef)(null),E=(0,n.useRef)(null),D=(0,n.useRef)([]),B=(0,n.useRef)(null),L=(0,n.useRef)(null),U=(0,n.useRef)(null),_=(0,n.useRef)(!1),O=(0,n.useRef)(0),q=(0,n.useRef)(0),F=(0,n.useRef)(null),W=(0,n.useRef)([]),Y=(0,n.useRef)(0),$=(0,n.useRef)([]),K=(0,n.useRef)(!0),V=(0,n.useRef)(null),G=(0,n.useRef)(0);(0,n.useEffect)(()=>{let e=I.current,t=T.current;if(!e||!t)return;let r=new ResizeObserver(()=>{let r=t.getBoundingClientRect(),n=window.devicePixelRatio||1;e.width=r.width*n,e.height=r.height*n,e.style.width=`${r.width}px`,e.style.height=`${r.height}px`;let i=e.getContext("2d");i&&(i.setTransform(1,0,0,1,0,0),i.scale(n,n)),V.current=null,G.current=r.width,K.current=!0});return r.observe(t),()=>r.disconnect()},[]),(0,n.useEffect)(()=>{if(o&&!e){let e={current:0};Y.current=0;let t=()=>{e.current+=.03,Y.current=Math.min(1,Y.current+.02);let r=[],n=Math.floor((T.current?.getBoundingClientRect().width||200)/(c+u));if("static"===C){let t=Math.floor(n/2);for(let i=0;i<n;i++){let n=(i-t)/Math.max(1,t),a=1-.4*Math.abs(n),o=(.2+(.25*Math.sin(1.5*e.current+3*n)+.2*Math.sin(.8*e.current-2*n)+.15*Math.cos(2*e.current+n)))*a,s=o;if(W.current.length>0&&Y.current<1){let e=Math.min(i,W.current.length-1);s=(W.current[e]??0)*(1-Y.current)+o*Y.current}r.push(Math.max(.05,Math.min(1,s)))}}else for(let t=0;t<n;t++){let i=1-.4*Math.abs((t-n/2)/(n/2)),a=(.2+(.25*Math.sin(1.5*e.current+.15*t)+.2*Math.sin(.8*e.current-.1*t)+.15*Math.cos(2*e.current+.05*t)))*i,o=a;if(W.current.length>0&&Y.current<1){let e=Math.floor(t/n*W.current.length);o=(W.current[e]??0)*(1-Y.current)+a*Y.current}r.push(Math.max(.05,Math.min(1,o)))}"static"===C?$.current=r:D.current=r,K.current=!0,F.current=requestAnimationFrame(t)};return t(),()=>{F.current&&cancelAnimationFrame(F.current)}}if(!e&&!o&&("static"===C?$.current.length>0:D.current.length>0)){let e=0,t=()=>{(e+=.03)<1?("static"===C?$.current=$.current.map(t=>t*(1-e)):D.current=D.current.map(t=>t*(1-e)),K.current=!0,requestAnimationFrame(t)):"static"===C?$.current=[]:D.current=[]};t()}},[e,u,c,C,o]),(0,n.useEffect)(()=>{let t=()=>{if(_.current&&U.current){for(let e of U.current.getTracks())e.stop();U.current=null,_.current=!1,z?.()}},r=()=>{B.current=null,L.current&&"closed"!==L.current.state&&(L.current.close(),L.current=null),O.current&&(cancelAnimationFrame(O.current),O.current=0)};if(!e){t(),_.current||(U.current=null),r();return}let n=!1,i=async(e,t)=>{let r=window.AudioContext?window.AudioContext:"webkitAudioContext"in window?window.webkitAudioContext:void 0;if(!r)throw Error("AudioContext is not available");let i=new r,a=i.createAnalyser();if(a.fftSize=w,a.smoothingTimeConstant=x,i.createMediaStreamSource(e).connect(a),n){"closed"!==i.state&&i.close();return}U.current=e,_.current=t,L.current=i,B.current=a,t&&A?.(e),"suspended"===i.state&&await i.resume(),D.current=[],$.current=[],K.current=!0};return(async()=>{try{if(s)return void await i(s,!1);let e=await navigator.mediaDevices.getUserMedia({audio:l?{autoGainControl:!0,deviceId:{exact:l},echoCancellation:!0,noiseSuppression:!0}:{autoGainControl:!0,echoCancellation:!0,noiseSuppression:!0}});await i(e,!0)}catch(e){R?.(e)}})(),()=>{n=!0,t(),U.current=null,r()}},[e,l,s,w,R,z,A,x]),(0,n.useEffect)(()=>{let t,r=I.current;if(!r)return;let n=r.getContext("2d");if(!n)return;let s=l=>{let p,h,y,x=r.getBoundingClientRect(),w=L.current;if(e&&w?.state==="suspended"&&w.resume(),e&&l-q.current>k&&(q.current=l,B.current)){let e=Math.floor(x.width/(c+u));if("static"===C)if("time-domain"===M){let t=i(B.current,e,v);$.current=t,W.current=t}else{let t=new Uint8Array(B.current.frequencyBinCount);B.current.getByteFrequencyData(t);let r=Math.floor(.05*t.length),n=Math.floor(.4*t.length),i=t.slice(r,n),a=Math.floor(e/2),o=[];for(let e=a-1;e>=0;e--){let t=Math.floor(e/Math.max(1,a)*i.length),r=Math.min(1,(i[t]??0)/255*v);o.push(Math.max(.05,r))}for(let e=0;e<a;e++){let t=Math.floor(e/Math.max(1,a)*i.length),r=Math.min(1,(i[t]??0)/255*v);o.push(Math.max(.05,r))}$.current=o,W.current=o}else if("time-domain"===M){let t=i(B.current,e,v),r=0;for(let e of t)r+=e;let n=r/Math.max(1,t.length);D.current.push(n),W.current=[...D.current];let a=Math.max(S,e);D.current.length>a&&D.current.shift()}else{let t=new Uint8Array(B.current.frequencyBinCount);B.current.getByteFrequencyData(t);let r=Math.floor(.05*t.length),n=Math.floor(.4*t.length),i=t.slice(r,n),a=0;for(let e=0;e<i.length;e++)a+=i[e]??0;let o=a/Math.max(1,i.length)/255*v;D.current.push(Math.min(1,Math.max(.05,o))),W.current=[...D.current];let s=Math.max(S,e);D.current.length>s&&D.current.shift()}K.current=!0}if(!K.current&&!e){t=requestAnimationFrame(s);return}K.current=e,n.clearRect(0,0,x.width,x.height);let R=m||(p=E.current?getComputedStyle(E.current):null,h=j.current?getComputedStyle(j.current):null,y=getComputedStyle(r),a(p?.backgroundColor)||a(p?.color)||a(h?.backgroundColor)||a(h?.color)||a(y.color)||"#000"),A=c+u,z=Math.floor(x.width/A),N=x.height/2;
2if("static"===C){let t=o||e||$.current.length>0?$.current:[];for(let e=0;e<z&&e<t.length;e++){let r=t[e]??.1,i=e*A,a=Math.max(b,r*x.height*.8),o=N-a/2;n.fillStyle=R,n.globalAlpha=.4+.6*r,d>0?(n.beginPath(),n.roundRect(i,o,c,a,d),n.fill()):n.fillRect(i,o,c,a)}}else{let e=D.current,t=e.length;for(let r=0;r<z;r++){let i=t-1-r,a=i>=0?e[i]??.05:.05,o=x.width-(r+1)*A,s=Math.max(b,a*x.height*.8),l=N-s/2;n.fillStyle=R,n.globalAlpha=.4+.6*a,d>0?(n.beginPath(),n.roundRect(o,l,c,s,d),n.fill()):n.fillRect(o,l,c,s)}}if(g&&f>0&&x.width>0){if(!V.current||G.current!==x.width){let e=n.createLinearGradient(0,0,x.width,0),t=Math.min(.3,f/x.width);e.addColorStop(0,"rgba(255,255,255,1)"),e.addColorStop(t,"rgba(255,255,255,0)"),e.addColorStop(1-t,"rgba(255,255,255,0)"),e.addColorStop(1,"rgba(255,255,255,1)"),V.current=e,G.current=x.width}n.globalCompositeOperation="destination-out",n.fillStyle=V.current,n.fillRect(0,0,x.width,x.height),n.globalCompositeOperation="source-over"}n.globalAlpha=1,t=requestAnimationFrame(s)};return t=requestAnimationFrame(s),()=>{t&&cancelAnimationFrame(t)}},[e,m,u,d,c,b,g,f,S,C,o,M,v,k]);let H=e?"Live audio waveform":o?"Processing audio":"Audio waveform idle";return(0,t.jsxs)("div",{ref:T,className:(0,r.cn)("relative h-full w-full",N),style:{height:y},role:"img","aria-label":H,...P,children:[(p||h)&&(0,t.jsx)("span",{ref:j,className:(0,r.cn)("pointer-events-none absolute size-0 overflow-hidden opacity-0",p),"aria-hidden":!0,children:(0,t.jsx)("span",{ref:E,className:h})}),e||o?null:(0,t.jsx)("div",{className:"border-muted-foreground/20 absolute top-1/2 right-0 left-0 -translate-y-1/2 border-t-2 border-dotted"}),(0,t.jsx)("canvas",{className:"block h-full w-full",ref:I})]})}])},831543,e=>{"use strict";var t=e.i(817422);let r=t.z.object({message:t.z.string().min(1),code:t.z.string().min(1)}),n=t.z.object({message:t.z.string()}).transform((e,r)=>{try{return JSON.parse(e.message)}catch{return r.addIssue({code:"custom",message:"message is not JSON"}),t.z.NEVER}}).pipe(r),i=t.z.union([n,r]);e.s(["parseVisibleError",0,function(e){return i.safeParse(e).data??null}])},560541,86853,e=>{"use strict";var t=e.i(45113),r=e.i(413701),n=e.i(403773),i=e.i(632137);e.s(["PromptInputCancel",0,function(e){let a,o,s,l,c,u,d,m,p,h,g=(0,r.c)(23);g[0]!==e?({className:s,collapsed:l,children:o,size:u,"aria-label":a,...c}=e,g[0]=e,g[1]=a,g[2]=o,g[3]=s,g[4]=l,g[5]=c,g[6]=u):(a=g[1],o=g[2],s=g[3],l=g[4],c=g[5],u=g[6]);let f="sm"===(void 0===u?"default":u)?"size-8":"size-10 md:size-12";g[7]!==s||g[8]!==f?(d=(0,i.cn)("absolute flex items-center justify-center rounded-full",f,"bg-sand-4 text-sand-11 hover:bg-sand-5 transition-colors",s),g[7]=s,g[8]=f,g[9]=d):d=g[9];let b=+!l,y=l?"scale(0)":"scale(1)",v=l?"none":"auto";g[10]!==b||g[11]!==y||g[12]!==v?(m={opacity:b,transform:y,transition:"all cubic-bezier(0.16, 1, 0.3, 1) 0.4s",pointerEvents:v},g[10]=b,g[11]=y,g[12]=v,g[13]=m):m=g[13];let x=a??"Cancel recording";return g[14]!==o?(p=o??(0,t.jsx)(n.XmarkSolidIcon,{className:"size-4 md:size-5"}),g[14]=o,g[15]=p):p=g[15],g[16]!==l||g[17]!==c||g[18]!==d||g[19]!==m||g[20]!==x||g[21]!==p?(h=(0,t.jsx)("button",{type:"button",className:d,style:m,disabled:l,"aria-label":x,...c,children:p}),g[16]=l,g[17]=c,g[18]=d,g[19]=m,g[20]=x,g[21]=p,g[22]=h):h=g[22],h}],560541);var a=e.i(280855);e.s(["PromptInputConfirm",0,function(e){let o,s,l,c,u,d,m,p,h,g,f=(0,r.c)(23);f[0]!==e?({className:l,collapsed:c,children:s,size:d,"aria-label":o,...u}=e,f[0]=e,f[1]=o,f[2]=s,f[3]=l,f[4]=c,f[5]=u,f[6]=d):(o=f[1],s=f[2],l=f[3],c=f[4],u=f[5],d=f[6]);let b="sm"===(void 0===d?"default":d)?"size-8":"size-10 md:size-12";f[7]!==l||f[8]!==b?(m=(0,i.cn)("absolute flex items-center justify-center rounded-full",b,"bg-brand-accent text-white hover:brightness-110",a.shadow.default,l),f[7]=l,f[8]=b,f[9]=m):m=f[9];let y=+!c,v=c?"scale(0)":"scale(1)",x=c?"none":"auto";f[10]!==y||f[11]!==v||f[12]!==x?(p={opacity:y,transform:v,transition:"all cubic-bezier(0.16, 1, 0.3, 1) 0.4s",pointerEvents:x},f[10]=y,f[11]=v,f[12]=x,f[13]=p):p=f[13];let w=o??"Submit recording";return f[14]!==s?(h=s??(0,t.jsx)(n.CheckSolidIcon,{className:"size-4 md:size-5"}),f[14]=s,f[15]=h):h=f[15],f[16]!==c||f[17]!==u||f[18]!==m||f[19]!==p||f[20]!==w||f[21]!==
2h?(g=(0,t.jsx)("button",{type:"button",className:m,style:p,disabled:c,"aria-label":w,...u,children:h}),f[16]=c,f[17]=u,f[18]=m,f[19]=p,f[20]=w,f[21]=h,f[22]=g):g=f[22],g}],86853)},448855,e=>{"use strict";var t=e.i(45113),r=e.i(413701),n=e.i(632137);let i=(0,e.i(294237).cva)("inline-flex shrink-0 items-center justify-center rounded-full text-sm font-medium focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:outline-none disabled:pointer-events-none",{defaultVariants:{collapsed:!1,size:"default",variant:"ghost"},variants:{collapsed:{false:"scale-100 opacity-100",true:"pointer-events-none scale-0 opacity-0"},size:{default:"size-10 md:size-12",sm:"size-8",responsive:"size-8 md:size-12"},variant:{default:"bg-primary text-fg-inverted hover:bg-primary/90",ghost:"text-sand-11 hover:bg-sand-4 hover:text-fg-high","ghost-soft":"text-sand-10 hover:bg-sand-3 hover:text-sand-11",outline:"border border-subtle bg-background hover:bg-accent",accent:"bg-primary text-fg-inverted shadow-sm hover:brightness-110 active:scale-95",sand:"bg-muted/60 text-fg-mid hover:bg-muted active:scale-95",muted:"bg-black/[0.03] text-sand-11 hover:bg-black/[0.05] dark:bg-white/[0.06] dark:hover:bg-white/10 active:scale-95",submit:"bg-tangerine-9 text-white hover:brightness-110 active:scale-95",call:"bg-[#028326] text-white hover:brightness-110 dark:bg-[#004d09] active:scale-95","call-disabled":"bg-black/[0.03] text-fg-mid dark:bg-white/[0.06]"}}}),a={transition:"opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1), background-color 0.4s cubic-bezier(0.16, 1, 0.3, 1), color 0.4s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.4s cubic-bezier(0.16, 1, 0.3, 1)"};e.s(["PromptInputButton",0,function(e){let o,s,l,c,u,d,m,p,h,g,f,b,y,v,x,w=(0,r.c)(30);w[0]!==e?({className:l,children:s,variant:f,size:m,collapsed:h,disabled:c,type:g,style:p,boxShadow:o,ref:d,...u}=e,w[0]=e,w[1]=o,w[2]=s,w[3]=l,w[4]=c,w[5]=u,w[6]=d,w[7]=m,w[8]=p,w[9]=h,w[10]=g,w[11]=f):(o=w[1],s=w[2],l=w[3],c=w[4],u=w[5],d=w[6],m=w[7],p=w[8],h=w[9],g=w[10],f=w[11]);let S=void 0!==h&&h,k=void 0===g?"button":g,C=!!c||S;w[12]!==l||w[13]!==S||w[14]!==m||w[15]!==f?(b=(0,n.cn)(i({className:l,collapsed:S,size:m,variant:f})),w[12]=l,w[13]=S,w[14]=m,w[15]=f,w[16]=b):b=w[16],w[17]!==o?(y=o?{boxShadow:o}:void 0,w[17]=o,w[18]=y):y=w[18],w[19]!==p||w[20]!==y?(v={...a,...y,...p},w[19]=p,w[20]=y,w[21]=v):v=w[21];let M=s;return w[22]!==C||w[23]!==u||w[24]!==d||w[25]!==b||w[26]!==v||w[27]!==M||w[28]!==k?(x=(0,t.jsx)("button",{ref:d,className:b,disabled:C,style:v,type:k,...u,children:M}),w[22]=C,w[23]=u,w[24]=d,w[25]=b,w[26]=v,w[27]=M,w[28]=k,w[29]=x):x=w[29],x}])},535473,e=>{"use strict";var t=e.i(45113),r=e.i(403773),n=e.i(17772),i=e.i(448855);let a=Math.floor(44e5/(4/3));function o(){let e=globalThis.window;return e?"MediaRecorder"in e&&e.navigator.mediaDevices?"media-recorder":"SpeechRecognition"in e||"webkitSpeechRecognition"in e?"speech-recognition":"none":"none"}async function s(e){return new Promise((t,r)=>{let n=new FileReader;n.onloadend=()=>{let e=n.result.split(",")[1];e?t(e):r(Error("Failed to convert blob to base64"))},n.onerror=()=>{r(Error("read failed"))},n.readAsDataURL(e)})}function l({className:e,collapsed:c,disabled:u,lang:d="en-US",onLimitReached:m,onRecordingLost:p,onStateChange:h,onTranscriptionChange:g,onTranscriptionError:f,transcribe:b,ref:y,...v}){let[x,w]=(0,n.useState)(!1),[S,k]=(0,n.useState)(!1),[C,M]=(0,n.useState)(!1),R=(0,n.useSyncExternalStore)(()=>()=>{},o,()=>"none"),[A,z]=(0,n.useState)(null),N=A??R,P=(0,n.useRef)(null),I=(0,n.useRef)(null),T=(0,n.useRef)([]),j=(0,n.useRef)(null),E=(0,n.useRef)(""),D=(0,n.useRef)(!0),B=(0,n.useRef)(null),L=(0,n.useRef)(!1),U=(0,n.useRef)(null),_=(0,n.useRef)(0),O=(0,n.useRef)(null),q=(0,n.useRef)(()=>{}),F=(0,n.useRef)(!1),W=(0,n.useRef)(null),Y=(0,n.useRef)(null),$=(0,n.useRef)(g),K=(0,n.useRef)(f),V=(0,n.useRef)(m),G=(0,n.useRef)(p),H=(0,n.useRef)(h);(0,n.useEffect)(()=>{$.current=g,K.current=f,V.current=m,G.current=p,H.current=h},[m,p,h,g,f]);let Q=(0,n.useCallback)(()=>{null!==W.current&&(clearTimeout(W.current),W.current=null)},[]);(0,n.useEffect)(()=>()=>{O.current&&G.current?.()},[]),(0,n.useEffect)(()=>{L.current=x,F.current=S},[x,S]);let J=(0,n.useRef)(null);(0,n.useEffect)(()=>{let e=S?"processing":x?"recording":C?"error":"idle";e!==J.current&&(J.current=e,H.current?.(e,j.current))},[C,x,S]),(0,n.useEffect)(()=>
2{if("speech-recognition"!==N)return;let e=window.SpeechRecognition??window.webkitSpeechRecognition;if(!e)return;let t=new e;return t.continuous=!0,t.interimResults=!0,t.lang=d,t.onstart=()=>{U.current&&(clearTimeout(U.current),U.current=null),E.current="",w(!0)},t.onend=()=>{w(!1),D.current&&E.current.trim()&&$.current?.(E.current.trim()),E.current="",D.current=!0},t.onresult=e=>{for(let t=e.resultIndex;t<e.results.length;t++){let r=e.results[t];r?.isFinal&&(E.current+=r[0]?.transcript??"")}},t.onerror=e=>{console.error("Speech recognition error:",e.error),w(!1),U.current&&(clearTimeout(U.current),U.current=null),new Set(["aborted","audio-capture","network","not-allowed","service-not-allowed"]).has(e.error)&&"MediaRecorder"in window&&"mediaDevices"in navigator&&(z("media-recorder"),B.current?.())},P.current=t,()=>{if(P.current)try{P.current.stop()}catch{}U.current&&(clearTimeout(U.current),U.current=null)}},[d,N]),(0,n.useEffect)(()=>()=>{if(Q(),j.current)for(let e of j.current.getTracks())e.stop()},[Q]);let X=(0,n.useCallback)((e,t)=>{M(!0),K.current?.({canRetry:null!==O.current,error:e,reason:t,retry:()=>q.current()})},[]),Z=(0,n.useCallback)(async e=>{O.current=e,M(!1),k(!0);try{let t=await b(e);O.current=null,t.text&&$.current?.(t.text)}catch(e){X(e,"transcription")}finally{k(!1)}},[X,b]),ee=(0,n.useCallback)(()=>{let e=O.current;e&&!F.current&&Z(e)},[Z]);(0,n.useEffect)(()=>{q.current=ee},[ee]);let et=(0,n.useCallback)(async()=>{try{let e=await navigator.mediaDevices.getUserMedia({audio:!0});j.current=e;let t=new MediaRecorder(e,{audioBitsPerSecond:24e3,...function(){if("isTypeSupported"in MediaRecorder){for(let e of["audio/webm;codecs=opus","audio/webm","audio/mp4"])if(MediaRecorder.isTypeSupported(e))return{mimeType:e}}}()??{}});T.current=[],_.current=0,t.ondataavailable=e=>{0!==e.data.size&&(T.current.push(e.data),_.current+=e.data.size,_.current>=3e6&&"recording"===t.state&&(V.current?.(),t.stop()))},t.onstop=async()=>{let r;for(let t of(Q(),e.getTracks()))t.stop();j.current=null,w(!1);let n=Y.current;if(Y.current=null,!D.current){D.current=!0;return}let i=t.mimeType||"audio/webm",o=new Blob(T.current,{type:i});if(0===o.size){null!==n&&X(n,"microphone");return}if(!(o.size<=a))return void X(Error(`Recording too large to transcribe: ${o.size} bytes`),"recording-too-long");k(!0);try{r={data:await s(o),filename:i.includes("mp4")||i.includes("m4a")?"audio.mp4":i.includes("ogg")?"audio.ogg":i.includes("mpeg")?"audio.mp3":i.includes("wav")?"audio.wav":"audio.webm",mimeType:i}}catch(e){k(!1),X(e,"recording-unreadable");return}await Z(r)},t.onerror=t=>{for(let r of(Y.current=t,Q(),w(!1),e.getTracks()))r.stop();j.current=null},I.current=t,t.start(1e3),w(!0),W.current=setTimeout(()=>{W.current=null,"recording"===t.state&&(V.current?.(),t.stop())},3e5)}catch(e){w(!1),X(e,"microphone")}},[Q,X,Z]);(0,n.useEffect)(()=>{B.current=et},[et]);let er=(0,n.useCallback)(()=>{I.current?.state==="recording"&&I.current.stop(),w(!1)},[]),en=(0,n.useCallback)(()=>{if(D.current=!1,I.current?.state==="recording"&&I.current.stop(),j.current){for(let e of j.current.getTracks())e.stop();j.current=null}w(!1)},[]),ei=(0,n.useCallback)(()=>{if(!x&&!S)if(O.current=null,M(!1),"speech-recognition"===N&&P.current){try{P.current.start()}catch{"MediaRecorder"in window&&"mediaDevices"in navigator&&(z("media-recorder"),et());return}U.current=setTimeout(()=>{if(!L.current&&"MediaRecorder"in window&&"mediaDevices"in navigator){try{P.current?.stop()}catch{}z("media-recorder"),et()}},1500)}else"media-recorder"===N&&et()},[x,S,N,et]),ea=(0,n.useCallback)(()=>{x&&("speech-recognition"===N&&P.current?(D.current=!1,P.current.stop()):"media-recorder"===N&&en())},[N,x,en]),eo=(0,n.useCallback)(()=>{x&&("speech-recognition"===N&&P.current?(D.current=!0,P.current.stop()):"media-recorder"===N&&er())},[N,x,er]);(0,n.useImperativeHandle)(y,()=>({cancelRecording:ea,startRecording:ei,submitRecording:eo}),[ea,ei,eo]);let es=!!u||"none"===N||S||x;return(0,t.jsx)(i.PromptInputButton,{"aria-label":"Start voice input",className:e,collapsed:c,disabled:es,type:"button",onClick:ei,...v,children:(0,t.jsx)(r.MicrophoneIcon,{className:"size-5"})})}l.displayName="PromptInputSpeech",e.s(["PromptInputSpeech",0,l,"isSpeechBusy",0,function(e){return"recording"===e||"processing"===e}],535473)},219408,e=>{"use strict";e.s(["TRANSCRIPTION_TIMEOUT_MS",0,25e4,"transcriptionRequestOptions",0,{networkMode:"always"}])},766848,e=>{"use strict";var t=e.i(413701),r=e.i(17772),n=e.i(831543);e.s(["useSpeechNotice",0,function(){let e,i,a,o,s,l,c=(0,t.c)(10),[u,d]=(0,r.useState)("idle"),[m,p]=(0,r.useState)(null);c[0]===Symbol.for("react.memo_cache_sentinel")?(e=e=>{d(e),("recording"===e||"idle"===e)&&p(null)},c[0]=e):e=c[0];let h=e;c[1]===Symbol.for("react.memo_cache_sentinel")?(i=e=>{let t,r;p((t="transcription"===e.reason?(0,n.parseVisibleError)(e.error):null,r=e.canRetry&&t?.code!=="invalid_format",{message:function(e,t){switch(e.reason){case"microphone":return"Can't reach your microphone. Allow access, then record again.";case"recording-too-long":return"That recording was too long to send. Try a shorter one.";case"recording-unreadable":return"Couldn't read that recording. Record it again.";case"transcription":return t?.message??"Couldn't turn that recording into text."}}(e,t),tone:"error",...r?{action:{label:"Try again",onClick:e.retry}}:void 0}))},c[1]=i):i=c[1];let g=i;c[2]===Symbol.for("react.memo_cache_sentinel")?(a=()=>{p({message:"Stopped at the longest recording we can send.",tone:"info"})},c[2]=a):a=c[2];let f=a;c[3]===Symbol.for("react.memo_cache_sentinel")?(o=()=>p(null),c[3]=o):o=c[3];let b=o;return c[4]!==m||c[5]!==u?(s=m?{...m,pending:"processing"===u}:null,c[4]=m,c[5]=u,c[6]=s):s=c[6],c[7]!==u||c[8]!==s?(l={dismiss:b,notice:s,onLimitReached:f,onStateChange:h,onTranscriptionError:g,state:u},c[7]=u,c[8]=s,c[9]=l):l=c[9],l}],766848)},541059,e=>{"use strict";var t=e.i(45113),r=e.i(413701),n=e.i(779882),i=e.i(591401),a=e.i(981831),o=e.i(403773),s=e.i(619409),l=e.i(632137);let c={above:"absolute inset-x-0 bottom-full z-20 mb-2",inline:"relative"};e.s(["SpeechNoticeBar",0,function(e){let u,d,m,p,h=(0,r.c)(12),{className:g,notice:f,onDismiss:b,placement:y}=e,v=void 0===y?"above":y,x=c[v],w="inline"===v&&f&&"my-2";return h[0]!==g||h[1]!==x||h[2]!==w?(u=(0,l.cn)("pointer-events-none flex justify-center px-2",x,w,g),h[0]=g,h[1]=x,h[2]=w,h[3]=u):u=h[3],h[4]!==f||h[5]!==b?(d=f?(0,t.jsxs)(i.motion.div,{animate:{o
2pacity:1,scale:1,y:0},className:(0,l.cn)("pointer-events-auto flex max-w-full items-center gap-1.5 py-1.5 pl-3 pr-1.5 text-sm","rounded-2xl border border-loud bg-surface-primary shadow-md dark:shadow-none"),exit:{opacity:0,scale:.9,y:8},initial:{opacity:0,scale:.9,y:8},role:"error"===f.tone?"alert":"status",transition:{type:"spring",stiffness:500,damping:30},children:[(0,t.jsx)("span",{className:(0,l.cn)("min-w-0 text-pretty","error"===f.tone?"text-fg-error":"text-fg-mid"),children:f.message}),f.action?(0,t.jsxs)(a.Button,{className:"shrink-0",disabled:f.pending,size:"xs",type:"button",variant:"ghost",onClick:f.action.onClick,children:[f.pending?(0,t.jsx)(s.LoadingSpinnerIcon,{"aria-hidden":!0,className:"animate-spin"}):null,f.action.label]}):null,(0,t.jsx)(a.Button,{"aria-label":"Dismiss",className:"shrink-0",size:"icon-xs",type:"button",variant:"ghost",onClick:b,children:(0,t.jsx)(o.XmarkIcon,{"aria-hidden":!0})})]}):null,h[4]=f,h[5]=b,h[6]=d):d=h[6],h[7]!==d?(m=(0,t.jsx)(n.AnimatePresence,{initial:!1,children:d}),h[7]=d,h[8]=m):m=h[8],h[9]!==u||h[10]!==m?(p=(0,t.jsx)("div",{className:u,children:m}),h[9]=u,h[10]=m,h[11]=p):p=h[11],p}])}]); 3 4//# debugId=4d65a009-eea2-b554-20d6-7ce94b5d96d0
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.