1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9557],{10375:(e,t,a)=>{a.d(t,{M:()=>n});var s=a(12115);function n(){let[e,t]=(0,s.useState)(!1);return(0,s.useEffect)(()=>{if("function"!=typeof window.matchMedia)return;let e=window.matchMedia("(hover: hover) and (pointer: fine)"),a=()=>t(e.matches);return(a(),"function"==typeof e.addEventListener)?(e.addEventListener("change",a),()=>e.removeEventListener("change",a)):(e.addListener(a),()=>e.removeListener(a))},[]),e}},12459:(e,t,a)=>{a.d(t,{Illustration:()=>u});var s=a(95155),n=a(12115),r=a(15239),i=a(67909),o=a(25016);let l={"empty-contacts":{type:"svg",path:"/assets/illustrations/empty-contacts.svg"},"empty-agents":{type:"svg",path:"/assets/illustrations/empty-agents.svg"},"empty-kanban":{type:"svg",path:"/assets/illustrations/empty-kanban.svg"},"empty-flows":{type:"svg",path:"/assets/illustrations/empty-flows.svg"},"empty-campaigns":{type:"svg",path:"/assets/illustrations/empty-campaigns.svg"},"empty-tags":{type:"svg",path:"/assets/illustrations/empty-tags.svg"},"empty-chat-list":{type:"svg",path:"/assets/illustrations/empty-chat-list.svg"},"empty-webhooks":{type:"svg",path:"/assets/illustrations/empty-webhooks.svg"},"empty-webhook":{type:"svg",path:"/assets/illustrations/empty-webhook.svg"},"empty-sequences":{type:"svg",path:"/assets/illustrations/empty-flows.svg"},"empty-quick-replies":{type:"svg",path:"/assets/illustrations/empty-quick-replies.svg"},"empty-integrations":{type:"svg",path:"/assets/illustrations/empty-integrations.svg"},"empty-fields":{type:"svg",path:"/assets/illustrations/empty-fields.svg"},"empty-teams":{type:"svg",path:"/assets/illustrations/empty-teams.svg"},"error-generic":{type:"svg",path:"/assets/illustrations/error-generic.svg"},"error-404":{type:"svg",path:"/assets/illustrations/error-404.svg"},"auth-error":{type:"svg",path:"/assets/illustrations/auth-error.svg"},"success-signup":{type:"svg",path:"/assets/illustrations/success-signup.svg"},"success-verify-email":{type:"svg",path:"/assets/illustrations/success-verify-email.svg"},"onboarding-welcome":{type:"svg",path:"/assets/illustrations/onboarding-welcome.svg"}},c=(0,i.default)(()=>Promise.all([a.e(9066),a.e(7853)]).then(a.t.bind(a,67853,23)),{loadableGenerated:{webpack:()=>[67853]},ssr:!1}),d={sm:{width:180,height:180},md:{width:260,height:260},lg:{width:340,height:340},xl:{width:440,height:440}};function u(e){var t;let{name:a,size:i="md",width:c,height:u,className:g,alt:h}=e,m=function(){let[e,t]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let e=window.matchMedia("(prefers-reduced-motion: reduce)");t(e.matches);let a=e=>t(e.matches);return e.addEventListener("change",a),()=>e.removeEventListener("change",a)},[]),e}(),f=null!=(t=l[a])?t:null;if(!f)return null;let v={width:null!=c?c:d[i].width,height:null!=u?u:d[i].height},y=null!=h?h:a.replace(/-/g," ");switch(f.type){case"svg":case"png":return(0,s.jsx)(r.default,{src:f.path,alt:y,width:v.width,height:v.height,unoptimized:"svg"===f.type,role:"img","aria-label":y,className:(0,o.cn)("illustration-enter",g),priority:!1});case"lottie":return(0,s.jsx)(p,{path:f.path,width:v.width,height:v.height,prefersReducedMotion:m,className:g});case"component":{let e=f.component;return(0,s.jsx)("div",{style:{width:v.width,height:v.height},role:"img","aria-label":y,className:(0,o.cn)("illustration-enter",g),children:(0,s.jsx)(e,{className:"w-full h-full"})})}default:return null}}function p(e){let{path:t,width:a,height:r,prefersReducedMotion:i,className:l}
1=e,[d,u]=(0,n.useState)(null);return((0,n.useEffect)(()=>{fetch(t).then(e=>e.json()).then(u).catch(()=>{})},[t]),d)?(0,s.jsx)("div",{style:{width:a,height:r},"aria-hidden":"true",className:(0,o.cn)("illustration-enter",l),children:(0,s.jsx)(c,{animationData:d,loop:!i,autoplay:!i,style:{width:"100%",height:"100%"}})}):null}},13886:(e,t,a)=>{a.d(t,{p:()=>o});var s=a(95155),n=a(97003),r=a(12459),i=a(25016);function o(e){let{icon:t,illustration:a,illustrationSize:o="md",title:l,description:c,action:d,secondaryAction:u,tertiaryAction:p,className:g}=e,h=null==d?void 0:d.icon,m=null==u?void 0:u.icon,f=null==p?void 0:p.icon;return(0,s.jsxs)("div",{className:(0,i.cn)("flex flex-col items-center justify-center gap-4 bg-card rounded-lg px-6 py-12 text-center",g),children:[a?(0,s.jsx)(r.Illustration,{name:a,size:o}):t?(0,s.jsx)("div",{className:"w-16 h-16 bg-muted rounded-full flex items-center justify-center",children:(0,s.jsx)(t,{className:"w-6 h-6 text-muted-foreground"})}):null,(0,s.jsxs)("div",{className:"space-y-1.5",children:[(0,s.jsx)("p",{className:"text-sm font-medium text-foreground",children:l}),c&&(0,s.jsx)("p",{className:"text-sm text-muted-foreground max-w-xs mx-auto",children:c})]}),(d||u||p)&&(0,s.jsxs)("div",{className:"flex flex-col items-center gap-2",children:[d&&(0,s.jsxs)(n.$,{onClick:d.onClick,className:"w-fit",children:[h&&(0,s.jsx)(h,{className:"size-5"}),d.label]}),u&&(0,s.jsxs)(n.$,{variant:"ghost",onClick:u.onClick,className:"w-fit",children:[m&&(0,s.jsx)(m,{className:"size-5"}),u.label]}),p&&(0,s.jsxs)(n.$,{variant:"ghost",onClick:p.onClick,className:"w-fit",children:[f&&(0,s.jsx)(f,{className:"size-5"}),p.label]})]})]})}},33125:(e,t,a)=>{a.d(t,{U:()=>n});var s=a(12115);function n(e){let t=(0,s.useCallback)(t=>{let a=window.matchMedia(e);return a.addEventListener("change",t),()=>a.removeEventListener("change",t)},[e]),a=(0,s.useCallback)(()=>window.matchMedia(e).matches,[e]),n=(0,s.useCallback)(()=>!1,[]);return(0,s.useSyncExternalStore)(t,a,n)}},41764:(e,t,a)=>{a.d(t,{b:()=>o,default:()=>l});var s=a(95155),n=a(12115),r=a(20063);let i=["/chat","/auth","/login","/","/completar-perfil","/onboarding"];function o(){let[e,t]=(0,n.useState)(!1),[a,s]=(0,n.useState)(!1);return(0,n.useEffect)(()=>{let e=window.matchMedia("(display-mode: standalone)").matches||!0===window.navigator.standalone||document.referrer.includes("android-app://"),a=()=>{let e=window.innerWidth<768,t="ontouchstart"in window||navigator.maxTouchPoints>0;s(e||t&&window.innerWidth<1024)};return t(e),a(),window.addEventListener("resize",a),()=>window.removeEventListener("resize",a)},[]),{isPWA:e,isMobile:a}}let l=function(e){let{children:t}=e,a=(0,r.usePathname)(),l=(0,r.useRouter)(),{isPWA:c,isMobile:d}=o();return(0,n.useEffect)(()=>{"serviceWorker"in navigator&&("localhost"===window.location.hostname||"127.0.0.1"===window.location.hostname||window.location.hostname.startsWith("192.168.")||window.location.hostname.endsWith(".local")?(navigator.serviceWorker.getRegistrations().then(e=>{for(let t of e)t.unregister().then(e=>{})}),"caches"in window&&caches.keys().then(e=>{for(let t of e)caches.delete(t)})):navigator.serviceWorker.register("/sw.js").then(e=>{}).catch(e=>{}))},[]),(0,n.useEffect)(()=>{c&&d&&a&&(i.some(e=>a===e||a.startsWith(e+"/"))||l.replace("/chat"))},[c,d,a,l]),(0,s.jsx)(s.Fragment,{children:t})}},47507:(e,t,a)=>{a.d(t,{TR:()=>h,bq:()=>p,eb:()=>m,gC:()=>g,l6:()=>c,s3:()=>d,yv:()=>u});var s=a(95155);a(12115);var n=a(4729),r=a(99099),i=a(47522),o=a(33016),l=a(25016);function c(e){let{...t}=e;return(0,s.jsx)(n.bL,{"data-slot":"select",...t})}function d(e){let{...t}=e;return(0,s.jsx)(n.YJ,{"data-slot":"select-group",...t})}function u(e){let{...t}=e;return(0,s.jsx)(n.WT,{"data-slot":"select-value",...t})}function p(e){let{className:t,size:a="default",children:i,...o}=e;return(0,s.jsxs)(n.l9,{"data-slot":"select-trigger","data-size":a,className:(0,l.cn)("data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive bg-input-bg hover:bg-input-bg-hover flex w-fit items-center justify-between gap-2 rounded-md border border-border/50 px-3 py-2 text-sm whitespace-nowrap transition-all outline-none disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4","focus-visible:bg-input-bg-focus focus-visible:ring-ring/50 focus-visible:ring-[2px] focus-visible:border-ring",t),...o,children:[i,(0,s.jsx)(n.In,{asChild:!0,children:(0,s.jsx)(r.A,{className:"size-5 text-muted-foreground"})})]})}function g(e){let{className:t,children:a,position:r="popper",align:i="center",...o}=e;return(0,s.jsx)(n.ZL,{children:(0,s.jsxs)(n.UC,{"data-slot":"select-content",className:(0,l.cn)("bg-card text-card-foreground data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:sli
1de-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-lg border border-border shadow-lg","popper"===r&&"data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1",t),position:r,align:i,...o,children:[(0,s.jsx)(f,{}),(0,s.jsx)(n.LM,{className:(0,l.cn)("p-1","popper"===r&&"h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1"),children:a}),(0,s.jsx)(v,{})]})})}function h(e){let{className:t,...a}=e;return(0,s.jsx)(n.JU,{"data-slot":"select-label",className:(0,l.cn)("text-muted-foreground px-2 py-1.5 text-xs",t),...a})}function m(e){let{className:t,children:a,...r}=e;return(0,s.jsxs)(n.q7,{"data-slot":"select-item",className:(0,l.cn)("focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:text-disabled-foreground [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",t),...r,children:[(0,s.jsx)("span",{className:"absolute right-2 flex size-3.5 items-center justify-center",children:(0,s.jsx)(n.VF,{children:(0,s.jsx)(i.A,{className:"size-5"})})}),(0,s.jsx)(n.p4,{children:a})]})}function f(e){let{className:t,...a}=e;return(0,s.jsx)(n.PP,{"data-slot":"select-scroll-up-button",className:(0,l.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,s.jsx)(o.A,{className:"size-5"})})}function v(e){let{className:t,...a}=e;return(0,s.jsx)(n.wn,{"data-slot":"select-scroll-down-button",className:(0,l.cn)("flex cursor-default items-center justify-center py-1",t),...a,children:(0,s.jsx)(r.A,{className:"size-5"})})}},55667:(e,t,a)=>{a.d(t,{gG:()=>i,MT:()=>u});var s=a(21344),n=a(83654);class r{async getAgents(e){return this.api.get(n.Sn.AGENTS,e)}async getAgent(e){return this.api.get("".concat(n.Sn.AGENTS,"/").concat(e))}async createAgent(e){return this.api.post(n.Sn.AGENTS,e)}async updateAgent(e,t){return this.api.put("".concat(n.Sn.AGENTS,"/").concat(e),t)}async deleteAgent(e){await this.api.delete("".concat(n.Sn.AGENTS,"/").concat(e))}async getDefaultAgent(){try{return await this.api.get("".concat(n.Sn.AGENTS,"/default"))}catch(e){if(e instanceof Error&&e.message.includes("404"))return null;throw e}}async getAgentConfig(){try{return await this.api.get(n.Sn.AGENT_CONFIG)}catch(e){if(e instanceof Error&&e.message.includes("404"))return null;throw e}}async createAgentConfig(e){return this.api.post(n.Sn.AGENT_CONFIG,e)}async updateAgentConfig(e){return this.api.put(n.Sn.AGENT_CONFIG,e)}async getTemplates(){return this.api.get("".concat(n.Sn.AGENTS,"/templates"))}async createFromTemplate(e,t){return this.api.post("".concat(n.Sn.AGENTS,"/templates/").concat(e,"/create"),t||{})}async executeAgent(e){return this.api.post("".concat(n.Sn.AGENTS,"/execute"),e)}async getExecutions(e){return this.api.get("".concat(n.Sn.AGENTS,"/executions"),e)}async getExecution(e){return this.api.get("".concat(n.Sn.AGENTS,"/executions/").concat(e))}async createKnowledgeBase(e){return this.api.post(n.Sn.AGENT_KNOWLEDGE_BASE(e),{})}async getKnowledgeBase(e){try{return await this.api.get(n.Sn.AGENT_KNOWLEDGE_BASE(e))}catch(e){if(e instanceof s.hD&&404===e.statusCode)return null;throw e}}async deleteKnowledgeBase(e){await this.api.delete(n.Sn.AGENT_KNOWLEDGE_BASE(e))}async listKnowledgeSources(e){return this.api.get(n.Sn.AGENT_KNOWLEDGE_BASE_SOURCES(e))}async createFaqSource(e,t){let a=new FormData;return a.append("source_type","FAQ"),a.append("title",t.title),t.faq_question&&a.append("faq_question",t.faq_question),a.append("faq_answer",t.faq_answer),this.api.upload(n.Sn.AGENT_KNOWLEDGE_BASE_SOURCES(e),a)}async createWebsiteSource(e,t){let a=new FormData;return a.append("source_type","WEBSITE"),a.append("title",t.title),a.append("website_url",t.website_url),this.api.upload(n.Sn.AGENT_KNOWLEDGE_BASE_SOURCES(e),a)}async createDocumentSource(e,t){let a=new FormData;return a.append("source_type","DOCUMENT"),a.append("title",t.title),a.append("file",t.file),this.api.upload(n.Sn.AGENT_KNOWLEDGE_BASE_SOURCES(e),a)}async deleteKnowledgeSource(e,t){await this.api.delete(n.Sn.AGENT_KNOWLEDGE_BASE_SOURCE(e,t))}async reindexKnowledgeSource(e,t){return this.api.post(n.Sn.AGENT_KNOWLEDGE_BASE_SOURCE_REINDEX(e,t),{})}async getMetrics(e,t){let a={};return e&&(a.agent_id=e),t&&(a.period=t),this.api.get("".concat(n.Sn.AGENTS,"/metrics"),a)}constructor(){this.api=new s.OW}}let i=new r,o=e=>e.trim().replace(/\s+/g," ").replace(/[^\w\s-]/g,"").split(" ").map(e=>e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()).join(" "),l=e=>({...e,isEnabled:void 0!==e.is_enabled?e.is_enabled:e.isEnabled,orderIndex:void 0!==e.order_index?e.order_index:e.orderIndex,agentId:void 0!==e.agent_id?e.agent_id:e.agentId,tenantId:void 0!==e.tenant_id?e.tenant_id:e.tenantId,createdAt:void 0!==e.created_at?e.created_at:e.createdAt,updatedAt:void 0!==e.updated_at?e.updated_at:e.updatedAt});class c{async getToolsByAgent(e){let t=await this.api.get(n.Sn.AGENT_TOOLS(e)),a=[];if(Array.isArray(t))a=t;else if(t&&Array.isArray(t.data))a=t.data;else{if(!(t&&Array.isArray(t.tools)))return[];a=t.tools}return a.map(l)}async getAllTools(){let e=await this.api.get("".concat(n.Sn.AGENTS,"/tools")),t=[];if(Array.isArray(e))t=e;else if(e&&Array.isArray(e.data))t=e.data;else{if(!(e&&Array.isArray(e.tools)))return[];t=e.tools}return t.map(l)}async createTool(e,t){let a={...t,name:o(t.name)};return l(await this.api.post(n.Sn.AGENT_TOOLS(e),a))}async updateTool(e,t){let a=t.name?{...t,name:o(t.name)}:t;return l(await this.api.put("".concat(n.Sn.AGENTS,"/tools/").concat(e),a))}async deleteTool(e){await this.api.delete("".concat(n.Sn.AGENTS,"/tools/").concat(e))}async executeTool(e){try{let t=Date.now(),a=await this.api.post("".concat(n.Sn.AGENTS,"/tools/execute"),e),s=Date.now()-t;return{success:!0,data:a,executionTime:s}}catch(e){return{success:!1,error:e instanceof Error?e.message:"Unknown error",executionTime:0}}}async getToolTypes(){return this.api.get("".concat(n.Sn.AGENTS,"/tools/types"))}async validateToolConfiguration(e,t){return this.api.post("".concat(n.Sn.AGENTS,"/tools/validate"),{type:e,configuration:t})}async toggleTool(e,t){return this.updateTool(e,{isEnabled:t})}constructor(){this.api=new s.OW}}new c;class d{async getConfig(e){return this.api.get(n.Sn.AGENT_FOLLOW_UP(e))}async upsertConfig(e,t){return this.api.put(n.Sn.AGENT_FOLLOW_UP(e),t)}async deleteConfig(e){await this.api.delete(n.Sn.AGENT_FOLLOW_UP(e))}constructor(){this.api=new s.OW}}let u=new d;a(94134),a(93657)},55798:(e,t,a)=>{a.d(t,{m:()=>p});var s=a(95155),n=a(12115),r=a(2499),i=a(73610),o=a(47507),l=a(20140),c=a(28105),d=a(88503),u=a(25016);function p(){var e;let{triggerClassName:t}=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},{accounts:a,isLoading:p}=(0,d.I)(),{setAccounts:g,markAccountsLoaded:h}=(0,l.J)(),{channelAccountId:m,setChannelAccountId:f,accounts:v}=(0,c.w1)();(0,n.useEffect)(()=>
1{if(a&&a.length>0){let t=[];for(let s of a)if(s.phoneNumbers&&s.phoneNumbers.length>0)for(let a of s.phoneNumbers){var e;let n=a.metadata,r=(null==n?void 0:n.verified_name)||a.verifiedName||s.wabaName||"WhatsApp";t.push({id:a.id,displayName:r,accountIdentifier:a.phoneNumber||a.phoneNumberId||"",phoneNumber:a.displayPhoneNumber||a.phoneNumber||"",status:(null==(e=a.status)?void 0:e.toLowerCase())||s.status||"pending",channelType:"whatsapp"})}g(t)}},[a,g]),(0,n.useEffect)(()=>{p||h()},[p,h]);let y=m?v.find(e=>e.id===m):null,w=(null==y||null==(e=y.phoneNumber)?void 0:e.replace(/\D/g,"").slice(-4))||"";return p?(0,s.jsx)("div",{className:"w-52 h-9 bg-muted animate-pulse rounded-md"}):0===v.length?null:(0,s.jsxs)(o.l6,{value:m||"all",onValueChange:e=>{"all"===e?f(null):f(e)},children:[(0,s.jsx)(o.bq,{className:(0,u.cn)("w-52 h-9 pr-2",t),children:(0,s.jsx)(o.yv,{placeholder:"Selecionar conta",children:y?(0,s.jsxs)("div",{className:"flex items-center gap-2 min-w-0",children:[(0,s.jsx)(r.A,{className:"size-4 text-green-600 shrink-0"}),(0,s.jsx)("span",{className:"truncate",children:y.displayName}),w&&(0,s.jsx)("span",{className:"text-muted-foreground tabular-nums shrink-0",children:w})]}):(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(i.A,{className:"size-4 text-muted-foreground"}),(0,s.jsx)("span",{children:"Todas as contas"})]})})}),(0,s.jsxs)(o.gC,{children:[(0,s.jsx)(o.eb,{value:"all",children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(i.A,{className:"size-4 text-muted-foreground"}),(0,s.jsx)("span",{children:"Todas as contas"})]})}),v.map(e=>{var t;let a=(null==(t=e.phoneNumber)?void 0:t.replace(/\D/g,"").slice(-4))||"";return(0,s.jsx)(o.eb,{value:e.id,children:(0,s.jsxs)("div",{className:"flex items-center gap-2",children:[(0,s.jsx)(r.A,{className:"size-4 text-green-600"}),(0,s.jsx)("span",{className:"truncate max-w-[130px]",title:e.displayName,children:e.displayName}),a&&(0,s.jsx)("span",{className:"text-muted-foreground tabular-nums shrink-0",children:a})]})},e.id)})]})]})}},57073:(e,t,a)=>{a.d(t,{E:()=>i,V:()=>r});var s=a(12115),n=a(10375);let r="app:shell-resize";
1function i(){let e=(0,n.M)(),[t,a]=(0,s.useState)(null),i=(0,s.useRef)(!1),o=(0,s.useRef)(!0);return(0,s.useEffect)(()=>{if(e)return void a(null);let t=window.visualViewport;if(!t)return;let s=0,n=()=>{i.current||(0!==window.scrollY||0!==t.offsetTop)&&(i.current=!0,window.scrollTo(0,0),s=requestAnimationFrame(()=>{i.current=!1})),a(document.documentElement.clientHeight-t.height>150?Math.round(t.height):null)};return n(),t.addEventListener("resize",n),t.addEventListener("scroll",n),()=>{t.removeEventListener("resize",n),t.removeEventListener("scroll",n),cancelAnimationFrame(s),i.current=!1}},[e]),(0,s.useEffect)(()=>{if(o.current){o.current=!1;return}let e=requestAnimationFrame(()=>{window.dispatchEvent(new CustomEvent(r))});return()=>cancelAnimationFrame(e)},[t]),t}},67812:(e,t,a)=>{a.d(t,{E:()=>l});var s=a(95155);a(12115);var n=a(32467),r=a(83101),i=a(25016);let o=(0,r.F)("inline-flex items-center justify-center rounded-sm border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90",secondary:"border-transparent bg-muted text-foreground [a&]:hover:bg-accent/90",destructive:"border-transparent bg-error-bg text-error-foreground [a&]:hover:bg-error-bg/80 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40",success:"border-transparent bg-success-bg text-success-foreground [a&]:hover:bg-success-bg/80",warning:"border-transparent bg-warning-bg text-warning-foreground [a&]:hover:bg-warning-bg/80",outline:"text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground"}},defaultVariants:{variant:"default"}});function l(e){let{className:t,variant:a,asChild:r=!1,...l}=e,c=r?n.DX:"span";return(0,s.jsx)(c,{"data-slot":"badge",className:(0,i.cn)(o({variant:a}),t),...l})}},78148:(e,t,a)=>{a.d(t,{P:()=>i,m:()=>r});var s=a(25959),n=a(89863);let r=(0,s.v)()(e=>({items:[],set:t=>e({items:t}),clear:()=>e({items:[]})})),i=(0,s.v)()((0,n.Zr)(e=>({isOpen:!1,isCollapsed:!1,isMobile:!1,toggleOpen:()=>e(e=>({isOpen:!e.isOpen})),toggleCollapsed:()=>e(e=>({isCollapsed:!e.isCollapsed})),setCollapsed:t=>e({isCollapsed:t}),setMobile:t=>e({isMobile:t}),closeMobile:()=>e({isOpen:!1})}),{name:"sidebar-storage",partialize:e=>({isCollapsed:e.isCollapsed})}))},78923:(e,t,a)=>{a.d(t,{c:()=>i});var s=a(12115);let n=new(a(51515)).OW;function r(e){let t=new Uint8Array(e),a="";for(let e=0;e<t.byteLength;e++)a+=String.fromCharCode(t[e]);return window.btoa(a)}function i(){let[e,t]=(0,s.useState)("default"),[a,i]=(0,s.useState)(!1),[o,l]=(0,s.useState)(!1);(0,s.useEffect)(()=>{if(!("Notification"in window)||!("serviceWorker"in navigator)||!("PushManager"in window))return void t("unsupported");t(Notification.permission),"granted"===Notification.permission&&navigator.serviceWorker.getRegistration().then(e=>{e&&e.pushManager.getSubscription().then(e=>{i(!!e)})})},[]);let c=(0,s.useCallback)(async()=>{if("unsupported"===e)return;let a="BMRQLKv2BmBbqdun2L1QZ5IYAxEjNpe4FnWLDhig1Rqkn9DjpvmTkEVi44zjIjZ4RnMbUZ16Jb8N8kJa1yWrlsI";if(a&&await navigator.serviceWorker.getRegistration()){l(!0);try{let e=await Notification.requestPermission();if(t(e),"granted"!==e)return;let s=await navigator.serviceWorker.ready,o=await s.pushManager.subscribe({userVisibleOnly:!0,applicationServerKey:function(e){let t="=".repeat((4-e.length%4)%4),a=(e+t).replace(/-/g,"+").replace(/_/g,"/"),s=window.atob(a),n=new Uint8Array(s.length);for(let e=0;e<s.length;++e)n[e]=s.charCodeAt(e);return n}(a).buffer}),l=o.getKey("p256dh"),c=o.getKey("auth");if(!l||!c)return;await n.post("/api/v1/notifications/push/subscribe",{endpoint:o.endpoint,p256dh:r(l),auth:r(c),userAgent:navigator.userAgent}),i(!0)}catch(e){}finally{l(!1)}}},[e]);return{permission:e,isSubscribed:a,isLoading:o,requestPermission:c,unsubscribe:(0,s.useCallback)(async()=>
1{l(!0);try{let e=await navigator.serviceWorker.ready,t=await e.pushManager.getSubscription();t&&(await n.delete("/api/v1/notifications/push/subscribe/".concat(encodeURIComponent(t.endpoint))),await t.unsubscribe()),i(!1)}catch(e){}finally{l(!1)}},[])}}},82180:(e,t,a)=>{a.d(t,{Bc:()=>i,ZI:()=>c,k$:()=>l,m_:()=>o});var s=a(95155);a(12115);var n=a(26852),r=a(25016);function i(e){let{delayDuration:t=0,...a}=e;return(0,s.jsx)(n.Kq,{"data-slot":"tooltip-provider",delayDuration:t,...a})}function o(e){let{...t}=e;return(0,s.jsx)(i,{children:(0,s.jsx)(n.bL,{"data-slot":"tooltip",...t})})}function l(e){let{...t}=e;return(0,s.jsx)(n.l9,{"data-slot":"tooltip-trigger",...t})}function c(e){let{className:t,sideOffset:a=0,children:i,...o}=e;return(0,s.jsx)(n.ZL,{children:(0,s.jsxs)(n.UC,{"data-slot":"tooltip-content",sideOffset:a,className:(0,r.cn)("bg-primary text-primary-foreground animate-in fade-in-0 zoom-in-95 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 w-fit origin-(--radix-tooltip-content-transform-origin) rounded-md px-3 py-1.5 text-xs text-balance",t),...o,children:[i,(0,s.jsx)(n.i3,{className:"bg-primary fill-primary z-50 size-2.5 translate-y-[calc(-50%_-_2px)] rotate-45 rounded-[2px]"})]})})}},93657:(e,t,a)=>{a.d(t,{B:()=>o});var s=a(21344),n=a(83654),r=a(92343);class i{async listTenantVoices(){let e=await this.api.get(n.Sn.VOICES);return Array.isArray(e)?e:e.data||[]}async listElevenLabsVoices(){let e=await this.api.get(n.Sn.VOICES_ELEVENLABS);return Array.isArray(e)?e:e.data||[]}async cloneVoice(e,t,a){let s=await (0,r.getAuthHeaders)(),i=new FormData;i.append("name",e),i.append("description",t),a.forEach(e=>i.append("files",e));let o=await fetch("".concat(n.PI.API_BASE_URL).concat(n.Sn.VOICES_CLONE),{method:"POST",headers:{Authorization:s.Authorization},body:i});if(!o.ok){let e=await o.json().catch(()=>({message:"Erro ao clonar voz"}));throw Error("string"==typeof e.message?e.message:"Erro ao clonar voz")}let l=await o.json();return l.data||l}async deleteVoice(e){await this.api.delete(n.Sn.VOICES_ITEM(e))}async preview(e,t){return(await this.api.post(n.Sn.VOICES_PREVIEW(e),{text:t})).audio_url}constructor(){this.api=new s.OW}}let o=new i},94134:(e,t,a)=>{a.d(t,{L:()=>o});var s=a(21344),n=a(83654),r=a(92343);class i{async listCatalogs(){return this.api.get("".concat(n.Sn.MEDIA_LIBRARY,"/catalogs"))}async createCatalog(e,t){return this.api.post("".concat(n.Sn.MEDIA_LIBRARY,"/catalogs"),{name:e,description:t})}async updateCatalog(e,t){return this.api.patch("".concat(n.Sn.MEDIA_LIBRARY,"/catalogs/").concat(e),t)}async deleteCatalog(e){await this.api.delete("".concat(n.Sn.MEDIA_LIBRARY,"/catalogs/").concat(e))}async list(e){return this.api.get(n.Sn.MEDIA_LIBRARY,e)}async upload(e,t){let a=await (0,r.getAuthHeaders)(),s=new FormData;s.append("file",e),(null==t?void 0:t.name)&&s.append("name",t.name),(null==t?void 0:t.category)&&s.append("category",t.category),(null==t?void 0:t.description)&&s.append("description",t.description),(null==t?void 0:t.catalog_id)&&s.append("catalog_id",t.catalog_id);let i=await fetch("".concat(n.PI.API_BASE_URL).concat(n.Sn.MEDIA_LIBRARY,"/upload"),{method:"POST",headers:{Authorization:a.Authorization},body:s});if(!i.ok){let e=await i.json().catch(()=>({message:"Erro ao fazer upload"}));throw Error("string"==typeof e.message?e.message:"Erro ao fazer upload")}let o=await i.json();return o.data||o}async update(e,t){return this.api.patch("".concat(n.Sn.MEDIA_LIBRARY,"/").concat(e),t)}async delete(e){await this.api.delete(n.Sn.MEDIA_LIBRARY_ITEM(e))}constructor(){this.api=new s.OW}}let o=new i}}]);
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.