1/*! For license information please see 274.d1a6c848.chunk.js.LICENSE.txt */ 2"use strict";(self.webpackChunktelescope=self.webpackChunktelescope||[]).push([[274],{33632:(e,t,r)=>{r.d(t,{A:()=>n});const n=(0,r(9407).A)("workflow",[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]])},44514:(e,t,r)=>{r.d(t,{B8:()=>S,UC:()=>_,bL:()=>F,l9:()=>T});var n=r(96540),a=r(32338),s=r(62133),i=r(76278),o=r(7971),l=r(12579),u=r(71427),c=r(81351),d=r(18723),p=r(74848),m="Tabs",[f,g]=(0,s.A)(m,[i.RG]),x=(0,i.RG)(),[h,b]=f(m),v=n.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,onValueChange:a,defaultValue:s,orientation:i="horizontal",dir:o,activationMode:f="automatic",...g}=e,x=(0,u.jH)(o),[b,v]=(0,c.i)({prop:n,onChange:a,defaultProp:s??"",caller:m});return(0,p.jsx)(h,{scope:r,baseId:(0,d.B)(),value:b,onValueChange:v,orientation:i,dir:x,activationMode:f,children:(0,p.jsx)(l.sG.div,{dir:x,"data-orientation":i,...g,ref:t})})});v.displayName=m;var y="TabsList",D=n.forwardRef((e,t)=>{const{__scopeTabs:r,loop:n=!0,...a}=e,s=b(y,r),o=x(r);return(0,p.jsx)(i.bL,{asChild:!0,...o,orientation:s.orientation,dir:s.dir,loop:n,children:(0,p.jsx)(l.sG.div,{role:"tablist","aria-orientation":s.orientation,...a,ref:t})})});D.displayName=y;var j="TabsTrigger",C=n.forwardRef((e,t)=>{const{__scopeTabs:r,value:n,disabled:s=!1,...o}=e,u=b(j,r),c=x(r),d=A(u.baseId,n),m=E(u.baseId,n),f=n===u.value;return(0,p.jsx)(i.q7,{asChild:!0,...c,focusable:!s,active:f,children:(0,p.jsx)(l.sG.button,{type:"button",role:"tab","aria-selected":f,"aria-controls":m,"data-state":f?"active":"inactive","data-disabled":s?"":void 0,disabled:s,id:d,...o,ref:t,onMouseDown:(0,a.mK)(e.onMouseDown,e=>{s||0!==e.button||!1!==e.ctrlKey?e.preventDefault():u.onValueChange(n)}),onKeyDown:(0,a.mK)(e.onKeyDown,e=>{[" ","Enter"].includes(e.key)&&u.onValueChange(n)}),onFocus:(0,a.mK)(e.onFocus,()=>{const e="manual"!==u.activationMode;f||s||!e||u.onValueChange(n)})})})});C.displayName=j;var N="TabsContent",w=n.forwardRef((e,t)=>{const{__scopeTabs:r,value:a,forceMount:s,children:i,...u}=e,c=b(N,r),d=A(c.baseId,a),m=E(c.baseId,a),f=a===c.value,g=n.useRef(f);return n.useEffect(()=>{const e=requestAnimationFrame(()=>g.current=!1);return()=>cancelAnimationFrame(e)},[]),(0,p.jsx)(o.C,{present:s||f,children:({present:r})=>(0,p.jsx)(l.sG.div,{"data-state":f?"active":"inactive","data-orientation":c.orientation,role:"tabpanel","aria-labelledby":d,hidden:!r,id:m,tabIndex:0,...u,ref:t,style:{...e.style,animationDuration:g.current?"0s":void 0},children:r&&i})})});function A(e,t){return`${e}-trigger-${t}`}function E(e,t){return`${e}-content-${t}`}w.displayName=N;var F=v,S=D,T=C,_=w},45274:(e,t,r)=>{r.r(t),r.d(t,{default:()=>pa});var n=r(80296),a=r(96540),s=r(60312),i=r(46110),o=r(98445),l=r(24180),u=r(61409),c=r(89820),d=r(36397),p=r(17985),m=r(4852),f=r(5556),g=r.n(f),x=r(74967),h=r(74848),b=function(e){var t=e.title,r=e.tag,n=e.description,a=e.updatedDate,s=e.campaignsCount,i=e.status,o=void 0===i?"enabled":i,l=e.updatedLabel,u=void 0===l?"Updated":l,d=e.campaignsLabel,p=void 0===d?"campaigns":d,m=e.enabledLabel,f=void 0===m?"enabled":m,g=e.disabledLabel,b=void 0===g?"disabled":g,v=e.onClick,y=void 0===v?function(){}:v,D="enabled"===o;return(0,h.jsx)(x.Zp,{className:"hover:shadow-lg group bg-white/50 transition-all duration-200 cursor-pointer",onClick:y,style:{borderColor:"#C9BCE5"},children:(0,h.jsxs)(x.Wu,{className:"px-6",children:[(0,h.jsxs)("div",{className:"flex items-center justify-between mb-3",children:[(0,h.jsx)(x.ZB,{className:"text-xl bg-gradient-to-r from-primary to-primary/70 bg-clip-text text-[rgba(61,93,152,1)] font-semibold font-[Montserrat]",children:t}),(0,h.jsx)("div",{className:"inline-flex items-center px-2 py-1 text-xs font-medium capitalize rounded",style:{backgroundColor:"#E1E7F3",color:"#2E477A"},children:r})]}),(0,h.jsx)(x.BT,{className:"mb-4",children:n}),(0,h.jsxs)("div",{className:"text-muted-foreground flex items-center justify-between text-sm",children:[(0,h.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,h.jsxs)("span",{className:"font-bold",children:[u," ",a]}),(0,h.jsx)("span",{children:"â¢"}),(0,h.jsxs)("span",{className:"font-bold",children:[s," ",p]})]}),(0,h.jsx)(c.E,{variant:D?"default":"secondary",className:"text-xs",style:{backgroundColor:D?"#E7E1F3":"#BDC0C7",color:D?"#593C99":"#545964"},children:D?f:b})]})]})})};b.propTypes={title:g().string.isRequired,tag:g().string.isRequired,description:g().str
2ing.isRequired,updatedDate:g().string.isRequired,campaignsCount:g().number.isRequired,status:g().oneOf(["enabled","disabled"]),updatedLabel:g().string,campaignsLabel:g().string,enabledLabel:g().string,disabledLabel:g().string,onClick:g().func};const v=b;var y=r(10467),D=r(90232),j=r(32307),C=r(80964),N=r(9407);const w=(0,N.A)("chart-column-decreasing",[["path",{d:"M13 17V9",key:"1fwyjl"}],["path",{d:"M18 17v-3",key:"1sqioe"}],["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M8 17V5",key:"1wzmnc"}]]);var A=r(80333),E=r(51881),F=r(45458),S=r(82284),T=r(64467),_=r(36256);function O(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,a,s){var l=n&&n.prototype instanceof o?n:o,u=Object.create(l.prototype);return R(u,"_invoke",function(r,n,a){var s,o,l,u=0,c=a||[],d=!1,p={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,r){return s=t,o=0,l=e,p.n=r,i}};function m(r,n){for(o=r,l=n,t=0;!d&&u&&!a&&t<c.length;t++){var a,s=c[t],m=p.p,f=s[2];r>3?(a=f===n)&&(l=s[(o=s[4])?5:(o=3,3)],s[4]=s[5]=e):s[0]<=m&&((a=r<2&&m<s[1])?(o=0,p.v=n,p.n=s[1]):m<f&&(a=r<3||s[0]>n||n>f)&&(s[4]=r,s[5]=n,p.n=f,o=0))}if(a||r>1)return i;throw d=!0,n}return function(a,c,f){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&m(c,f),o=c,l=f;(t=o<2?e:l)||!d;){s||(o?o<3?(o>1&&(p.n=-1),m(o,l)):p.n=l:p.v=l);try{if(u=2,s){if(o||(a="next"),t=s[a]){if(!(t=t.call(s,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,o<2&&(o=0)}else 1===o&&(t=s.return)&&t.call(s),o<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),o=1);s=e}else if((t=(d=p.n<0)?l:r.call(n,p))!==i)break}catch(t){s=e,o=1,l=t}finally{u=1}}return{value:t,done:d}}}(r,a,s),!0),u}var i={};function o(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(R(t={},n,function(){return this}),t),d=u.prototype=o.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,R(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,R(d,"constructor",u),R(u,"constructor",l),l.displayName="GeneratorFunction",R(u,a,"GeneratorFunction"),R(d),R(d,a,"Generator"),R(d,n,function(){return this}),R(d,"toString",function(){return"[object Generator]"}),(O=function(){return{w:s,m:p}})()}function R(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}R=function(e,t,r,n){function s(t,r){R(e,t,function(e){return this._invoke(t,r,e)})}t?a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(s("next",0),s("throw",1),s("return",2))},R(e,t,r,n)}function k(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function B(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?k(Object(r),!0).forEach(function(t){(0,T.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):k(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var P=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return _.nC.get("/lara/agent_modules",{params:e})},q=function(e){return _.nC.get("/lara/agent_modules/".concat(e))},L=function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return _.nC.get("/lara/escalation_rule_templates",{params:e})},M=function(e){var t=B({},e);if(Object.prototype.hasOwnProperty.call(t,"template")){var r=t.template;"object"===(0,S.A)(r)&&r&&"string"==typeof r.id&&(t.template=r.id)}if(Object.prototype.hasOwnProperty.call(t,"module_ids")){var n=t.module_ids;Array.isArray(n)?t.module_ids=n.map(function(e){return"object"===(0,S.A)(e)&&e&&"string"==typeof e.id?e.id:e}).filter(function(e){return"string"==typeof e}):"string"==typeof n?t.module_ids=[n]:delete t.module_ids}return _.nC.post("/lara/escalation_rules",t)},I=function(e,t){var r={};if(Object.prototype.hasOwnProperty.call(t,"template")){var n=t.template;"string"==typeof n?r.template=n:n&&"object"===(0,S.A)(n)&&"string"==typeof n.id&&(r.template=n.id)}if("string"==typeof t.description&&(r.description=t.description),"number"==typeof t.priority&&(r.priority=t.priority),"string"==typeof t.channel&&(r.channel=t.channel),Object.prototype.hasOwnProperty.call(t,"module_ids")){var a=t.module_ids;Array.isArray(a)?r.module_ids=a.map(function(e){return"object"===(0,S.A)(e)&&e&&"string"==typeof e.id?e.id:e}).filter(function(e){return"string"==typeof e}):"string"==typeof a&&(r.module_ids=[a])}return _.nC.put("/lara/escalation_rules/".concat(e),r)},G=function(e){return _.nC.delete("/lara/escalation_rules/".concat(e))},U=function(e,t){return _.nC.put("/lara/agent_modules/".concat(e),{call_summary_prompt:t})},z=function(e){return _.nC.get("/lara/agent_calls",{params:e})},V=function(){var e=(0,y.A)(O().m(function e(t){var r,n,a,s,i,o;return O().w(function(e){for(;;)switch(e.n){case 0:r=[],n=0,a=!0,s=function(){var e=(0,y.A)(O().m(function e(r){var n,a;return O().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,z(B(B({},t),{},{page:r,page_size:50}));case 1:return n=e.v,a=n.data,e.a(2,a)}},e)}));return function(t){return e.apply(this,arguments)}}(),i=1;case 1:if(!(a&&i<=200)){e.n=3;break}return e.n=2,s(i);case 2:null!=(o=e.v)&&o.results?(r.push.apply(r,(0,F.A)(o.results)),n=o.count||0,a=r.length<n,i+=1):a=!1,e.n=1;break;case 3:return e.a(2,{results:r,totalCount:n,isTruncated:i>200&&r.length<n})}},e)}));return function(t){return e.apply(this,arguments)}}(),Y=function(){return _.nC.get("/lara/configuration_changelog/recent")},H=function(e,t){return _.nC.post("/lara/agent_modules/".concat(e,"/set_primary_phone"),{phone_id:t})},Q=function(e){return _.nC.get("/lara/triggers",{params:{module:e}})},W=function(e){return _.nC.post("/lara/triggers",e)},$=function(e,t){return _.nC.patch("/lara/triggers/".concat(e),t)},K=function(e){return _.nC.delete("/lara/triggers/".concat(e))},X=function(e){return _.nC.get("/lara/trigger_executions",{params:e})},Z=function(e){return _.nC.get("/lara/modules/".concat(e,"/data-fields"))},J=function(e,t){return _.nC.post("/lara/modules/".concat(e,"/data-fields"),t)},ee=function(e,t){return _.nC.patch("/lara/data-fields/".concat(e),t)},te=function(e){return _.nC.delete("/lara/data-fields/".concat(e))},re=function(e,t){return _.nC.post("/lara/modules/".concat(e,"/data-fields/reorder"),{field_ids:t})},ne=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return _.nC.get("/lara/modules/".concat(e,"/data-submissions"),{params:t})},ae=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};return _.nC.get("/lara/modules/".concat(e,"/data-submissions/stats"),{params:t})},se=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};
2return _.nC.get("/lara/modules/".concat(e,"/data-submissions/export"),{params:t,responseType:"blob"})};function ie(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,a,s){var l=n&&n.prototype instanceof o?n:o,u=Object.create(l.prototype);return oe(u,"_invoke",function(r,n,a){var s,o,l,u=0,c=a||[],d=!1,p={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,r){return s=t,o=0,l=e,p.n=r,i}};function m(r,n){for(o=r,l=n,t=0;!d&&u&&!a&&t<c.length;t++){var a,s=c[t],m=p.p,f=s[2];r>3?(a=f===n)&&(l=s[(o=s[4])?5:(o=3,3)],s[4]=s[5]=e):s[0]<=m&&((a=r<2&&m<s[1])?(o=0,p.v=n,p.n=s[1]):m<f&&(a=r<3||s[0]>n||n>f)&&(s[4]=r,s[5]=n,p.n=f,o=0))}if(a||r>1)return i;throw d=!0,n}return function(a,c,f){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&m(c,f),o=c,l=f;(t=o<2?e:l)||!d;){s||(o?o<3?(o>1&&(p.n=-1),m(o,l)):p.n=l:p.v=l);try{if(u=2,s){if(o||(a="next"),t=s[a]){if(!(t=t.call(s,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,o<2&&(o=0)}else 1===o&&(t=s.return)&&t.call(s),o<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),o=1);s=e}else if((t=(d=p.n<0)?l:r.call(n,p))!==i)break}catch(t){s=e,o=1,l=t}finally{u=1}}return{value:t,done:d}}}(r,a,s),!0),u}var i={};function o(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(oe(t={},n,function(){return this}),t),d=u.prototype=o.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,oe(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,oe(d,"constructor",u),oe(u,"constructor",l),l.displayName="GeneratorFunction",oe(u,a,"GeneratorFunction"),oe(d),oe(d,a,"Generator"),oe(d,n,function(){return this}),oe(d,"toString",function(){return"[object Generator]"}),(ie=function(){return{w:s,m:p}})()}function oe(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}oe=function(e,t,r,n){function s(t,r){oe(e,t,function(e){return this._invoke(t,r,e)})}t?a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(s("next",0),s("throw",1),s("return",2))},oe(e,t,r,n)}const le={es_ES:{moduleSettings:"Configuración de Módulos",yourModules:"Tus Módulos",yourModulesDescription:"Gestiona tus módulos de empleados digitales reclamados. Cada módulo es un agente de IA especializado para tareas especÃficas.",searchPlaceholder:"Busca tus módulos...",allStatus:"Todos los Estados",enabled:"Habilitado",disabled:"Deshabilitado",claimed:"Reclamados",active:"Activos",claimedModulesTooltip:"Los módulos reclamados aún no están disponibles.",updated:"Actualizado",campaigns:"campañas",campaign:"campaña",scheduling:"Programación",supp
2ort:"Soporte",outreach:"Alcance",wellness:"Bienestar",dentalRecallDescription:"Recordatorios automáticos de citas dentales y reprogramación",claimSupportDescription:"Asistencia con reclamos de seguros y actualizaciones de estado",outreachTaskDescription:"Alcance general y finalización de tareas",wellnessCheckDescription:{"*":"Monitoreo proactivo de bienestar y salud del paciente",health_insurance:"Monitoreo proactivo de bienestar y salud del afiliado"},noModulesFound:"No se encontraron módulos que coincidan con tus criterios.",errorLoadingModules:"Error al cargar los módulos. Por favor, inténtalo de nuevo.",dentalRecallAgent:"Agente de Recordatorio Dental",claimSupportAgent:"Agente de Soporte de Reclamos",outreachTaskAgent:"Agente de Tareas de Alcance",wellnessCheckAgent:"Agente de Control de Bienestar",backToModuleSettings:"Volver a Configuración de Módulos",assignedCallerId:"ID de Llamada Asignado",moduleOverview:"Resumen del Módulo",category:"CategorÃa",lastUpdated:"Ãltima Actualización",campaignsUsed:"Campañas Utilizadas",recentConfigurationChanges:"Cambios de Configuración Recientes",latestUpdatesAndModifications:"Ãltimas actualizaciones y modificaciones a este módulo",viewAllChanges:"Ver Todos los Cambios",errorLoadingModule:"Error al cargar el módulo. Por favor, inténtalo de nuevo.",overview:"Resumen",automations:"Automatizaciones",callLogAndSuccess:"Registro de Llamadas y Ãxito",escalationRules:"Reglas de Escalación",testing:"Pruebas",schedulingRulesContent:"Configuración de reglas de programación próximamente...",callLogContent:"Configuración de registro de llamadas y métricas de éxito próximamente...",escalationRulesContent:"Configuración de reglas de escalación próximamente...",testingContent:"Herramientas de prueba del módulo próximamente...",callLogPromptTitle:"Prompt de Registro de Llamadas",callLogPromptDescription:"Este prompt guiará a la IA para resumir las conversaciones telefónicas de manera consistente.",successCriteriaTitle:"Criterios de Ãxito",successCriteriaDescription:"Estos criterios se aplican automáticamente para analizar las transcripciones de llamadas y determinar los resultados exitosos.",escalationRulesTitle:"Reglas de Escalación",escalationRulesDescription:"Configure cuándo y cómo crear tareas después de las llamadas de alcance. Las reglas se activan según las transcripciones y resultados de las llamadas.",addEscalationRule:"Agregar Regla de Escalación",newEscalationRule:"Nueva Regla de Escalación",priorityLow:"Bajo",priorityMedium:"Medio",priorityHigh:"Alto",channelTask:"Tarea",channelEmail:"Correo",channelNotification:"Notificación",escalationTemplate:"Plantilla de Escalación",templateLabel:"Plantilla",channelLabel:"Canal",priorityLabel:"Prioridad",taskDescriptionLabel:"Descripción de Tarea",taskDescriptionPlaceholder:"Ingrese descripción de tarea",deleteAction:"Eliminar",saveAction:"Guardar",editAction:"Editar",loadingEscalationRules:"Cargando reglas de escalación...",noEscalationRulesConfigured:"Aún no hay reglas de escalación configuradas.",noTemplatesAvailable:"No hay plantillas disponibles. Por favor contacte a su administrador.",clickToCreateFirstRule:'Haga clic en "Agregar Regla de Escalación" para crear su primera regla.',failedToLoadTemplates:"Error al cargar plantillas de escalación",unnamedTemplate:"Plantilla Sin Nombre",descriptionRequired:"La descripción de la tarea es requerida",errorSavingRule:"Error al guardar la regla de escalación",errorDeletingRule:"Error al eliminar la regla de escalación",templateAlreadyInModule:"Esta plantilla ya está siendo usada en este módulo",activity:"Actividad",filterByDate:"Filtrar por fecha",filterByCampaign:"Filtrar por c
2ampaña",searchPatients:{"*":"Buscar pacientes",health_insurance:"Buscar afiliados"},allTime:"Todo el Tiempo",today:"Hoy",yesterday:"Ayer",last7Days:"Ãltimos 7 DÃas",last30Days:"Ãltimos 30 DÃas",customRange:"Rango Personalizado",startDate:"Fecha de Inicio",endDate:"Fecha Final",createCampaign:"Crear Campaña",patientName:{"*":"Nombre del Paciente",health_insurance:"Nombre del Afiliado"},callDateTime:"Fecha y Hora de Llamada",duration:"Duración",allCampaigns:"Todas las Campañas",loadingCalls:"Cargando llamadas...",errorLoadingCalls:"Error al cargar las llamadas",errorGeneral:"Error",tryAgain:"Intentar de Nuevo",updating:"Actualizando...",showingXToY:"Mostrando",toX:"a",ofX:"de",entries:"entradas",rowsPerPage:"Filas por página",page:"Página",of:"de",noCallsFound:"No se encontraron llamadas para el rango de fechas seleccionado.",noPatientsFound:{"*":"No se encontraron pacientes que coincidan con",health_insurance:"No se encontraron afiliados que coincidan con"},unknownPatient:{"*":"Paciente Desconocido",health_insurance:"Afiliado Desconocido"},noPhone:"Sin teléfono",campaignLabel:"Campaña",exportCsv:"Exportar a CSV",exportSuccess:"Exportación exitosa",exporting:"Exportando...",analytics:"AnalÃticas",settings:"Configuración",selectAnalyticsTab:"Selecciona la pestaña de análisis para cargar el panel...",errorLoadingAnalytics:"Error al cargar el panel de análisis",retry:"Reintentar",noDate:"Sin fecha",exportFailed:"Exportación fallida. Por favor, inténtalo de nuevo.",exportError:"Error al obtener los datos. Por favor, inténtalo de nuevo.",noDataToExport:"No hay datos para exportar",exportTruncatedWarning:"El CSV incluye solo [exported] de [total] llamadas por un lÃmite del sistema. Contacta a soporte si necesitas el reporte completo.",phoneNumber:"Número de Teléfono",callStatus:"Estado de Llamada",notes:"Notas",noDuration:"Sin duración",recording:"Grabación",noRecording:"Sin grabación",listenRecording:"Escuchar grabación",unknown:"Desconocido",notAvailable:"N/D",callStatusInProgress:"En progreso",callStatusTransferred:"Transferida",callStatusTransferredByLara:"Transferida por Lara",callStatusNoAnswer:"No contestada",callStatusUserHangup:"Llamante colgó",callStatusNoRecording:"Sin grabación",callStatusCompletedByLara:"Completada por Lara",callStatusLabel:"Estado",recordingInProgress:"En progreso...",exportStatusInProgress:"En progreso",exportStatusCompleted:"Atendida por Lara",exportStatusTransferred:"Transferida",exportStatusTransferredByLara:"Transferida por Lara",exportStatusNoAnswer:"No contestada",exportStatusUserHangup:"Colgó el paciente",exportStatusNoRecording:"Atendida por Lara",exportDurationInProgress:"En progreso",exportNotasLabel:"Notas",exportTotalCost:"Costo Total",exportCostLabel:"Costo",exportLaraDuration:"Duración Lara",exportTransferDuration:"Duración Transferencia",exportLoadingAllData:"Exportando todos los datos...",moduleCreated:"Módulo de agente creado",moduleUpdated:"Configuración de módulo de agente actualizada",moduleEnabled:"Módulo de agente habilitado",moduleDisabled:"Módulo de agente deshabilitado",successCriteriaUpdated:"Criterios de éxito actualizados",callSummaryPromptUpdated:"Plantilla de resumen de llamada actualizada",escalationRuleCreated:"Regla de escalamiento creada",escalationRuleUpdated:"Regla de escalamiento actualizada",flowConfigurationSaved:"Configuración de flujo guardada",escalationRuleAdded:"Regla de escalamiento añadida",escalationRuleModified:"Regla de escalamiento modificada",escalationRuleDeleted:"Regla de escalamiento eliminada",campaignCreated:"Campaña creada",campaignStarted:"Campaña iniciada",campaignPaused:"Campaña pausada",campaignCompleted:"Campaña completada",campaignScheduled:"Campaña programada",campaignTcpaPaused:"Campaña pausada (cumplimiento TCPA)",campaignTcpaResumed:"Campaña reanudada (cumplimiento TCPA)",campaignCreditPaused:"Campaña pausada (créditos insuficientes)",campaignCreditResumed:"Campaña reanudada (créditos repuestos)",errorLoadingRecentChanges:"Error al cargar cambios recientes",failedToFetchRecentChanges:"Error al obtener cambios recientes",configurationChanged:"Configuración modificada",noRecentChangesFound:"No se encontraron cambios de configuración recientes",justNow:"Ahora mismo",minutesAgo:"minutos atrás",minuteAgo:"minuto atrás",hoursAgo:"horas atrás",hourAgo:"hora atrás",daysAgo:"dÃas atrás",dayAgo:"dÃa atrás",automationsTitle:"Automatizaciones",automationsDescription:"Configura disparadores automatizados que envÃan encuestas de satisfacción basadas en eventos de Fila Digital y el Calendario.",addTrigger:"Agregar Disparador",triggerName:"Nombre del Disparador",enterTriggerName:"Ingrese nombre del disparador",event:"Evento",selectEvent:"Seleccionar evento",filaDigitalLabel:"FILA DIGITAL",whenTurnCompleted:"Cuando se completa un turno",whenTurnNoShow:"Cuando un turno se marca como ausencia",timeBeforeSendingSurvey:"Tiempo antes de enviar la encuesta",immediate:"Inmediato",fiveMinutes:"5 minutos",thirtyMinutes:"30 minutos",oneHour:"1 hora",fourHours:"4 horas",twentyFourHours:"24 horas",selectDelay:"Seleccionar tiempo",action:"Acción",sendSatisfactionSurveyCall:"Enviar Encuesta de Satisfacción (Llamada
2)",noAutomationsYet:"Aún no hay automatizaciones",createRulesDescription:"Crea reglas que envÃen automáticamente encuestas después de ciertos eventos.",deleteTrigger:"Eliminar disparador",enableTrigger:"Habilitar disparador",disableTrigger:"Deshabilitar disparador",eventMustBeSelected:"Se debe seleccionar un evento",timeMustBeGreater:"El tiempo debe ser mayor que 0 o seleccionar Inmediato",completeAllRequiredFields:"Completa todos los campos obligatorios para guardar",confirmDeleteTrigger:"¿Estás seguro de que quieres eliminar este disparador?",deleteTriggerModalTitle:"Eliminar Disparador?",deleteTriggerModalMessage:"Esta regla de automatización será eliminada permanentemente.",cancel:"Cancelar",delete:"Eliminar",save:"Guardar",errorLoadingTriggers:"Error al cargar los disparadores",triggerCreated:"Disparador creado exitosamente",triggerUpdated:"Disparador actualizado exitosamente",errorSavingTrigger:"Error al guardar el disparador",triggerDeleted:"Disparador eliminado exitosamente",errorDeletingTrigger:"Error al eliminar el disparador",duplicateTriggerError:"Ya existe un disparador para este evento. Cada módulo solo puede tener un disparador de cada tipo.",executionHistory:"Historial de Ejecución",refresh:"Actualizar",filters:"Filtros",allStatuses:"Todos los Estados",statusScheduled:"Programado",statusExecuted:"Ejecutado",statusFailed:"Fallido",statusCancelled:"Cancelado",from:"Desde",to:"Hasta",clearFilters:"Limpiar Filtros",contact:"Contacto",status:"Estado",scheduledAt:"Programado Para",actions:"Acciones",triggerType:"Tipo de Disparador",delayMinutes:"Minutos de Retraso",errorMessage:"Mensaje de Error",executedAt:"Ejecutado En",unknownContact:"Contacto Desconocido",noExecutionsFound:"No se encontraron ejecuciones",errorLoadingExecutions:"Error al cargar el historial de ejecución",previous:"Anterior",next:"Siguiente",dataTabulationTitle:"Tabulación de Datos",dataTabulationDescription:"Configura campos para extraer de las llamadas",dataTabulation:"Tabulación de Datos",noDataFieldsConfigured:"No Hay Campos de Datos Configurados",emptyStateDescription:"Añade campos de datos para comenzar a extraer información estructurada de las llamadas.",addFirstField:"Añadir Primer Campo",addField:"Añadir Campo",dataFields:"Campos de Datos",order:"Orden",fieldName:"Nombre del Campo",type:"Tipo",req:"Req",newDataField:"Nuevo Campo de Datos",editFieldTitle:"Editar Campo",clickToSaveField:"Clic para guardar campo",completeRequiredFields:"Completa todos los campos requeridos para guardar",error:"Error",fieldNameLabel:"Nombre del Campo",fieldNamePlaceholder:"ej., Nivel de Satisfacción del Paciente",fieldNameRequired:"El nombre del campo es requerido",fieldNameMaxLength:"El nombre del campo debe tener entre 1-100 caracteres",fieldNameInvalidChars:"Solo se permiten letras, números y espacios",fieldNameExists:"El nombre del campo ya existe",fieldQuestionLabel:"Pregunta del Campo",fieldQuestionPlaceholder:"ej., ¿Qué tan satisfecho está con su visita?",fieldQuestionRequired:"La pregunta del campo es requerida",fieldQuestionMaxLength:"La pregunta debe tener entre 1-100 caracteres",characters:"caracteres",fieldTypeLabel:"Tipo de Campo",extractionPromptLabel:"Prompt de Extracción",extractionPromptDescription:"Elige una plantilla para autocompletar el campo de prompt, o empieza desde cero",useDefaultTemplate:"Usar Plantilla Predeterminada",fillPromptWithTemplate:"Llenar prompt con una plantilla de {type}",startFromScratch:"Empezar desde Cero",clearPromptAndWrite:"Limpiar el campo de prompt y escribir el tuyo",promptPlaceholder:"Describe qué información extraer y cómo...",promptRequired:"El prompt de extracción es requerido",promptTooShort:"Prompt muy corto (mÃnimo 10 caracteres)",promptTooLong:"El prompt excede 1000 caracteres",choicesLabel:"Opciones",choicesMinMax:"mÃn 2, máx 20",choice:"Opción",choicePlaceholder1:"ej., Muy Satisfecho",choicePlaceholder2:"ej., Satisfecho",choicePlaceholder3:"ej., Neutral",choicesMinRequired:"Se requieren al menos 2 opciones",choicesMaxAllowed:"Máximo 20 opciones permitidas",choicesDuplicate:"No se permiten valores de opción duplicados",choiceMaxLength:"Cada opción debe tener entre 1-50 caracteres",addChoice:"Añadir opción",requiredLabel:"Requerido",extractFromEveryCall:"Extraer este campo de cada llamada",examplesAndTips:"Ejemplos y Consejos",goodExamples:"Buenos Ejemplos",badExamples:"Malos Ejemplos",tipsFor:"Consejos para {type}",viewFullPromptGuide:"Ver GuÃa Completa de Prompts",loading:"Cargando...",errorLoadingFields:"Error al cargar los campos. Por favor intenta de nuevo.",fieldCreatedSuccess:"Campo creado exitosamente",fieldUpdatedSuccess:"Campo actualizado exitosamente",fieldDeletedSuccess:"Campo eliminado exitosamente",reorderFailedError:"Error al reordenar los campos",fieldTypeBooleanLabel:"Respuesta Sà / No",fieldTypeBooleanDescription:"Usa esto para confirmar si algo sucedió o no.",fieldTypeStringLabel:"Escribir una respuesta",fieldTypeStringDescription:"El sistema guardará lo que la persona dijo en sus propias palabras.",fieldTypeSingleChoiceLabel:"Seleccionar una opción",fieldTypeSingleChoiceDescription:"El sistema elegirá una opción de una lista que definas.",fieldTypeNumberLabel:"Ingresar un Número",fieldTypeNumberDescription:"El sistema guardará un número mencionado durante la llamada.",typeBadgeBoolean:"Booleano",typeBadgeString:"Texto",typeBadgeSingleChoice:"Opción Ãnica",typeBadgeNumber:"Número",booleanGoodExample1:"E
2xtraer satisfacción del paciente de opciones: Muy Satisfecho, Satisfecho, Neutral, Insatisfecho",booleanGoodExample2:"Determinar si se necesita seguimiento. Retornar verdadero si el paciente solicita llamada de vuelta o tiene problemas sin resolver",booleanBadExample1:"Obtener satisfacción (muy vago)",booleanBadExample2:"¿Qué dijeron? (criterio poco claro)",booleanTip1:"Sé especÃfico sobre las condiciones verdadero/falso",booleanTip2:"Define los casos lÃmite claramente",booleanTip3:"Considera escenarios de 'quizás' y cómo manejarlos",stringGoodExample1:"Extraer la razón principal de la visita del paciente en sus propias palabras",stringGoodExample2:"Capturar cualquier queja o preocupación especÃfica mencionada por el paciente",stringBadExample1:"Obtener lo que dijeron (muy amplio)",stringBadExample2:"Extraer texto (no suficientemente especÃfico)",stringTip1:"Especifica qué tipo de texto extraer",stringTip2:"Menciona si quieres citas textuales o resúmenes",stringTip3:"Establece lÃmites para la longitud del texto si es necesario",singleChoiceGoodExample1:"Clasificar satisfacción del paciente como: Muy Satisfecho, Satisfecho, Neutral, Insatisfecho, o Muy Insatisfecho",singleChoiceGoodExample2:"Determinar resultado de cita: Completada, Reprogramada, Cancelada, o Ausencia",singleChoiceBadExample1:"Elegir uno (sin contexto)",singleChoiceBadExample2:"Seleccionar opción (faltan opciones)",singleChoiceTip1:"Lista todas las opciones posibles en el prompt",singleChoiceTip2:"Haz las opciones mutuamente excluyentes",singleChoiceTip3:"Incluye una opción predeterminada/de respaldo si es necesario",singleChoiceTip4:"Mantén las etiquetas de opciones claras y concisas",numberGoodExample1:"Extraer el nivel de dolor del paciente en una escala del 1-10",numberGoodExample2:"Contar cuántas veces el paciente mencionó preocupaciones sobre programación",numberBadExample1:"Obtener un número (sin contexto)",numberBadExample2:"Extraer valor numérico (falta escala)",numberTip1:"Especifica el rango numérico o escala",numberTip2:"Menciona unidades si aplica (%, dólares, etc.)",numberTip3:"Define qué hacer con respuestas no numéricas",promptTemplateBoolean:"Determinar si [condición]. Retornar verdadero si [criterio], falso en caso contrario.",promptTemplateString:"Extraer [qué información] de la conversación. Incluir [detalles especÃficos].",promptTemplateSingleChoice:"Clasificar la respuesta como una de las siguientes: [listar opciones]. Elegir la opción que mejor coincida con la conversación.",promptTemplateNumber:"Extraer [qué valor numérico] en una escala de [mÃn] a [máx]. Retornar solo el número.",responseDataTitle:"Datos de Respuesta de Pacientes",responsesCount:"respuestas",responseLastUpdated:"Ãltima actualización:",responseShowing:"Mostrando",responseOf:"de",responseTotalResponses:"respuestas totales",responseVersion:"Versión",responseFilterByVersion:"Filtrar por Versión",responseClearFilters:"Limpiar Filtros",responseDateRange:"Rango de Fechas",responseColumns:"Columnas",responseShowHideColumns:"Mostrar/Ocultar Columnas",responseSearchPlaceholder:"Buscar respuestas...",responseExportCsv:"Exportar CSV",responsePhoneNumber:"Número de Teléfono",responseCallDate:"Fecha de Llamada",responseNoMatchingFilters:"No hay respuestas que coincidan con tus filtros",responseEmptyState:"Aún no hay respuestas registradas para este módulo",responseYes:"SÃ",responseNo:"No",deleteFieldTitle:"¿Eliminar Campo?",deleteFieldConfirmation:"¿Estás seguro de que quieres eliminar:",warning:"Advertencia",submission:"envÃo",submissions:"envÃos",useThisField:"usan este campo",historicalDataWarning:"Los datos históricos permanecerán intactos, pero este campo NO se extraerá de llamadas futuras.",actionCannotBeUndone:"Esta acción no se puede deshacer.",deleteField:"Eliminar Campo"},en_US:{moduleSettings:"Module Settings",yourModules:"Your Modules",yourModulesDescription:"Manage your claimed digital employee modules. Each module is a specialized AI agent for specific tasks.",searchPlaceholder:"Search your modules...",allStatus:"All Status",enabled:"enabled",disabled:"disabled",claimed:"Claimed",active:"Active",claimedModulesTooltip:"
2Claimed modules are not yet available.",updated:"Updated",campaigns:"campaigns",campaign:"campaign",scheduling:"Scheduling",support:"Support",outreach:"Outreach",wellness:"Wellness",dentalRecallDescription:"Automated dental appointment reminders and rescheduling",claimSupportDescription:"Insurance claim assistance and status updates",outreachTaskDescription:"General outreach and task completion",wellnessCheckDescription:{"*":"Proactive patient wellness and health monitoring",health_insurance:"Proactive affiliate wellness and health monitoring"},noModulesFound:"No modules found matching your criteria.",errorLoadingModules:"Error loading modules. Please try again.",dentalRecallAgent:"Dental Recall Agent",claimSupportAgent:"Claim Support Agent",outreachTaskAgent:"Outreach Task Agent",wellnessCheckAgent:"Wellness Check Agent",backToModuleSettings:"Back to Module Settings",assignedCallerId:"Assigned Caller ID",moduleOverview:"Module Overview",category:"Category",lastUpdated:"Last Updated",campaignsUsed:"Campaigns Used",recentConfigurationChanges:"Recent Configuration Changes",latestUpdatesAndModifications:"Latest updates and modifications to this module",viewAllChanges:"View All Changes",errorLoadingModule:"Error loading module. Please try again.",overview:"Overview",automations:"Automations",callLogAndSuccess:"Call Log & Success",escalationRules:"Escalation Rules",testing:"Testing",schedulingRulesContent:"Scheduling rules configuration coming soon...",callLogContent:"Call log and success metrics configuration coming soon...",escalationRulesContent:"Escalation rules configuration coming soon...",testingContent:"Module testing tools coming soon...",callLogPromptTitle:"Call Log Prompt",callLogPromptDescription:"This prompt will guide the AI in summarizing call conversations consistently.",successCriteriaTitle:"Success Criteria",successCriteriaDescription:"These criteria are automatically applied to analyze call transcripts and determine success outcomes.",escalationRulesTitle:"Escalation Rules",escalationRulesDescription:"Configure when and how to create tasks after outreach calls. Rules are triggered based on call transcripts and outcomes.",addEscalationRule:"Add Escalation Rule",newEscalationRule:"New Escalation Rule",priorityLow:"Low",priorityMedium:"Medium",priorityHigh:"High",channelTask:"Task",channelEmail:"Email",channelNotification:"Notification",escalationTemplate:"Escalation Template",templateLabel:"Template",channelLabel:"Channel",priorityLabel:"Priority",taskDescriptionLabel:"Task Description",taskDescriptionPlaceholder:"Enter task description",deleteAction:"Delete",saveAction:"Save",editAction:"Edit",loadingEscalationRules:"Loading escalation rules...",noEscalationRulesConfigured:"No escalation rules configured yet.",noTemplatesAvailable:"No templates available. Please contact your administrator.",clickToCreateFirstRule:'Click "Add Escalation Rule" to create your first rule.',failedToLoadTemplates:"Failed to load escalation templates",unnamedTemplate:"Unnamed Template",descriptionRequired:"Task description is required",errorSavingRule:"Error saving escalation rule",errorDeletingRule:"Error deleting escalation rule",templateAlreadyInModule:"This template is already used in this module",activity:"Activity",filterByDate:"Filter by date",filterByCampaign:"Filter by campaign",searchPatients:{"*":"Search patients",health_insurance:"Search affiliates"},allTime:"All Time",today:"Today",yesterday:"Yesterday",last7Days:"Last 7 Days",last30Days:"Last 30 Days",customRange:"Custom Range",startDate:"Start Date",endDate:"End Date",createCampaign:"Create Campaign",patientName:{"*":"Patient Name",health_insurance:"Affiliate Name"},callDateTime:"Call Date & Time",duration:"Duration",allCampaigns:"All Campaigns",loadingCalls:"Loading calls...",errorLoadingCalls:"Error loading calls",errorGeneral:"Error",tryAgain:"Try Again",updating:"Updating...",showingXToY:"Showing",toX:"to",ofX:"of",entries:"entries",rowsPerPage:"Rows per page",page:"Page",of:"of",noCallsFound:"No calls found for the selected date range.",noPatientsFound:{"*":"No patients found matching",health_insurance:"No affiliates found matching"},unknownPatient:{"*":"Unknown Patient",health_insurance:"Unknown Affiliate"},noPhone:"No phone",campaignLabel:"Campaign",exportCsv:"Export to CSV",exportSuccess:"Export successful",exporting:"Exporting...",analytics:"Analytics",settings:"Settings",selectAnalyticsTab:"Select analytics tab to load dashboard...",errorLoadingAnalytics:"Error loading analytics dashboard",retry:"Retry",noDate:"No date",exportFailed:"Export failed. Please try again.",exportError:"Failed to export data. Please try again.",noDataToExport:"No data to export",exportTruncatedWarning:"The CSV includes only [exported] of [total] calls due to a system limit. Contact support if you need the complete report.",phoneNumber:"Phone Number",callStatus:"Call Status",notes:"Notes",noDuration:"No duration",recording:"Recording",noRecording:"No recording",listenRecording:"Listen to recording",unknown:"Unknown",notAvailable:"N/A",callStatusInProgress:"In progress",callStatusTransferred:"Transferred",callStatusTransferredByLara:"Transferred by Lara",callStatusNoAnswer:"No answer",callStatusUserHangup:"Caller hung up",callStatusNoRecording:"No recording",callStatusCompletedByLara:"Completed by Lara",callStatusLabel:"Status",recordingInProgress:"In progress...",exportStatusInProgress:"In progress",exportStatusCompleted:"Answered by Lara",exportStatusTransferred:"Transferred",exportStatusTransferredByLara:"Transferred by Lara",exportStatusNoAnswer:"No answer",exportStatusUserHangup:"Patient hung up",exportStatusNoRecording:"Answered by Lara",exportDurationInProgress:"In progress",exportNotasLabel:"Notes",exportTotalCost:"Total Cost",exportCostLabel:"Cost",exportLaraDuration:"Lara Duration",exportTransferDuration:"Transfer Duration",exportLoadingAllData:"Exporting all data...",moduleCreated:"Agent module created",moduleUpdated:"Agent module configuration updated",moduleEnabled:"Agent module enabled",moduleDisabled:"Agent module disabled",successCriteriaUpdated:"Success criteria updated",callSummaryPromptUpdated:"Call summary prompt updated",escalationRuleCreated:"Escalation rule created",escalationRuleUpdated:"Escalation rule updated",flowConfigurationSaved:"Flow configuration saved",escalationRuleAdded:"Escalation rule added",escalationRuleModified:"Escalation rule modified",escalationRuleDeleted:"Escalation rule deleted",campaignCreated:"Campaign created",campaignStarted:"Campaign started",campaignPaused:"Campaign paused",campaignCompleted:"Campaign completed",campaignScheduled:"Campaign scheduled",campaignTcpaPaused:"Campaign paused (TCPA compliance)",campaignTcpaResumed:"Campaign resumed (TCPA compliance)",campaignCreditPaused:"Campaign paused (insufficient credits)",campaignCreditResumed:"Campaign resumed (credits replenished)",errorLoadingRecentChanges:"Error loading recent changes",failedToFetchRecentChanges:"Failed to fetch recent changes",configurationChanged:"Configuration changed",noRecentChangesFound:"No recent configuration changes found",justNow:"Just now",minutesAgo:"minutes ago",minuteAgo:"minute ago",hoursAgo:"hours ago",hourAgo:"hour ago",daysAgo:"days ago",dayAgo:"day ago",automationsTitle:"Automations",automationsDescription:"Configure automated triggers that send satisfaction surveys based on events from Fila Digital and the Calendar.",addTrigger:"Add Trigger",triggerName:"Trigger Name",enterTriggerName:"Enter trigger name",event:"Event",selectEvent:"Select event",filaDigitalLabel:"FILA DIGITAL",whenTurnCompleted:"When a turn is completed",whenTurnNoShow:"When a turn is marked as
2no-show",timeBeforeSendingSurvey:"Time before sending survey",immediate:"Immediate",fiveMinutes:"5 minutes",thirtyMinutes:"30 minutes",oneHour:"1 hour",fourHours:"4 hours",twentyFourHours:"24 hours",selectDelay:"Select delay",action:"Action",sendSatisfactionSurveyCall:"Send Satisfaction Survey (Call)",noAutomationsYet:"No automations yet",createRulesDescription:"Create rules that automatically send surveys after certain events.",deleteTrigger:"Delete trigger",enableTrigger:"Enable trigger",disableTrigger:"Disable trigger",eventMustBeSelected:"Event must be selected",timeMustBeGreater:"Time must be greater than 0 or select Immediate",completeAllRequiredFields:"Complete all required fields to save",confirmDeleteTrigger:"Are you sure you want to delete this trigger?",deleteTriggerModalTitle:"Delete Trigger?",deleteTriggerModalMessage:"This automation rule will be permanently removed.",cancel:"Cancel",delete:"Delete",save:"Save",errorLoadingTriggers:"Error loading triggers",triggerCreated:"Trigger created successfully",triggerUpdated:"Trigger updated successfully",errorSavingTrigger:"Error saving trigger",triggerDeleted:"Trigger deleted successfully",errorDeletingTrigger:"Error deleting trigger",duplicateTriggerError:"A trigger for this event already exists. Each module can only have one trigger of each type.",executionHistory:"Execution History",refresh:"Refresh",filters:"Filters",allStatuses:"All Statuses",statusScheduled:"Scheduled",statusExecuted:"Executed",
2statusFailed:"Failed",statusCancelled:"Cancelled",from:"From",to:"To",clearFilters:"Clear Filters",contact:"Contact",status:"Status",scheduledAt:"Scheduled At",actions:"Actions",triggerType:"Trigger Type",delayMinutes:"Delay Minutes",errorMessage:"Error Message",executedAt:"Executed At",unknownContact:"Unknown Contact",noExecutionsFound:"No executions found",errorLoadingExecutions:"Error loading execution history",previous:"Previous",next:"Next",dataTabulationTitle:"Data Tabulation",dataTabulationDescription:"Configure fields to extract from calls",dataTabulation:"Data Tabulation",noDataFieldsConfigured:"No Data Fields Configured",emptyStateDescription:"Add data fields to start extracting structured information from calls.",addFirstField:"Add First Field",addField:"Add Field",dataFields:"Data Fields",order:"Order",fieldName:"Field Name",type:"Type",req:"Req",newDataField:"New Data Field",editFieldTitle:"Edit Field",clickToSaveField:"Click to save field",completeRequiredFields:"Complete all required fields to save",error:"Error",fieldNameLabel:"Field Name",fieldNamePlaceholder:"e.g., Patient Satisfaction Level",fieldNameRequired:"Field name is required",fieldNameMaxLength:"Field name must be 1-100 characters",fieldNameInvalidChars:"Only letters, numbers, and spaces allowed",fieldNameExists:"Field name already exists",fieldQuestionLabel:"Field Question",fieldQuestionPlaceholder:"e.g., How satisfied are you with your visit?",fieldQuestionRequired:"Field question is required",fieldQuestionMaxLength:"Question must be 1-100 characters",characters:"characters",fieldTypeLabel:"Field Type",extractionPromptLabel:"Extraction Prompt",extractionPromptDescription:"Choose a template to auto-fill the prompt field, or start from scratch",useDefaultTemplate:"Use Default Template",fillPromptWithTemplate:"Fill prompt with a {type} template",startFromScratch:"Start From Scratch",clearPromptAndWrite:"Clear the prompt field and write your own",promptPlaceholder:"Describe what information to extract and how...",promptRequired:"Extraction prompt is required",promptTooShort:"Prompt too short (minimum 10 characters)",promptTooLong:"Prompt exceeds 1000 characters",choicesLabel:"Choices",choicesMinMax:"min 2, max 20",choice:"Choice",choicePlaceholder1:"e.g., Very Satisfied",choicePlaceholder2:"e.g., Satisfied",choicePlaceholder3:"e.g., Neutral",choicesMinRequired:"At least 2 choices required",choicesMaxAllowed:"Maximum 20 choices allowed",choicesDuplicate:"Duplicate choice values not allowed",choiceMaxLength:"Each choice must be 1-50 characters",addChoice:"Add choice",requiredLabel:"Required",extractFromEveryCall:"Extract this field from every call",examplesAndTips:"Examples & Tips",goodExamples:"Good Examples",badExamples:"Bad Examples",tipsFor:"Tips for {type}",viewFullPromptGuide:"View Full Prompt Guide",loading:"Loading...",errorLoadingFields:"Error loading fields. Please try again.",fieldCreatedSuccess:"Field created successfully",fieldUpdatedSuccess:"Field updated successfully",fieldDeletedSuccess:"Field deleted successfully",reorderFailedError:"Failed to reorder fields",fieldTypeBooleanLabel:"Yes / No Answer",fieldTypeBooleanDescription:"Use this to confirm if something happened or not.",fieldTypeStringLabel:"Write an answer",fieldTypeStringDescription:"The system will save what the person said in their own words.",fieldTypeSingleChoiceLabel:"Select one option",fieldTypeSingleChoiceDescription:"The system will choose one option from a list you define.",fieldTypeNumberLabel:"Enter a Number",fieldTypeNumberDescription:"The system will save a number mentioned during the call.",typeBadgeBoolean:"Boolean",typeBadgeString:"String",typeBadgeSingleChoice:"Single Choice",typeBadgeNumber:"Number",booleanGoodExample1:"Extract patient satisfaction from options: Very Satisfied, Satisfied, Neutral, Dissatisfied",booleanGoodExample2:"Determine if follow-up is needed. Return true if patient requests callback or has unresolved issues",booleanBadExample1:"Get satisfaction (too vague)",booleanBadExample2:"What did they say? (unclear criteria)",booleanTip1:"Be specific about true/false conditions",booleanTip2:"Define edge cases clearly",booleanTip3:"C
2onsider 'maybe' scenarios and how to handle them",stringGoodExample1:"Extract the main reason for the patient's visit in their own words",stringGoodExample2:"Capture any specific complaints or concerns mentioned by the patient",stringBadExample1:"Get what they said (too broad)",stringBadExample2:"Extract text (not specific enough)",stringTip1:"Specify what type of text to extract",stringTip2:"Mention if you want verbatim quotes or summaries",stringTip3:"Set boundaries for text length if needed",singleChoiceGoodExample1:"Classify patient satisfaction as: Very Satisfied, Satisfied, Neutral, Dissatisfied, or Very Dissatisfied",singleChoiceGoodExample2:"Determine appointment outcome: Completed, Rescheduled, Cancelled, or No-Show",singleChoiceBadExample1:"Pick one (no context)",singleChoiceBadExample2:"Choose option (missing choices)",singleChoiceTip1:"List all possible choices in the prompt",singleChoiceTip2:"Make choices mutually exclusive",singleChoiceTip3:"Include a default/fallback option if needed",singleChoiceTip4:"Keep choice labels clear and concise",numberGoodExample1:"Extract the patient's pain level on a scale from 1-10",numberGoodExample2:"Count how many times the patient mentioned scheduling concerns",numberBadExample1:"Get a number (no context)",numberBadExample2:"Extract numeric value (missing scale)",numberTip1:"Specify the numeric range or scale",numberTip2:"Mention units if applicable (%, dollars, etc.)",numberTip3:"Define what to do with non-numeric answers",promptTemplateBoolean:"Determine if [condition]. Return true if [criteria], false otherwise.",promptTemplateString:"Extract [what information] from the conversation. Include [specific details].",promptTemplateSingleChoice:"Classify the response as one of the following: [list choices]. Choose the option that best matches the conversation.",promptTemplateNumber:"Extract [what numeric value] on a scale from [min] to [max]. Return the number only.",responseDataTitle:"Patient Response Data",responsesCount:"responses",responseLastUpdated:"Last updated:",responseShowing:"Showing",responseOf:"of",responseTotalResponses:"total responses",responseVersion:"Version",responseFilterByVersion:"Filter by Version",responseClearFilters:"Clear Filters",responseDateRange:"Date Range",responseColumns:"Columns",responseShowHideColumns:"Show/Hide Columns",responseSearchPlaceholder:"Search responses...",responseExportCsv:"Export CSV",responsePhoneNumber:"Phone Number",responseCallDate:"Call Date",responseNoMatchingFilters:"No responses match your filters",responseEmptyState:"No responses have been recorded for this module yet",responseYes:"Yes",responseNo:"No",deleteFieldTitle:"Delete Field?",deleteFieldConfirmation:"Are you sure you want to delete:",warning:"Warning",submission:"submission",submissions:"submissions",useThisField:"use this field",historicalDataWarning:"Historical data will remain intact, but this field will NOT be extracted from future calls.",actionCannotBeUndone:"This action cannot be undone.",deleteField:"Delete Field"}};var ue=r(74353),ce=r.n(ue),de=r(48309),pe=r(590),me=r(95389),fe=r(90600),ge=r(17479),xe=r(74812),he=function(e,t,r){if(!e||!t)return r||"No duration";var n=new Date(e),a=new Date(t)-n;if(a<=0)return r||"No duration";var s=Math.floor(a/1e3),i=Math.floor(s/60),o=s%60;return"".concat(i,"m ").concat(o,"s")},be=r(15750),ve=r.n(be),ye=r(35906);r(65826),r(47317),ce().extend(ve());var De=function(e,t){if(!e)return arguments.length>2&&void 0!==arguments[2]?arguments[2]:"No date";var r="es_ES"===t?"es":"en";return ce()(e).locale(r).format("".concat(ye.YB," ").concat(ye.G$))};function je(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,a,s){var l=n&&n.prototype instanceof o?n:o,u=Object.create(l.prototype);return Ce(u,"_invoke",function(r,n,a){var s,o,l,u=0,c=a||[],d=!1,p={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,r){return s=t,o=0,l=e,p.n=r,i}};function m(r,n){for(o=r,l=n,t=0;!d&&u&&!a&&t<c.length;t++){var a,s=c[t],m=p.p,f=s[2];r>3?(a=f===n)&&(l=s[(o=s[4])?5:(o=3,3)],s[4]=s[5]=e):s[0]<=m&&((a=r<2&&m<s[1])?(o=0,p.v=n,p.n=s[1]):m<f&&(a=r<3||s[0]>n||n>f)&&(s[4]=r,s[5]=n,p.n=f,o=0))}if(a||r>1)return i;throw d=!0,n}return function(a,c,f){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&m(c,f),o=c,l=f;(t=o<2?e:l)||!d;
2){s||(o?o<3?(o>1&&(p.n=-1),m(o,l)):p.n=l:p.v=l);try{if(u=2,s){if(o||(a="next"),t=s[a]){if(!(t=t.call(s,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,o<2&&(o=0)}else 1===o&&(t=s.return)&&t.call(s),o<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),o=1);s=e}else if((t=(d=p.n<0)?l:r.call(n,p))!==i)break}catch(t){s=e,o=1,l=t}finally{u=1}}return{value:t,done:d}}}(r,a,s),!0),u}var i={};function o(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(Ce(t={},n,function(){return this}),t),d=u.prototype=o.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Ce(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,Ce(d,"constructor",u),Ce(u,"constructor",l),l.displayName="GeneratorFunction",Ce(u,a,"GeneratorFunction"),Ce(d),Ce(d,a,"Generator"),Ce(d,n,function(){return this}),Ce(d,"toString",function(){return"[object Generator]"}),(je=function(){return{w:s,m:p}})()}function Ce(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}Ce=function(e,t,r,n){function s(t,r){Ce(e,t,function(e){return this._invoke(t,r,e)})}t?a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(s("next",0),s("throw",1),s("return",2))},Ce(e,t,r,n)}var Ne=function(e,t){return{in_progress:t.exportStatusInProgress,completed:t.exportStatusCompleted,transferred:t.exportStatusTransferred,transferred_by_lara:t.exportStatusTransferredByLara,no_answer:t.exportStatusNoAnswer,user_hangup:t.exportStatusUserHangup,no_recording:t.exportStatusNoRecording}[e]||e||t.unknown},we=function(e){if(!e)return"";var t=e.toString().replace(/\D/g,"");return 11===t.length&&t.startsWith("1")?t.slice(1):t},Ae={VOICE_AI:"Voice AI",VOICE_AI_TRANSFER:"Voice AI Transfer",PHONE_INBOUND:"Phone Inbound",PHONE_OUTBOUND:"Phone Outbound",SURVEY_CALL:"Survey Call"},Ee=function(e){var t=new Set;return e.forEach(function(e){e.billing_costs&&Array.isArray(e.billing_costs)&&e.billing_costs.forEac
2h(function(e){e.product_type&&t.add(e.product_type)})}),Array.from(t).sort()},Fe=function(e,t){return e.billing_costs&&Array.isArray(e.billing_costs)?e.billing_costs.filter(function(e){return e.product_type===t}).reduce(function(e,t){return e+(parseFloat(t.credit_amount)||0)},0):0},Se=function(e){return e.billing_costs&&Array.isArray(e.billing_costs)?e.billing_costs.reduce(function(e,t){return e+(parseFloat(t.credit_amount)||0)},0):0},Te=function(e){var t=e.twilio_start_date||e.start_date;if(!t)return 0;if(e.transferred_to_human&&e.transferred_at)return Math.max(0,new Date(e.transferred_at)-new Date(t));if(!e.external_id&&"transferred"===e.call_display_status)return 0;var r=e.twilio_end_date||e.end_date;return r?Math.max(0,new Date(r)-new Date(t)):0},_e=function(e){if(!e.external_id&&"transferred"===e.call_display_status){var t=e.twilio_start_date||e.start_date,r=e.twilio_end_date||e.end_date;return t&&r?Math.max(0,new Date(r)-new Date(t)):0}if(e.transferred_to_human&&e.transferred_at){var n=e.twilio_end_date||e.end_date;return n?Math.max(0,new Date(n)-new Date(e.transferred_at)):0}return 0},Oe=function(e){if(!e||e<=0)return"";var t=Math.floor(e/1e3),r=Math.floor(t/60),n=t%60;return"".concat(r,"m ").concat(n,"s")},Re=function(e,t){var r=t.map(function(e){return'"'.concat(e.label,'"')}).join(","),n=e.map(function(e){return t.map(function(t){var r=t.getValue?t.getValue(e):e[t.key]||"",n=String(r).replace(/"/g,'""');return'"'.concat(n,'"')}).join(",")});return[r].concat((0,F.A)(n)).join("\n")},ke=function(e,t){var r=new Blob(["\ufeff"+e],{type:"text/csv;charset=utf-8"}),n=window.URL.createObjectURL(r),a=document.createElement("a");a.href=n,a.setAttribute("download",t),document.body.appendChild(a),a.click(),document.body.removeChild(a),window.URL.revokeObjectURL(n)},Be=function(e){return e?e.reduce(function(e,t){return e[t.id]=t.name,e},{}):{}},Pe=function(e){return e.every(function(e){return"inbound"===e.direction})},qe=function(){var e=(0,y.A)(je().m(function e(t){var r,n,a,s,i,o,l,u,c,d,p,m,f,g;return je().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=t.data,n=t.campaigns,a=t.moduleName,s=void 0===a?"agent-calls":a,i=t.messages,o=t.language,e.p=1,r&&0!==r.length){e.n=2;break}return ge.y8.error(i.noDataToExport),e.a(2,!1);case 2:return u=Be(n),c=!Pe(r),d=Ee(r),p=[{key:"patient",label:i.patientName||"Patient Name",getValue:function(e){var t=e.first_name,r=e.last_name,n=e.telephone;return t&&r?"".concat(t," ").concat(r):n?we(n):"â"}},{key:"telephone",label:i.phoneNumber,getValue:function(e){var t=e.telephone;return t?we(t):i.noPhone}}].concat((0,F.A)(c?[{key:"campaign",label:i.campaignLabel,getValue:function(e){var t=e.agent_campaign;return e.agent_campaign_name||u[t]||(t?"".concat(i.campaignLabel,": ").concat(t.slice(0,8),"..."):i.notAvailable)}}]:[]),[{key:"call_date_time",label:i.callDateTime||"Call Date & Time",getValue:function(e){return De(e.start_date,o,i.noDate)}},{key:"duration",label:i.duration,getValue:function(e){if("in_progress"===e.call_display_status)return i.exportDurationInProgress||i.callStatusInProgress;var t=e.twilio_start_date&&e.twilio_end_date;return he(t?e.twilio_start_date:e.start_date,t?e.twilio_end_date:e.end_date,i.noDuration)}},{key:"lara_duration",label:i.exportLaraDuration||"Lara Duration",getValue:function(e){return"in_progress"===e.call_display_status?i.exportDurationInProgress||i.callStatusInProgress:Oe(Te(e))||i.noDuration}},{key:"transfer_duration",label:i.exportTransferDuration||"Transfer Duration",getValue:function(e){return Oe(_e(e))||""}},{key:"status",label:i.callStatus,getValue:function(e){return Ne(e.call_display_status,i)}},{key:"notas",label:i.exportNotasLabel||"Notas",getValue:function(e){return e.recording_url||""}}],(0,F.A)(d.map(function(e){return{key:"cost_".concat(e),label:"".concat(i.exportCostLabel||"Cost"," ").concat(Ae[e]||e),getValue:function(t){if("in_progress"===t.call_display_status)return"";var r=Fe(t,e);return r>0?"$".concat(r.toFixed(2)):"$0.00"}}})),(0,F.A)(d.length>0?[{key:"total_cost",label:i.exportTotalCost||"Total Cost",getValue:function(e){if("in_progress"===e.call_display_status)return"";var t=Se(e);return t>0?"$".concat(t.toFixed(2)):"$0.00"}}]:[])),m=Re(r,p),f=ce()().format("YYYY-MM-DD-HHmm"),g="".concat(s,"-").concat((null===(l=i.activity)||void 0===l?void 0:l.toLowerCase())||"activity","-").concat(f,".csv"),ke(m,g),ge.y8.success(i.exportSuccess),e.a(2,!0);case 3:return e.p=3,e.v,ge.y8.error(i.exportFailed),e.a(2,!1)}},e,null,[[1,3]])}
2));return function(t){return e.apply(this,arguments)}}(),Le=r(33888),Me=r(1530),Ie=r(8294);function Ge(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,a,s){var l=n&&n.prototype instanceof o?n:o,u=Object.create(l.prototype);return Ue(u,"_invoke",function(r,n,a){var s,o,l,u=0,c=a||[],d=!1,p={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,r){return s=t,o=0,l=e,p.n=r,i}};function m(r,n){for(o=r,l=n,t=0;!d&&u&&!a&&t<c.length;t++){var a,s=c[t],m=p.p,f=s[2];r>3?(a=f===n)&&(l=s[(o=s[4])?5:(o=3,3)],s[4]=s[5]=e):s[0]<=m&&((a=r<2&&m<s[1])?(o=0,p.v=n,p.n=s[1]):m<f&&(a=r<3||s[0]>n||n>f)&&(s[4]=r,s[5]=n,p.n=f,o=0))}if(a||r>1)return i;throw d=!0,n}return function(a,c,f){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&m(c,f),o=c,l=f;(t=o<2?e:l)||!d;){s||(o?o<3?(o>1&&(p.n=-1),m(o,l)):p.n=l:p.v=l);try{if(u=2,s){if(o||(a="next"),t=s[a]){if(!(t=t.call(s,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,o<2&&(o=0)}else 1===o&&(t=s.return)&&t.call(s),o<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),o=1);s=e}else if((t=(d=p.n<0)?l:r.call(n,p))!==i)break}catch(t){s=e,o=1,l=t}finally{u=1}}return{value:t,done:d}}}(r,a,s),!0),u}var i={};function o(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(Ue(t={},n,function(){return this}),t),d=u.prototype=o.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Ue(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,Ue(d,"constructor",u),Ue(u,"constructor",l),l.displayName="GeneratorFunction",Ue(u,a,"GeneratorFunction"),Ue(d),Ue(d,a,"Generator"),Ue(d,n,function(){return this}),Ue(d,"toString",function(){return"[object Generator]"}),(Ge=function(){return{w:s,m:p}})()}function Ue(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}Ue=function(e,t,r,n){function s(t,r){Ue(e,t,function(e){return this._invoke(t,r,e)})}t?a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(s("next",0),s("throw",1),s("return",2))},Ue(e,t,r,n)}var ze=r(48686),Ve=r(8723),Ye=r(85731);const He=(0,N.A)("phone-forwarded",[["path",{d:"M14 6h8",key:"yd68k4"}],["path",{d:"m18 2 4 4-4 4",key:"pucp1d"}],["path",{d:"M13.832 16.568a1 1 0 0 0 1.213-.303l.355-.465A2 2 0 0 1 17 15h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2A18 18 0 0 1 2 4a2 2 0 0 1 2-2h3a2 2 0 0 1 2 2v3a2 2 0 0 1-.8 1.6l-.468.351a1 1 0 0 0-.292 1.233 14 14 0 0 0 6.392 6.384",key:"9njp5v"}]]);var Qe=r(34647),We=r(97869),$e=r(84910),Ke=r(79804),Xe=r(41730),Ze=r(10069),Je=function(e){var t=e.row,r=e.messages,n=e.campaignLookup,a=t.original,s=a.first_name,i=a.last_name,o=a.telephone,l=a.agent_campaign,u=a.agent_campaign_name,c="â";s&&i?c="".concat(s," ").concat(i):o&&(c=(0,Ze.n)(o));var d=u||n[l]||(l?"".concat(r.campaignLabel,": ").concat(l.slice(0,8),"..."):null);return(0,h.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,h.jsx)("div",{className:"flex items-center justify-center flex-shrink-0 w-8 h-8 bg-blue-100 rounded-full",children:(0,h.jsx)(ze.A,{className:"w-4 h-4 text-blue-600"})}),(0,h.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,h.jsx)("div",{className:"font-medium truncate",children:c}),(0,h.jsxs)("div",{className:"text-xs text-gray-500 truncate",children:[o?(0,Ze.n)(o):r.noPhone,d&&(0,h.jsxs)("span",{className:"text-brand-secondary-light-1 ml-2",children:["⢠",d]})]})]})]})};Je.propTypes={row:g().object.isRequired,messages:g().object.isRequired,campaignLookup:g().object.isRequired};var et=function(e){var t=e.getValue,r=e.language,n=e.messages,a=t();return(0,h.jsx)("div",{className:"whitespace-nowrap text-sm text-gray-600",children:De(a,r,n.noDate)})};et.propTypes={getValue:g().func.isRequired,language:g().string.isRequired,messages:g().object.isRequired};var tt=function(e){var t=e.row,r=e.messages,n=t.original,a=n.call_display_status,s=n.start_date,i=n.end_date,o=n.twilio_start_date,l=n.twilio_end_date;if("in_progress"===a)return(0,h.jsxs)("div",{className:"whitespace-nowrap inline-flex items-center gap-1",children:[(0,h.jsx)("span",{className:"animate-pulse inline-block w-2 h-2 bg-yellow-500 rounded-full"}),(0,h.jsx)("span",{className:"text-sm font-medium text-yellow-700",children:r.callStatusInProgress})]});var u=o&&l,c=he(u?o:s,u?l:i,r.noDuration);return(0,h.jsx)("div",{className:"whitespace-nowrap text-sm text-gray-600",children:c})};tt.propTypes={row:g().object.isRequired,messages:g().object.isRequired};var rt=function(e){var t=e.row,r=e.messages,n=t.original,a=n.recording_url;return"in_progress"===n.call_display_status?(0,h.jsxs)("span",{className:"inline-flex items-center gap-1 text-xs text-yellow-600",children:[(0,h.jsx)(Ve.A,{className:"animate-spin w-3 h-3"}),r.recordingInProgress]}):a?(0,h.jsxs)(Xe.AM,{children:[(0,h.jsx)(Xe.Wv,{asChild:!0,children:(0,h.jsxs)("button",{type:"button",className:"inline-flex items-center space-x-1.5 text-sm text-brand-primary hover:text-brand-primary-dark-1","aria-label":r.listenRecording,children:[(0,h.jsx)(Ye.A,{className:"w-3.5 h-3.5 fill-current"}),(0,h.jsx)("span",{children:r.listenRecording})]})}),(0,h.jsx)(Xe.hl,{className:"w-auto p-3",align:"start",children:(0,h.jsx)("audio",{controls:!0,src:a,preload:"none",className:"w-64 h-8",children:(0,h.jsx)("track",{kind:"captions"})})})]}):(0,h.jsx)("span",{className:"text-xs text-gray-400",children:"â"})},nt=function(e){var t=e.row,r=e.messages,n=function(e,t){var r={in_progress:{label:t.callStatusInProgress,className:"bg-yellow-100 text-yellow-800",icon:(0,h.jsx)("span",{className:"animate-pulse w-1.5 h-1.5 rounded-full bg-yellow-500 inline-block"})},transferred:{label:t.callStatusTransferred,className:"bg-blue-100 text-blue-800",icon:(0,h.jsx)(He,{className:"w-3 h-3"})},transferred_by_lara:{label:t.callStatusTransferredByLara,className:"bg-indigo-100 text-indigo-800",icon:(0,h.jsx)(He,{className:"w-3 h-3"})},no_answer:{label:t.callStatusNoAnswer,className:"bg-gray-100 text-gray-600",icon:(0,h.jsx)(Qe.A,{className:"w-3 h-3"})},user_hangup:{label:t.callStatusUserHangup,className:"bg-red-100 text-red-700",icon:(0,h.jsx)(We.A,{className:"w-3 h-3"})},no_recording:{label:t.callStatusNoRecording,className:"bg-orange-100 text-orange-700",icon:(0,h.jsx)($e.A,{className:"w-3 h-3"})},completed:{label:t.callStatusCompletedByLara,className:"bg-green-100 text-green-800",icon:(0,h.jsx)(Ke.A,{className:"w-3 h-3"})}};return r[e.call_display_status]||r.completed}(t.original,r),a=n.label,s=n.className,i=n.icon;return(0,h.jsxs)("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-full text-xs font-medium ".concat(s),children:[i,a]})};nt.propTypes={row:g().object.isRequired,messages:g().object.isRequired},rt.propTypes={row:g().object.isRequired,messages:g().object.isRequired};var at=function(e){var t=e.totalCount,r=e.messages;return(0,h.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,h.jsx)("span",{className:"text-muted-foreground",children:r.patientName}),(0,h.jsx)(c.E,{className:"bg-brand-primary text-white rounded-full px-2 py-0.5",variant:"secondary",children:t})]})};at.propTypes={totalCount:g().number.isRequired,messages:g().object.isRequired};var st=function(e){var t=e.messages;return(0,h.jsx)("span",{className:"text-muted-foreground",children:t.callDateTime})};st.propTypes={messages:g().object.isRequired};var it=function(e){var t=e.messages;return(0,h.jsx)("span",{className:"text-muted-foreground",children:t.duration})};it.propTypes={messages:g().object.isRequired};var ot=function(e){var t=e.messages;return(0,h.jsx)("span",{className:"text-muted-foreground",children:t.recording})};ot.propTypes={messages:g().object.isRequired};var lt=function(e){var t=e.messages;return(0,h.jsx)("span",{className:"text-muted-foreground",children:t.callStatusLabel})};
2lt.propTypes={messages:g().object.isRequired};const ut=(0,N.A)("chevrons-left",[["path",{d:"m11 17-5-5 5-5",key:"13zhaf"}],["path",{d:"m18 17-5-5 5-5",key:"h8a8et"}]]);var ct=r(60250),dt=r(87677),pt=r(63286),mt=function(e){var t=e.table,r=e.totalCount,n=e.messages;return(0,h.jsxs)("div",{className:"flex items-center justify-between px-6 py-4 border-t",children:[(0,h.jsx)("div",{className:"flex items-center space-x-2",children:(0,h.jsxs)("p",{className:"text-muted-foreground text-sm",children:[n.showingXToY," ",r>0?t.getState().pagination.pageIndex*t.getState().pagination.pageSize+1:0," ",n.toX," ",Math.min((t.getState().pagination.pageIndex+1)*t.getState().pagination.pageSize,r)," ",n.ofX," ",r," ",n.entries]})}),(0,h.jsxs)("div",{className:"flex items-center space-x-6",children:[(0,h.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,h.jsx)("p",{className:"text-sm font-medium",children:n.rowsPerPage}),(0,h.jsxs)(p.l6,{value:"".concat(t.getState().pagination.pageSize),onValueChange:function(e){t.setPageSize(Number(e))},children:[(0,h.jsx)(p.bq,{className:"h-8 w-[70px]",children:(0,h.jsx)(p.yv,{placeholder:t.getState().pagination.pageSize})}),(0,h.jsx)(p.gC,{side:"top",children:[10,20,30,40,50].map(function(e){return(0,h.jsx)(p.eb,{value:"".concat(e),children:e},e)})})]})]}),(0,h.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,h.jsx)(me.$,{variant:"outline",size:"sm",onClick:function(){return t.setPageIndex(0)},disabled:!t.getCanPreviousPage(),children:(0,h.jsx)(ut,{className:"w-4 h-4"})}),(0,h.jsx)(me.$,{variant:"outline",size:"sm",onClick:function(){return t.previousPage()},disabled:!t.getCanPreviousPage(),children:(0,h.jsx)(ct.A,{className:"w-4 h-4"})}),(0,h.jsxs)("div",{className:"flex items-center justify-center text-sm font-medium w-[100px]",children:[n.page," ",t.getState().pagination.pageIndex+1," ",n.of," ",t.getPageCount()]}),(0,h.jsx)(me.$,{variant:"outline",size:"sm",onClick:function(){return t.nextPage()},disabled:!t.getCanNextPage(),children:(0,h.jsx)(dt.A,{className:"w-4 h-4"})}),(0,h.jsx)(me.$,{variant:"outline",size:"sm",onClick:function(){return t.setPageIndex(t.getPageCount()-1)},disabled:!t.getCanNextPage(),children:(0,h.jsx)(pt.A,{className:"w-4 h-4"})})]})]})]})};mt.propTypes={table:g().object.isRequired,totalCount:g().number.isRequired,messages:g().object.isRequired};const ft=mt;function gt(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function xt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?gt(Object(r),!0).forEach(function(t){(0,T.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):gt(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var ht=(0,Le.FB)(),bt=function(e){var t,r=e.searchQuery,s=e.campaigns,i=void 0===s?[]:s,o=e.moduleId,l=e.dateFilter,u=e.campaignFilter,c=e.customStartDate,d=void 0===c?null:c,p=e.customEndDate,f=void 0===p?null:p,g=e.onDataChange,x=void 0===g?null:g,b=(0,m.F7)(),v=b.language,D=b.account,j=Boolean(null==D||null===(t=D.waffles)||void 0===t?void 0:t.has_agent_call_recordings),C=(0,xe.F)(le),N=(0,a.useState)({pageIndex:0,pageSize:10}),w=(0,n.A)(N,2),A=w[0],E=w[1],F=function(e){var t=e.moduleId,r=e.searchQuery,s=e.campaignFilter,i=e.dateFilter,o=e.customStartDate,l=e.customEndDate,u=e.pagination,c=e.onDataChange,d=(0,a.useState)([]),p=(0,n.A)(d,2),m=p[0],f=p[1],g=(0,a.useState)(0),x=(0,n.A)(g,2),h=x[0],b=x[1],v=(0,a.useState)(0),D=(0,n.A)(v,2),j=D[0],C=D[1],N=(0,a.useState)(!1),w=(0,n.A)(N,2),A=w[0],E=w[1],F=(0,a.useState)(null),S=(0,n.A)(F,2),T=S[0],_=S[1],O=(0,Ie.d)(r,500),R=(0,Ie.d)(s,300),k=(0,Ie.d)(i,300),B=(0,Ie.d)(o,300),P=(0,Ie.d)(l,300),q=!A&&(r!==O||s!==R||i!==k||o!==B||l!==P),L=(0,a.useCallback)((0,y.A)(Ge().m(function e(){var r,n,a,s,i,o,l,d,p,m,g;return Ge().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t){e.n=1;break}return e.a(2);case 1:if(E(!0),_(null),e.p=2,r={agent_module_id:t,page:u.pageIndex+1,page_size:u.pageSize},O&&(r.patient_name=O),R&&"all"!==R&&(r.agent_campaign=R),"custom"!==k||!B||!P){e.n=3;break}r.date_range_after=ce()(B).format("YYYY-MM-DD"),r.date_range_before=ce()(P).format("YYYY-MM-DD"),e.n=10;break;case 3:if("all"===k){e.n=10;break}n=ce()(),m=k,e.n="today"===m?4:"yesterday"===m?5:"last7days"===m?6:"last30days"===m?7:8;break;case 4:return a=n.startOf("day"),s=n.endOf("day"),e.a(3,9);case 5:return a=n.subtract(1,"day").startOf("day"),s=n.subtract(1,"day").endOf("day"),e.a(3,9);case 6:return a=n.subtract(7,"day").startOf("day"),s=n.endOf("day"),e.a(3,9);case 7:return a=n.subtract(30,"day").startOf("day"),s=n.endOf("day"),e.a(3,9);case 8:return e.a(3,9);case 9:a&&s&&(r.date_range_after=a.format("YYYY-MM-DD"),r.date_range_before=s.format("YYYY-MM-DD"));case 10:return e.n=11,z(r);case 11:i=e.v,null!=(o=i.data)&&o.results&&(l=o.results,d=o.count||l.length,p=Math.ceil(d/u.pageSize),f(l),b(d
2),C(p),c&&c(l,d)),e.n=13;break;case 12:e.p=12,g=e.v,_(g.message||"Failed to fetch call data"),f([]),b(0),C(0);case 13:return e.p=13,E(!1),e.f(13);case 14:return e.a(2)}},e,null,[[2,12,13,14]])})),[t,O,R,k,B,P,u.pageIndex,u.pageSize,c]);return(0,a.useEffect)(function(){L()},[L]),{callData:m,totalCount:h,pageCount:j,isLoading:A,isFiltersPending:q,error:T,refetch:L}}({moduleId:o,searchQuery:r,campaignFilter:u,dateFilter:l,customStartDate:d,customEndDate:f,pagination:A,onDataChange:x}),S=F.callData,_=F.totalCount,O=F.pageCount,R=F.isLoading,k=F.isFiltersPending,B=F.error,P=F.refetch,q=(0,a.useMemo)(function(){return i?i.reduce(function(e,t){return xt(xt({},e),{},(0,T.A)({},t.id,t.name))},{}):{}},[i]),L=(0,a.useMemo)(function(){return r?S.filter(function(e){return"".concat(e.first_name||""," ").concat(e.last_name||"").toLowerCase().includes(r.toLowerCase())}):S},[S,r]),M=(0,a.useCallback)(function(){return(0,h.jsx)(at,{totalCount:_,messages:C})},[_,C]),I=(0,a.useCallback)(function(){return(0,h.jsx)(st,{messages:C})},[C]),G=(0,a.useCallback)(function(){return(0,h.jsx)(it,{messages:C})},[C]),U=(0,a.useCallback)(function(e){var t=e.row;return(0,h.jsx)(Je,{row:t,messages:C,campaignLookup:q})},[C,q]),V=(0,a.useCallback)(function(e){var t=e.getValue;return(0,h.jsx)(et,{getValue:t,language:v,messages:C})},[v,C]),Y=(0,a.useCallback)(function(e){var t=e.row;return(0,h.jsx)(tt,{row:t,messages:C})},[C]),H=(0,a.useCallback)(function(){return(0,h.jsx)(ot,{messages:C})},[C]),Q=(0,a.useCallback)(function(e){var t=e.row;return(0,h.jsx)(rt,{row:t,messages:C})},[C]),W=(0,a.useCallback)(function(){return(0,h.jsx)(lt,{messages:C})},[C]),$=(0,a.useCallback)(function(e){var t=e.row;return(0,h.jsx)(nt,{row:t,messages:C})},[C]),K=(0,a.useMemo)(function(){var e=[ht.accessor("first_name",{id:"patient",size:300,header:M,cell:U}),ht.accessor("start_date",{id:"callDateTime",size:400,header:I,cell:V}),ht.accessor("start_date",{id:"duration",size:150,header:G,cell:Y}),ht.accessor("call_display_status",{id:"status",size:220,header:W,cell:$})];return j&&e.push(ht.accessor("recording_url",{id:"recording",size:180,header:H,cell:Q})),e},[M,U,I,V,G,Y,W,$,j,H,Q]),X=(0,Me.N4)({data:L,columns:K,pageCount:O,manualPagination:!0,getCoreRowModel:(0,Le.HT)(),onPaginationChange:E,state:{pagination:A}});return R?(0,h.jsx)("div",{className:"bg-white border rounded-lg",children:(0,h.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,h.jsxs)("div",{className:"text-center",children:[(0,h.jsx)("div",{className:"animate-spin w-8 h-8 mx-auto mb-4 border-b-2 border-blue-600 rounded-full"}),(0,h.jsx)("p",{className:"text-muted-foreground",children:C.loadingCalls})]})})}):B?(0,h.jsx)("div",{className:"bg-white border rounded-lg",children:(0,h.jsx)("div",{className:"flex items-center justify-center py-12",children:(0,h.jsxs)("div",{className:"text-center",children:[(0,h.jsx)("p",{className:"mb-2 text-red-600",children:C.errorLoadingCalls}),(0,h.jsx)("p",{className:"text-muted-foreground mb-4 text-sm",children:B}),(0,h.jsx)(me.$,{variant:"outline",onClick:P,children:C.tryAgain})]})})}):(0,h.jsxs)("div",{className:"relative bg-white border rounded-lg",children:[k&&(0,h.jsx)("div",{className:"top-2 right-2 absolute z-10",children:(0,h.jsxs)("div",{className:"bg-blue-50 flex items-center px-3 py-1 space-x-2 text-xs text-blue-600 rounded-full",children:[(0,h.jsx)("div",{className:"animate-spin border-t-transparent w-3 h-3 border border-blue-600 rounded-full"}),(0,h.jsx)("span",{children:C.updating})]})}),(0,h.jsxs)("table",{className:"w-full",children:[(0,h.jsx)("thead",{children:X.getHeaderGroups().map(function(e){return(0,h.jsx)("tr",{className:"bg-muted/30 border-b",children:e.headers.map(function(e){return(0,h.jsx)("th",{className:"px-6 py-4 text-left",style:150!==e.getSize()?{width:"".concat(e.getSize(),"px")}:void 0,children:e.isPlaceholder?null:(0,Me.Kv)(e.column.columnDef.header,e.getContext())},e.id)})},e.id)})}),(0,h.jsx)("tbody",{className:"divide-y",children:X.getRowModel().rows.length>0?X.getRowModel().rows.map(function(e){return(0,h.jsx)("tr",{className:"hover:bg-muted/20 transition-colors",children:e.getVisibleCells().map(function(e){return(0,h.jsx)("td",{className:"px-6 py-4",children:(0,Me.Kv)(e.column.columnDef.cell,e.getContext())},e.id)})},e.id)}):(0,h.jsx)("tr",{children:(0,h.jsx)("td",{colSpan:K.length,className:"text-muted-foreground px-6 py-12 text-center",children:r?"".concat(C.noPatientsFound,' "').concat(r,'"'):C.noCallsFound})})})]}),(0,h.jsx)(ft,{table:X,totalCount:_,messages:C})]})};
2bt.propTypes={searchQuery:g().string.isRequired,campaigns:g().arrayOf(g().shape({id:g().string.isRequired,name:g().string.isRequired})),moduleId:g().string.isRequired,dateFilter:g().string.isRequired,campaignFilter:g().string.isRequired,customStartDate:g().string,customEndDate:g().string,onDataChange:g().func};const vt=bt;function yt(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,a,s){var l=n&&n.prototype instanceof o?n:o,u=Object.create(l.prototype);return Dt(u,"_invoke",function(r,n,a){var s,o,l,u=0,c=a||[],d=!1,p={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,r){return s=t,o=0,l=e,p.n=r,i}};function m(r,n){for(o=r,l=n,t=0;!d&&u&&!a&&t<c.length;t++){var a,s=c[t],m=p.p,f=s[2];r>3?(a=f===n)&&(l=s[(o=s[4])?5:(o=3,3)],s[4]=s[5]=e):s[0]<=m&&((a=r<2&&m<s[1])?(o=0,p.v=n,p.n=s[1]):m<f&&(a=r<3||s[0]>n||n>f)&&(s[4]=r,s[5]=n,p.n=f,o=0))}if(a||r>1)return i;throw d=!0,n}return function(a,c,f){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&m(c,f),o=c,l=f;(t=o<2?e:l)||!d;){s||(o?o<3?(o>1&&(p.n=-1),m(o,l)):p.n=l:p.v=l);try{if(u=2,s){if(o||(a="next"),t=s[a]){if(!(t=t.call(s,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,o<2&&(o=0)}else 1===o&&(t=s.return)&&t.call(s),o<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),o=1);s=e}else if((t=(d=p.n<0)?l:r.call(n,p))!==i)break}catch(t){s=e,o=1,l=t}finally{u=1}}return{value:t,done:d}}}(r,a,s),!0),u}var i={};function o(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(Dt(t={},n,function(){return this}),t),d=u.prototype=o.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Dt(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,Dt(d,"constructor",u),Dt(u,"constructor",l),l.displayName="GeneratorFunction",Dt(u,a,"GeneratorFunction"),Dt(d),Dt(d,a,"Generator"),Dt(d,n,function(){return this}),Dt(d,"toString",function(){return"[object Generator]"}),(yt=function(){return{w:s,m:p}})()}function Dt(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}Dt=function(e,t,r,n){function s(t,r){Dt(e,t,function(e){return this._invoke(t,r,e)})}t?a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(s("next",0),s("throw",1),s("return",2))},Dt(e,t,r,n)}var jt=function(e){var t,r=e.module,s=e.moduleId,i=(0,m.F7)().language,u=(0,l.W6)(),c=(0,xe.F)(le),f=(0,a.useState)("all"),g=(0,n.A)(f,2),x=g[0],b=g[1],v=(0,a.useState)("all"),D=(0,n.A)(v,2),C=D[0],N=D[1],w=(0,a.useState)(""),A=(0,n.A)(w,2),E=A[0],F=A[1],S=(0,a.useState)(""),T=(0,n.A)(S,2),O=T[0],R=T[1],k=(0,a.useState)(""),B=(0,n.A)(k,2),P=B[0],q=B[1],L=(0,a.useState)(!1),M=(0,n.A)(L,2),I=M[0],G=M[1],U=(0,a.useState)([]),z=(0,n.A)(U,2)[1],Y=(0,a.useCallback)(function(){var e={agent_module_id:s};if(E&&(e.patient_name=E),C&&"all"!==C&&(e.agent_campaign=C),"custom"===x&&O&&P)e.date_range_after=ce()(O).format("YYYY-MM-DD"),e.date_range_before=ce()(P).format("YYYY-MM-DD");else if("all"!==x){var t,r,n=ce()();switch(x){case"today":t=n.startOf("day"),r=n.endOf("day");break;case"yesterday":t=n.subtract(1,"day").startOf("day"),r=n.subtract(1,"day").endOf("day");break;case"last7days":t=n.subtract(7,"day").startOf("day"),r=n.endOf("day");break;case"last30days":t=n.subtract(30,"day").startOf("day"),r=n.endOf("day")}t&&r&&(e.date_range_after=t.format("YYYY-MM-DD"),e.date_range_before=r.format("YYYY-MM-DD"))}return e},[s,E,C,x,O,P]),H=function(){var e=(0,y.A)(yt().m(function e(){var t,n,a,s;return yt().w(function(e){for(;;)switch(e.p=e.n){case 0:if(!I){e.n=1;break}return e.a(2);case 1:return G(!0),e.p=2,e.n=3,V(Y());case 3:return t=e.v,n=t.results,a=t.totalCount,t.isTruncated&&ge.y8.error((0,_.H3)(c.exportTruncatedWarning||"The export includes only [exported] of [total] calls due to a system limit.",{exported:n.length,total:a})),e.n=4,qe({data:n,campaigns:null==r?void 0:r.campaigns,moduleName:(null==r?void 0:r.name)||"module",messages:c,language:i});case 4:e.n=6;break;case 5:e.p=5,(null!=(s=e.v)&&s.response||null!=s&&s.message)&&ge.y8.error(c.exportError||"Failed to export data. Please try again.");case 6:return e.p=6,G(!1),e.f(6);case 7:return e.a(2)}},e,null,[[2,5,6,7]])}));return function(){return e.apply(this,arguments)}}();return(0,h.jsxs)("div",{className:"space-y-6",children:[(0,h.jsxs)("div",{className:"flex flex-col space-y-4",children:[(0,h.jsxs)("div",{className:"flex items-center justify-between",children:[(0,h.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,h.jsx)(j.A,{className:"text-muted-foreground w-5 h-5"}),(0,h.jsxs)("span",{className:"text-muted-foreground",children:[c.filterByDate,":"]}
2),(0,h.jsxs)(p.l6,{value:x,onValueChange:b,children:[(0,h.jsx)(p.bq,{className:"w-[180px]",children:(0,h.jsx)(p.yv,{})}),(0,h.jsxs)(p.gC,{children:[(0,h.jsx)(p.eb,{value:"all",children:c.allTime}),(0,h.jsx)(p.eb,{value:"today",children:c.today}),(0,h.jsx)(p.eb,{value:"yesterday",children:c.yesterday}),(0,h.jsx)(p.eb,{value:"last7days",children:c.last7Days}),(0,h.jsx)(p.eb,{value:"last30days",children:c.last30Days}),(0,h.jsx)(p.eb,{value:"custom",children:c.customRange})]})]}),(0,h.jsxs)("span",{className:"text-muted-foreground ml-4",children:[c.filterByCampaign,":"]}),(0,h.jsxs)(p.l6,{value:C,onValueChange:N,children:[(0,h.jsx)(p.bq,{className:"w-[200px]",children:(0,h.jsx)(p.yv,{})}),(0,h.jsxs)(p.gC,{children:[(0,h.jsx)(p.eb,{value:"all",children:c.allCampaigns}),null==r||null===(t=r.campaigns)||void 0===t?void 0:t.map(function(e){return(0,h.jsx)(p.eb,{value:e.id,children:e.name},e.id)})]})]})]}),(0,h.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,h.jsxs)("div",{className:"relative w-[280px]",children:[(0,h.jsx)(o.A,{className:"left-3 top-1/2 text-muted-foreground absolute w-4 h-4 -translate-y-1/2"}),(0,h.jsx)(d.p,{type:"text",placeholder:c.searchPatients,value:E,onChange:function(e){return F(e.target.value)},className:"pl-9 bg-white"})]}),(0,h.jsx)(me.$,{variant:"outline",size:"icon","aria-label":c.exportCsv,onClick:H,disabled:I,children:I?(0,h.jsx)("div",{className:"animate-spin w-4 h-4 border-b-2 border-gray-600 rounded-full"}):(0,h.jsx)(de.A,{className:"w-4 h-4"})}),(0,h.jsxs)(me.$,{className:"bg-action-primary hover:bg-action-primary-dark-1 text-white",onClick:function(){u.push("/app/contacts/outreach/list?openCreateCampaign=true")},children:[(0,h.jsx)(pe.A,{className:"w-4 h-4 mr-2"}),c.createCampaign]})]})]}),"custom"===x&&(0,h.jsxs)("div",{className:"flex items-end pl-8 space-x-4",children:[(0,h.jsxs)("div",{className:"flex-1 max-w-[200px]",children:[(0,h.jsx)(fe.J,{htmlFor:"start-date",className:"text-muted-foreground block mb-2 text-sm",children:c.startDate}),(0,h.jsx)(d.p,{id:"start-date",type:"date",value:O,onChange:function(e){return R(e.target.value)},className:"w-full bg-white"})]}),(0,h.jsxs)("div",{className:"flex-1 max-w-[200px]",children:[(0,h.jsx)(fe.J,{htmlFor:"end-date",className:"text-muted-foreground block mb-2 text-sm",children:c.endDate}),(0,h.jsx)(d.p,{id:"end-date",type:"date",value:P,onChange:function(e){return q(e.target.value)},className:"w-full bg-white"})]})]})]}),(0,h.jsx)(vt,{searchQuery:E,moduleId:s,dateFilter:x,campaignFilter:C,customStartDate:O,customEndDate:P,campaigns:r.campaigns,onDataChange:z})]})};jt.propTypes={module:g().shape({name:g().string,campaigns:g().arrayOf(g().shape({id:g().string.isRequired,name:g().string.isRequired}))}).isRequired,moduleId:g().string.isRequired};const Ct=jt;var Nt=r(80827);const wt=(0,N.A)("target",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["circle",{cx:"12",cy:"12",r:"6",key:"1vlfrh"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]]);var At=r(62814),Et=r(65315),Ft=r(44826);function St(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,a,s){var l=n&&n.prototype instanceof o?n:o,u=Object.create(l.prototype);return Tt(u,"_invoke",function(r,n,a){var s,o,l,u=0,c=a||[],d=!1,p={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,r){return s=t,o=0,l=e,p.n=r,i}};function m(r,n){for(o=r,l=n,t=0;!d&&u&&!a&&t<c.length;t++){var a,s=c[t],m=p.p,f=s[2];r>3?(a=f===n)&&(l=s[(o=s[4])?5:(o=3,3)],s[4]=s[5]=e):s[0]<=m&&((a=r<2&&m<s[1])?(o=0,p.v=n,p.n=s[1]):m<f&&(a=r<3||s[0]>n||n>f)&&(s[4]=r,s[5]=n,p.n=f,o=0))}if(a||r>1)return i;throw d=!0,n}return function(a,c,f){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&m(c,f),o=c,l=f;(t=o<2?e:l)||!d;){s||(o?o<3?(o>1&&(p.n=-1),m(o,l)):p.n=l:p.v=l);try{if(u=2,s){if(o||(a="next"),t=s[a]){if(!(t=t.call(s,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,o<2&&(o=0)}else 1===o&&(t=s.return)&&t.call(s),o<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),o=1);s=e}else if((t=(d=p.n<0)?l:r.call(n,p))!==i)break}catch(t){s=e,o=1,l=t}finally{u=1}}return{value:t,done:d}}}(r,a,s),!0),u}var i={};function o(){}function l(){}function u(){}t=Object.getPrototypeOf;
2var c=[][n]?t(t([][n]())):(Tt(t={},n,function(){return this}),t),d=u.prototype=o.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Tt(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,Tt(d,"constructor",u),Tt(u,"constructor",l),l.displayName="GeneratorFunction",Tt(u,a,"GeneratorFunction"),Tt(d),Tt(d,a,"Generator"),Tt(d,n,function(){return this}),Tt(d,"toString",function(){return"[object Generator]"}),(St=function(){return{w:s,m:p}})()}function Tt(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}Tt=function(e,t,r,n){function s(t,r){Tt(e,t,function(e){return this._invoke(t,r,e)})}t?a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(s("next",0),s("throw",1),s("return",2))},Tt(e,t,r,n)}var _t=function(e){var t=e.moduleId,r=e.initialCallLogPrompt,s=e.successCriteriaPrompt,i=(0,m.F7)().language,o=le[i],l=(0,a.useState)(r),u=(0,n.A)(l,2),c=u[0],d=u[1],p=(0,Ft.A)(function(){var e=(0,y.A)(St().m(function e(r){return St().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,e.n=1,U(t,r);case 1:At.A.success(ye.OG.UPDATE_CALL_LOG_PROMPT_SUCCESS),e.n=3;break;case 2:e.p=2,e.v,At.A.error(ye.OG.UPDATE_CALL_LOG_PROMPT_FAILURE);case 3:return e.a(2)}},e,null,[[0,2]])}));return function(t){return e.apply(this,arguments)}}(),2e3);return(0,h.jsx)("div",{className:"space-y-6",children:(0,h.jsxs)("div",{className:"space-y-6",children:[(0,h.jsxs)(x.Zp,{className:"bg-white",children:[(0,h.jsxs)(x.aR,{children:[(0,h.jsxs)(x.ZB,{className:"flex items-center space-x-2",children:[(0,h.jsx)(Nt.A,{className:"w-5 h-5"}),(0,h.jsx)("span",{children:o.callLogPromptTitle})]}),(0,h.jsx)(x.BT,{children:o.callLogPromptDescription})]}),(0,h.jsx)(x.Wu,{className:"space-y-4",children:(0,h.jsx)(Et.T,{value:c,onChange:function(e){var t=e.target.value;d(t),p(t)}})})]}),(0,h.jsxs)(x.Zp,{className:"bg-white",children:[(0,h.jsxs)(x.aR,{children:[(0,h.jsxs)(x.ZB,{className:"flex items-center space-x-2",children:[(0,h.jsx)(wt,{className:"w-5 h-5"}),(0,h.jsx)("span",{children:o.successCriteriaTitle})]}),(0,h.jsx)(x.BT,{children:o.successCriteriaDescription})]}),(0,h.jsx)(x.Wu,{children:(0,h.jsx)("div",{className:"bg-muted/30 p-4 border rounded-lg",children:(0,h.jsx)("div",{className:"text-sm leading-relaxed whitespace-pre-line",children:s})})})]})]})})};_t.propTypes={moduleId:g().string.isRequired,initialCallLogPrompt:g().string,successCriteriaPrompt:g().string.isRequired};var Ot=r(80045),Rt=r(72102),kt=r(75107),Bt=r(32708),Pt=r(45773),qt=r(80697),Lt=["id","isNew"],Mt=["isNew"];function It(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Gt(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?It(Object(r),!0).forEach(function(t){(0,T.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):It(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Ut(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,a,s){var l=n&&n.prototype instanceof o?n:o,u=Object.create(l.prototype);return zt(u,"_invoke",function(r,n,a){var s,o,l,u=0,c=a||[],d=!1,p={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,r){return s=t,o=0,l=e,p.n=r,i}};function m(r,n){for(o=r,l=n,t=0;!d&&u&&!a&&t<c.length;t++){var a,s=c[t],m=p.p,f=s[2];r>3?(a=f===n)&&(l=s[(o=s[4])?5:(o=3,3)],s[4]=s[5]=e):s[0]<=m&&((a=r<2&&m<s[1])?(o=0,p.v=n,p.n=s[1]):m<f&&(a=r<3||s[0]>n||n>f)&&(s[4]=r,s[5]=n,p.n=f,o=0))}if(a||r>1)return i;throw d=!0,n}return function(a,c,f){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&m(c,f),o=c,l=f;(t=o<2?e:l)||!d;){s||(o?o<3?(o>1&&(p.n=-1),m(o,l)):p.n=l:p.v=l);try{if(u=2,s){if(o||(a="next"),t=s[a]){if(!(t=t.call(s,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,o<2&&(o=0)}else 1===o&&(t=s.return)&&t.call(s),o<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),o=1);s=e}else if((t=(d=p.n<0)?l:r.call(n,p))!==i)break}catch(t){s=e,o=1,l=t}finally{u=1}}return{value:t,done:d}}}(r,a,s),!0),u}var i={};function o(){}function l(){}function u(){}t=Object.getPrototypeOf;
2var c=[][n]?t(t([][n]())):(zt(t={},n,function(){return this}),t),d=u.prototype=o.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,zt(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,zt(d,"constructor",u),zt(u,"constructor",l),l.displayName="GeneratorFunction",zt(u,a,"GeneratorFunction"),zt(d),zt(d,a,"Generator"),zt(d,n,function(){return this}),zt(d,"toString",function(){return"[object Generator]"}),(Ut=function(){return{w:s,m:p}})()}function zt(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}zt=function(e,t,r,n){function s(t,r){zt(e,t,function(e){return this._invoke(t,r,e)})}t?a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(s("next",0),s("throw",1),s("return",2))},zt(e,t,r,n)}var Vt=function(e){var t=e.escalationRules,r=void 0===t?[]:t,s=e.moduleId,o=(0,xe.F)(le),l=(0,a.useState)([]),c=(0,n.A)(l,2),d=c[0],p=c[1],m=(0,a.useState)([]),f=(0,n.A)(m,2),g=f[0],x=f[1],b=(0,a.useState)({}),v=(0,n.A)(b,2),D=v[0],j=v[1],C=(0,a.useState)({}),N=(0,n.A)(C,2),w=N[0],A=N[1],E=(0,a.useState)(!0),_=(0,n.A)(E,2),O=_[0],R=_[1],k=(0,a.useState)(null),B=(0,n.A)(k,2),P=B[0],q=B[1],U={1:{label:o.priorityLow,color:"bg-blue-100 text-blue-800",value:1},2:{label:o.priorityMedium,color:"bg-gray-100 text-gray-800",value:2},3:{label:o.priorityHigh,color:"bg-red-100 text-red-800",value:3}};(0,a.useEffect)(function(){var e=function(){var e=(0,y.A)(Ut().m(function e(){var t;return Ut().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,R(!0),e.n=1,L({is_active:!0});case 1:t=e.v,p(r),x(t.data.results||t.data||[]),q(null),e.n=3;break;case 2:e.p=2,e.v,q(o.failedToLoadTemplates);case 3:return e.p=3,R(!1),e.f(3);case 4:return e.a(2)}},e,null,[[0,2,3,4]])}));return function(){return e.apply(this,arguments)}}();e()},[r,o]);var z=function(e){A(function(t){return Gt(Gt({},t),{},(0,T.A)({},e,!t[e]))})},V=function(){var e=(0,y.A)(Ut().m(function e(t){var r,n,a,i,l,c,m,f,g,x,h,b,v;return Ut().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=d.find(function(e){return e.id===t})){e.n=1;break}return e.a(2);case 1:if(r.description&&""!==r.description.trim()){e.n=2;break}return u.oR.error(o.descriptionRequired,{className:"bg-white-1.0 p-4 rounded border-l-8 shadow border-red-1.0 w-84",closeButton:!1,bodyClassName:"flex flex-grow",containerId:"notification"}),e.a(2);case 2:if(e.p=2,!r.isNew){e.n=4;break}return r.id,r.isNew,n=(0,Ot.A)(r,Lt),a=Gt({},n),Array.isArray(a.module_ids)&&0!==a.module_ids.length||s&&(a.module_ids=[s]),e.n=3,M(a);case 3:i=e.v,p(function(e){return e.map(function(e){return e.id===t?Gt(Gt({},i.data),{},{isNew:!1}):e})}),e.n=6;break;case 4:return r.isNew,l=(0,Ot.A)(r,Mt),c=Gt({},l),Array.isArray(c.module_ids)&&0!==c.module_ids.length||s&&(c.module_ids=[s]),e.n=5,I(t,c);case 5:m=e.v,p(function(e){return e.map(function(e){return e.id===t?m.data:e})});case 6:z(t),e.n=8;break;case 7:e.p=7,v=e.v,x=o.errorSavingRule,null!=v&&null!==(f=v.response)&&void 0!==f&&null!==(f=f.data)&&void 0!==f&&f.template?(h=Array.isArray(v.response.data.template)?v.response.data.template[0]:v.response.data.template,b=String(h),x=b.includes("already used")?o.templateAlreadyInModule:b):null!=v&&null!==(g=v.response)&&void 0!==g&&null!==(g=g.data)&&void 0!==g&&g.detail&&(x=String(v.response.data.detail)),u.oR.error(x,{className:"bg-white-1.0 p-4 rounded border-l-8 shadow border-red-1.0 w-84",closeButton:!1,bodyClassName:"flex flex-grow",containerId:"notification"});case 8:return e.a(2)}},e,null,[[2,7]])}));return function(t){return e.apply(this,arguments)}}(),Y=function(){var e=(0,y.A)(Ut().m(function e(t){var r;return Ut().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r=d.find(function(e){return e.id===t})){e.n=1;break}return e.a(2);case 1:if(e.p=1,r.isNew){e.n=2;break}return e.n=2,G(t);case 2:p(function(e){return e.filter(function(e){return e.id!==t})}),j(function(e){var r=Gt({},e);return delete r[t],r}),A(function(e){var r=Gt({},e);return delete r[t],r}),e.n=4;break;case 3:e.p=3,e.v,u.oR.error(o.errorDeletingRule,{className:"bg-white-1.0 p-4 rounded border-l-8 shadow border-red-1.0 w-84",closeButton:!1,bodyClassName:"flex flex-grow",containerId:"notification"});case 4:return e.a(2)}},e,null,[[1,3]])}
2));return function(t){return e.apply(this,arguments)}}(),H=function(e,t,r){p(function(n){return n.map(function(n){return n.id===e?Gt(Gt({},n),{},(0,T.A)({},t,r)):n})}),w[e]||A(function(t){return Gt(Gt({},t),{},(0,T.A)({},e,!0))})},Q=function(e){var t=function(e){return U[e]||U[2]}(e.priority),r=D[e.id],n=function(e){return e.template&&"object"===(0,S.A)(e.template)?e.template:g.find(function(t){return t.id===e.template})||{}}(e);return(0,h.jsxs)("div",{className:"hover:bg-gray-50 flex items-center justify-between p-4 transition-colors cursor-pointer",onClick:function(){return t=e.id,void j(function(e){return Gt(Gt({},e),{},(0,T.A)({},t,!e[t]))});var t},children:[(0,h.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,h.jsx)("span",{className:"font-medium text-gray-900",children:e.title||n.title||n.trigger_event||o.newEscalationRule}),(0,h.jsx)("span",{className:"inline-flex items-center px-2 py-1 rounded text-xs font-medium ".concat(t.color),children:t.label})]}),(0,h.jsx)("div",{className:"flex items-center space-x-2",children:r?(0,h.jsx)(Rt.A,{className:"w-4 h-4 text-gray-500"}):(0,h.jsx)(kt.A,{className:"w-4 h-4 text-gray-500"})})]})},W=function(e){var t=w[e.id];return D[e.id]?(0,h.jsx)("div",{className:"bg-gray-50 px-4 pb-4 border-t",children:(0,h.jsxs)("div",{className:"pt-4 space-y-4",children:[(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{htmlFor:"template-select-".concat(e.id),className:"block mb-1 text-sm font-medium text-gray-700",children:o.escalationTemplate}),(0,h.jsx)("select",{id:"template-select-".concat(e.id),value:e.template,onChange:function(t){return H(e.id,"template",t.target.value)},className:"focus:outline-none focus:ring-2 focus:ring-blue-500 w-full px-3 py-2 text-sm border border-gray-300 rounded",children:g.map(function(e){return(0,h.jsx)("option",{value:e.id,children:e.title||e.trigger_event||e.json_field||o.unnamedTemplate},e.id)})})]}),(0,h.jsxs)("div",{className:"grid grid-cols-2 gap-4",children:[(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{htmlFor:"channel-".concat(e.id),className:"block mb-1 text-sm font-medium text-gray-700",children:o.channelLabel}),(0,h.jsxs)("select",{id:"channel-".concat(e.id),value:e.channel||"task",onChange:function(t){return H(e.id,"channel",t.target.value)},className:"focus:outline-none focus:ring-2 focus:ring-blue-500 w-full px-3 py-2 text-sm border border-gray-300 rounded",children:[(0,h.jsx)("option",{value:"task",children:o.channelTask}),(0,h.jsx)("option",{value:"email",children:o.channelEmail}),(0,h.jsx)("option",{value:"notification",children:o.channelNotification})]})]}),(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{htmlFor:"priority-".concat(e.id),className:"block mb-1 text-sm font-medium text-gray-700",children:o.priorityLabel}),(0,h.jsxs)("select",{id:"priority-".concat(e.id),value:e.priority||2,onChange:function(t){return H(e.id,"priority",parseInt(t.target.value,10))},className:"focus:outline-none focus:ring-2 focus:ring-blue-500 w-full px-3 py-2 text-sm border border-gray-300 rounded",children:[(0,h.jsx)("option",{value:1,children:o.priorityLow}),(0,h.jsx)("option",{value:2,children:o.priorityMedium}),(0,h.jsx)("option",{value:3,children:o.priorityHigh})]})]})]}),(0,h.jsxs)("div",{children:[(0,h.jsx)("label",{htmlFor:"description-".concat(e.id),className:"block mb-1 text-sm font-medium text-gray-700",children:o.taskDescriptionLabel}),(0,h.jsx)("textarea",{id:"description-".concat(e.id),value:e.description||"",onChange:function(t){return H(e.id,"description",t.target.value)},rows:3,className:"focus:outline-none focus:ring-2 focus:ring-blue-500 w-full px-3 py-2 text-sm border border-gray-300 rounded",placeholder:o.taskDescriptionPlaceholder})]}),(0,h.jsxs)("div",{className:"flex justify-end pt-4 space-x-2 border-t",children:[(0,h.jsxs)("button",{type:"button",onClick:function(){return Y(e.id)},className:"hover:text-red-700 hover:bg-red-50 inline-flex items-center px-3 py-2 text-sm font-medium text-red-600 transition-colors rounded",children:[(0,h.jsx)(Bt.A,{className:"w-4 h-4 mr-1"}),o.deleteAction]}),(0,h.jsxs)("button",{type:"button",onClick:function(){return V(e.id)},disabled:!t,className:"inline-flex items-center px-3 py-2 text-sm font-medium transition-colors rounded ".concat(t?"text-green-600 hover:text-green-700 hover:bg-green-50":"text-gray-400 cursor-not-allowed"),children:[(0,h.jsx)(Pt.A,{className:"w-4 h-4 mr-1"}),o.saveAction]})]})]})}):null};return O?(0,h.jsxs)("div",{className:"space-y-6",children:[(0,h.jsx)("div",{className:"flex items-center justify-between",children:(0,h.jsxs)("div",{children:[(0,h.jsxs)("div",{className:"flex items-center mb-2 space-x-2",children:[(0,h.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:o.escalationRulesTitle}),(0,h.jsxs)("div",{className:"inline-flex items-center px-2 py-1 text-xs font-medium text-purple-800 bg-purple-100 rounded",children:[(0,h.jsx)(i.A,{className:"w-3 h-3 mr-1"}),"AI"]})]}),(0,h.jsx)("p",{className:"text-sm text-[#717182]",children:o.escalationRulesDescription})]})}),(0,h.jsx)("div",{className:"p-8 text-center bg-white border rounded-lg",children:(0,h.jsx)("p",{className:"text-gray-500",children:o.loadingEscalationRules})})]}):P?(0,h.jsxs)("div",{className:"space-y-6",children:[(0,h.jsx)("div",{className:"flex items-center justify-between",children:(0,h.jsxs)("div",{children:[(0,h.jsxs)("div",{className:"flex items-center mb-2 space-x-2",children:[(0,h.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:o.escalationRulesTitle}),(0,h.jsxs)("div",{className:"inline-flex items-center px-2 py-1 text-xs font-medium text-purple-800 bg-purple-100 rounded",children:[(0,h.jsx)(i.A,{className:"w-3 h-3 mr-1"}),"AI"]})]}),(0,h.jsx)("p",{className:"text-sm text-[#717182]",children:o.escalationRulesDescription})]})}),(0,h.jsx)("div",{className:"p-8 text-center bg-white border rounded-lg",children:(0,h.jsx)("p",{className:"text-red-500",children:P})})]}):(0,h.jsxs)("div",{className:"space-y-6",children:[(0,h.jsxs)("div",{className:"flex items-center justify-between",children:[(0,h.jsxs)("div",{children:[(0,h.jsxs)("div",{className:"flex items-center mb-2 space-x-2",children:[(0,h.jsx)("h2",{className:"text-lg font-semibold text-gray-900",children:o.escalationRulesTitle}),(0,h.jsxs)("div",{className:"inline-flex items-center px-2 py-1 text-xs font-medium text-purple-800 bg-purple-100 rounded",children:[(0,h.jsx)(i.A,{className:"w-3 h-3 mr-1"}),"AI"]})]}),(0,h.jsx)("p",{className:"text-sm text-[#717182]",children:o.escalationRulesDescription})]}),(0,h.jsxs)("button",{type:"button",onClick:function(){if(0!==g.length){var e={id:"temp-".concat(Date.now()),template:g[0].id,description:"",priority:2,channel:"task",is_active:!0,module_ids:s?[s]:[],isNew:!0};p(function(t){return[].concat((0,F.A)(t),[e])}),j(function(t){return Gt(Gt({},t),{},(0,T.A)({},e.id,!0))}),A(function(t){return Gt(Gt({},t),{},(0,T.A)({},e.id,!0))})}},disabled:0===g.length,className:"hover:bg-green-700 disabled:bg-gray-400 disabled:cursor-not-allowed inline-flex items-center px-4 py-2 text-sm font-medium text-white transition-colors bg-green-600 rounded-lg",children:[(0,h.jsx)(qt.A,{className:"w-4 h-4 mr-2"}),o.addEscalationRule]})]}),(0,h.jsxs)("div",{className:"space-y-4",children:[d.map(function(e){return(0,h.jsxs)("div",{className:"bg-white border rounded-lg",children:[Q(e),W(e)]},e.id)}),0===d.length&&!O&&(0,h.jsxs)("div",{className:"p-8 text-center bg-white border rounded-lg",children:[(0,h.jsx)("p",{className:"text-gray-500",children:o.noEscalationRulesConfigured}),(0,h.jsx)("p",{className:"mt-1 text-sm text-gray-400",children:0===g.length?o.noTemplatesAvailable:o.clickToCreateFirstRule})]})]})]})};const Yt=Vt;Vt.propTypes={escalationRules:g().arrayOf(g().shape({id:g().oneOfType([g().string,g().number]).isRequired}
2)),moduleId:g().string};var Ht=function(e){var t=e.analyticsLoading,r=e.analyticsError,n=e.iframeUrl,a=e.messages,i=e.onRetry;return t?(0,h.jsx)("div",{className:"h-96 flex items-center justify-center bg-white border rounded-lg",children:(0,h.jsx)(s.DotBricksLoading,{})}):r?(0,h.jsxs)("div",{className:"p-8 text-center bg-white border rounded-lg",children:[(0,h.jsx)("p",{className:"mb-4 text-red-500",children:a.errorLoadingAnalytics}),(0,h.jsx)("button",{type:"button",onClick:i,className:"hover:bg-blue-700 px-4 py-2 text-sm font-medium text-white bg-blue-600 rounded-md",children:a.retry})]}):n?(0,h.jsx)("div",{className:"overflow-hidden bg-white border rounded-lg",children:(0,h.jsx)("iframe",{title:"outreach-analytics-dashboard",src:n,sandbox:"allow-scripts allow-same-origin allow-forms allow-popups allow-downloads",className:"min-h-800px w-full h-screen border-0"})}):(0,h.jsx)("div",{className:"p-8 text-center bg-white border rounded-lg",children:(0,h.jsx)("p",{className:"text-gray-500",children:a.selectAnalyticsTab})})};Ht.propTypes={analyticsLoading:g().bool.isRequired,analyticsError:g().bool.isRequired,iframeUrl:g().string.isRequired,messages:g().object.isRequired,onRetry:g().func.isRequired};const Qt=Ht;var Wt=r(16137),$t=function(e){var t=e.isOpen,r=e.onClose,n=e.onConfirm,a=e.messages;return(0,h.jsx)(Wt.lG,{open:t,onOpenChange:r,children:(0,h.jsxs)(Wt.Cf,{className:"sm:max-w-[425px]",children:[(0,h.jsxs)(Wt.c7,{children:[(0,h.jsx)(Wt.L3,{className:"text-lg font-semibold text-gray-900",children:a.deleteTriggerModalTitle}),(0,h.jsx)(Wt.rr,{className:"text-sm text-gray-600",children:a.deleteTriggerModalMessage})]}),(0,h.jsxs)(Wt.Es,{className:"sm:gap-3 flex gap-3",children:[(0,h.jsx)("button",{type:"button",onClick:r,className:"hover:bg-gray-50 focus:outline-none inline-flex items-center px-4 py-2 text-sm font-medium text-gray-700 transition-colors bg-white border border-gray-300 rounded-lg shadow-sm",children:a.cancel}),(0,h.jsx)("button",{type:"button",onClick:function(){n(),r()},className:"hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-red-500 focus:ring-offset-2 inline-flex items-center px-4 py-2 text-sm font-medium text-white transition-colors bg-red-600 border border-transparent rounded-lg shadow-sm",children:a.delete})]})]})})};$t.propTypes={isOpen:g().bool.isRequired,onClose:g().func.isRequired,onConfirm:g().func.isRequired,messages:g().object.isRequired};const Kt=$t;var Xt=function(e){var t=e.messages;return(0,h.jsxs)("div",{className:"flex flex-col items-center justify-center py-16 bg-white border rounded-lg",children:[(0,h.jsx)("div",{className:"flex items-center justify-center w-12 h-12 mb-4 text-gray-400 bg-gray-100 rounded-lg",children:(0,h.jsx)("svg",{className:"w-6 h-6",fill:"none",stroke:"currentColor",viewBox:"0 0 24 24","aria-hidden":"true",children:(0,h.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"})})}),(0,h.jsx)("h3",{className:"mb-2 text-lg font-medium text-gray-900",children:t.noAutomationsYet}),(0,h.jsx)("p",{className:"mb-6 text-center text-gray-500",children:t.createRulesDescription})]})};Xt.propTypes={messages:g().object.isRequired};const Zt=Xt;var Jt=r(15977),er=r(75333),tr=r(72346),rr={TURN_COMPLETED:"post_turno_completed"},nr=function(e){return{EVENT_REQUIRED:e.eventMustBeSelected,COMPLETE_FIELDS:e.completeAllRequiredFields}},ar=function(e){var t,r=e.execution,n=e.messages,a=(0,T.A)({},rr.TURN_COMPLETED,n.whenTurnCompleted);return(0,h.jsx)("div",{className:"bg-gray-50 px-4 py-3 border-t border-gray-200",children:(0,h.jsxs)("div",{className:"grid grid-cols-2 gap-4 text-sm",children:[(0,h.jsxs)("div",{children:[(0,h.jsxs)("span",{className:"font-medium text-gray-700",children:[n.triggerType,":"]}),(0,h.jsx)("span",{className:"ml-2 text-gray-600",children:a[r.trigger.trigger_type]||"-"})]}),(0,h.jsxs)("div",{children:[(0,h.jsxs)("span",{className:"font-medium text-gray-700",children:[n.delayMinutes,":"]}),(0,h.jsxs)("span",{className:"ml-2 text-gray-600",children:[null!==(t=r.delay_minutes)&&void 0!==t?t:0," min"]})]}),r.error_message&&(0,h.jsxs)("div",{className:"col-span-2",children:[(0,h.jsxs)("span",{className:"font-medium text-gray-700",children:[n.errorMessage,"
2:"]}),(0,h.jsx)("span",{className:"ml-2 text-red-600",children:r.error_message})]}),r.executed_at&&(0,h.jsxs)("div",{children:[(0,h.jsxs)("span",{className:"font-medium text-gray-700",children:[n.executedAt,":"]}),(0,h.jsx)("span",{className:"ml-2 text-gray-600",children:(0,tr.default)(new Date(r.executed_at),"PPpp")})]})]})})};ar.propTypes={execution:g().object.isRequired,messages:g().object.isRequired};const sr=ar;var ir=function(e){var t=e.status,r=e.messages,n={scheduled:{className:"bg-blue-100 text-blue-700",label:r.statusScheduled},completed:{className:"bg-green-100 text-green-700",label:r.statusExecuted},failed:{className:"bg-red-100 text-red-700",label:r.statusFailed},cancelled:{className:"bg-gray-100 text-gray-700",label:r.statusCancelled}}[t]||{className:"bg-gray-100 text-gray-600",label:t||"-"};return(0,h.jsx)("span",{className:"px-2 py-1 text-xs font-medium rounded-full ".concat(n.className),children:n.label})};ir.propTypes={status:g().string.isRequired,messages:g().object.isRequired};const or=ir;var lr=function(e){var t=e.execution,r=e.isExpanded,n=e.onToggle,a=e.messages,s=t.created_agent_call,i=s?[s.first_name,s.last_name].filter(Boolean).join(" ")||s.telephone:"";return(0,h.jsxs)(h.Fragment,{children:[(0,h.jsxs)("tr",{className:"hover:bg-gray-50 border-b border-gray-200 cursor-pointer",onClick:n,children:[(0,h.jsx)("td",{className:"px-4 py-3",children:(0,h.jsxs)("div",{className:"flex items-center",children:[r?(0,h.jsx)(Rt.A,{className:"w-4 h-4 mr-2 text-gray-400"}):(0,h.jsx)(kt.A,{className:"w-4 h-4 mr-2 text-gray-400"}),(0,h.jsx)("span",{className:"font-medium text-gray-900",children:i||a.unknownContact})]})}),(0,h.jsx)("td",{className:"px-4 py-3 text-gray-600",children:t.trigger.name||"-"}),(0,h.jsx)("td",{className:"px-4 py-3",children:(0,h.jsx)(or,{status:t.execution_status,messages:a})}),(0,h.jsx)("td",{className:"px-4 py-3 text-gray-600",children:t.scheduled_for?(0,tr.default)(new Date(t.scheduled_for),"PPp"):"-"})]}),r&&(0,h.jsx)("tr",{children:(0,h.jsx)("td",{colSpan:4,className:"p-0",children:(0,h.jsx)(sr,{execution:t,messages:a})})})]})};lr.propTypes={execution:g().object.isRequired,isExpanded:g().bool.isRequired,onToggle:g().func.isRequired,messages:g().object.isRequired};const ur=lr;var cr=function(e){var t=e.executions,r=e.expandedRows,n=e.toggleRow,a=e.messages;return 0===t.length?(0,h.jsx)("tr",{children:(0,h.jsx)("td",{colSpan:4,className:"px-4 py-8 text-center text-gray-500",children:a.noExecutionsFound})}):t.map(function(e){return(0,h.jsx)(ur,{execution:e,isExpanded:r[e.id]||!1,onToggle:function(){return n(e.id)},messages:a},e.id)})};cr.propTypes={executions:g().array.isRequired,expandedRows:g().object.isRequired,toggleRow:g().func.isRequired,messages:g().object.isRequired};const dr=cr;var pr="all";function mr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function fr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?mr(Object(r),!0).forEach(function(t){(0,T.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):mr(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function gr(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,a,s){var l=n&&n.prototype instanceof o?n:o,u=Object.create(l.prototype);return xr(u,"_invoke",function(r,n,a){var s,o,l,u=0,c=a||[],d=!1,p={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,r){return s=t,o=0,l=e,p.n=r,i}};function m(r,n){for(o=r,l=n,t=0;!d&&u&&!a&&t<c.length;t++){var a,s=c[t],m=p.p,f=s[2];r>3?(a=f===n)&&(l=s[(o=s[4])?5:(o=3,3)],s[4]=s[5]=e):s[0]<=m&&((a=r<2&&m<s[1])?(o=0,p.v=n,p.n=s[1]):m<f&&(a=r<3||s[0]>n||n>f)&&(s[4]=r,s[5]=n,p.n=f,o=0))}if(a||r>1)return i;throw d=!0,n}return function(a,c,f){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&m(c,f),o=c,l=f;(t=o<2?e:l)||!d;
2){s||(o?o<3?(o>1&&(p.n=-1),m(o,l)):p.n=l:p.v=l);try{if(u=2,s){if(o||(a="next"),t=s[a]){if(!(t=t.call(s,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,o<2&&(o=0)}else 1===o&&(t=s.return)&&t.call(s),o<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),o=1);s=e}else if((t=(d=p.n<0)?l:r.call(n,p))!==i)break}catch(t){s=e,o=1,l=t}finally{u=1}}return{value:t,done:d}}}(r,a,s),!0),u}var i={};function o(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(xr(t={},n,function(){return this}),t),d=u.prototype=o.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,xr(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,xr(d,"constructor",u),xr(u,"constructor",l),l.displayName="GeneratorFunction",xr(u,a,"GeneratorFunction"),xr(d),xr(d,a,"Generator"),xr(d,n,function(){return this}),xr(d,"toString",function(){return"[object Generator]"}),(gr=function(){return{w:s,m:p}})()}function xr(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}xr=function(e,t,r,n){function s(t,r){xr(e,t,function(e){return this._invoke(t,r,e)})}t?a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(s("next",0),s("throw",1),s("return",2))},xr(e,t,r,n)}var hr=function(e){var t=e.moduleId,r=e.messages,s=(0,a.useState)([]),i=(0,n.A)(s,2),o=i[0],l=i[1],c=(0,a.useState)(!0),m=(0,n.A)(c,2),f=m[0],g=m[1],x=(0,a.useState)(null),b=(0,n.A)(x,2),v=b[0],D=b[1],C=(0,a.useState)({}),N=(0,n.A)(C,2),w=N[0],A=N[1],E=(0,a.useState)(pr),F=(0,n.A)(E,2),S=F[0],_=F[1],O=(0,a.useState)(""),R=(0,n.A)(O,2),k=R[0],B=R[1],P=(0,a.useState)(""),q=(0,n.A)(P,2),L=q[0],M=q[1],I=(0,a.useState)(1),G=(0,n.A)(I,2),U=G[0],z=G[1],V=(0,a.useState)(1),Y=(0,n.A)(V,2),H=Y[0],Q=Y[1],W=(0,a.useCallback)((0,y.A)(gr().m(function e(){var n,a,s,i,o,c,d,p;return gr().w(function(e){for(;;)switch(e.p=e.n){case 0:if(t){e.n=1;break}return e.a(2);case 1:return g(!0),D(null),e.p=2,s={trigger__module:t,page:U,page_size:10},S!==pr&&(s.execution_status=S),k&&(s.scheduled_for_after=k),L&&(s.scheduled_for_before=L),e.n=3,X(s);case 3:i=e.v,o=i.data,c=null!==(n=o.results)&&void 0!==n?n:o,d=null!==(a=o.count)&&void 0!==a?a:c.length,l(c),Q(Math.ceil(d/10)),e.n=5;break;case 4:e.p=4,p=e.v,D(p),u.oR.error(r.errorLoadingExecutions,{className:"bg-white-1.0 p-4 rounded border-l-8 shadow border-red-1.0 w-84",closeButton:!1,bodyClassName:"flex flex-grow",containerId:"notification"});case 5:return e.p=5,g(!1),e.f(5);case 6:return e.a(2)}},e,null,[[2,4,5,6]])})),[t,S,k,L,U,r]);(0,a.useEffect)(function(){W()},[W]);var $=S!==pr||k||L;return(0,h.jsxs)("div",{className:"mt-8 space-y-4",children:[(0,h.jsxs)("div",{className:"flex items-center justify-between",children:[(0,h.jsx)("h3",{className:"text-lg font-semibold text-gray-900",children:r.executionHistory}),(0,h.jsxs)(me.$,{variant:"outline",size:"sm",onClick:W,disabled:f,children:[(0,h.jsx)(Jt.A,{className:"w-4 h-4 mr-2 ".concat(f?"animate-spin":"")}),r.refresh]})]}),(0,h.jsxs)("div",{className:"bg-gray-50 flex flex-wrap items-center gap-4 p-4 rounded-lg",children:[(0,h.jsxs)("div",{className:"flex items-center gap-2",children:[(0,h.jsx)(er.A,{className:"w-4 h-4 text-gray-500"}),(0,h.jsxs)("span",{className:"text-sm font-medium text-gray-700",children:[r.filters,":"]})]}),(0,h.jsx)("div",{className:"flex items-center gap-2",children:(0,h.jsxs)(p.l6,{value:S,onValueChange:function(e){_(e),z(1)},children:[(0,h.jsx)(p.bq,{className:"w-40",children:(0,h.jsx)(p.yv,{placeholder:r.allStatuses})}),(0,h.jsxs)(p.gC,{children:[(0,h.jsx)(p.eb,{value:pr,children:r.allStatuses}),(0,h.jsx)(p.eb,{value:"scheduled",children:r.statusScheduled}),(0,h.jsx)(p.eb,{value:"completed",children:r.statusExecuted}),(0,h.jsx)(p.eb,{value:"failed",children:r.statusFailed}),(0,h.jsx)(p.eb,{value:"cancelled",children:r.statusCancelled})]})]})}),(0,h.jsxs)("div",{className:"flex items-center gap-2",children:[(0,h.jsx)(j.A,{className:"w-4 h-4 text-gray-500"}),(0,h.jsx)(d.p,{type:"date",value:k,onChange:function(e){B(e.target.value),z(1)},className:"w-36",placeholder:r.from}),(0,h.jsx)("span",{className:"text-gray-500",children:"-"}),(0,h.jsx)(d.p,{type:"date",value:L,onChange:function(e){M(e.target.value),z(1)},className:"w-36",placeholder:r.to})]}),$&&(0,h.jsx)(me.$,{variant:"ghost",size:"sm",onClick:function(){_(pr),B(""),M(""),z(1)},children:r.clearFilters})]}),(0,h.jsx)("div",{className:"overflow-hidden bg-white border border-gray-200 rounded-lg",children:(0,h.jsxs)("table",{className:"w-full",children:[(0,h.jsx)("thead",{className:"bg-gray-50",children:(0,h.jsxs)("tr",{children:[(0,h.jsx)("th",{className:"px-4 py-3 text-sm font-medium text-left text-gray-700",children:r.contact}),(0,h.jsx)("th",{className:"px-4 py-3 text-sm font-medium text-left text-gray-700",children:r.triggerName}),(0,h.jsx)("th",{className:"px-4 py-3 text-sm font-medium text-left text-gray-700",children:r.status}),(0,h.jsx)("th",{className:"px-4 py-3 text-sm font-medium text-left text-gray-700",children:r.scheduledAt})]})}),(0,h.jsx)("tbody",{children:f?(0,h.jsx)("tr",{children:(0,h.jsx)("td",{colSpan:4,className:"px-4 py-8 text-center",children:(0,h.jsx)("div",{className:"flex items-center justify-center",children:(0,h.jsx)("div",{className:"border-brand-primary animate-spin border-t-transparent w-6 h-6 border-4 rounded-full"})})})}):v?(0,h.jsx)("tr",{children:(0,h.jsx)("td",{colSpan:4,className:"px-4 py-8 text-center text-red-600",children:r.errorLoadingExecutions})}):(0,h.jsx)(dr,{executions:o,expandedRows:w,toggleRow:function(e){A(function(t){return fr(fr({},t),{},(0,T.A)({},e,!t[e]))})},messages:r})})]})}),H>1&&(0,h.jsxs)("div",{className:"bg-gray-50 flex items-center justify-between px-4 py-3 rounded-lg",children:[(0,h.jsxs)("span",{className:"text-sm text-gray-700",children:[r.page," ",U," ",r.of," ",H]}),(0,h.jsxs)("div",{className:"flex gap-2",children:[(0,h.jsx)(me.$,{variant:"outline",size:"sm",onClick:function(){return z(function(e){return Math.max(1,e-1)})},disabled:1===U||f,children:r.previous}),(0,h.jsx)(me.$,{variant:"outline",size:"sm",onClick:function(){return z(function(e){return Math.min(H,e+1)})},disabled:U===H||f,children:r.next})]})]})]})};
2hr.propTypes={moduleId:g().string.isRequired,messages:g().object.isRequired};const br=hr;var vr=r(11825),yr=r(48852),Dr=function(e){var t=e.value,r=e.onChange,n=e.triggerId,a=e.messages,s=function(e){return{FILA_DIGITAL:[{value:rr.TURN_COMPLETED,label:e.whenTurnCompleted}]}}(a);return(0,h.jsxs)("div",{className:"space-y-2",children:[(0,h.jsxs)("label",{className:"block text-sm font-medium text-gray-700",htmlFor:"event_".concat(n),children:[a.event," ",(0,h.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,h.jsxs)(p.l6,{id:"event_".concat(n),value:t,onValueChange:r,children:[(0,h.jsx)(p.bq,{className:"w-full",children:(0,h.jsx)(p.yv,{placeholder:a.selectEvent})}),(0,h.jsx)(p.gC,{children:(0,h.jsxs)(p.s3,{children:[(0,h.jsx)(p.TR,{className:"text-action-secondary-light-1 pl-4 text-xs font-semibold tracking-wider uppercase",children:a.filaDigitalLabel}),s.FILA_DIGITAL.map(function(e){return(0,h.jsx)(p.eb,{value:e.value,children:e.label},e.value)})]})})]})]})};Dr.propTypes={value:g().string.isRequired,onChange:g().func.isRequired,triggerId:g().string.isRequired,messages:g().object.isRequired};const jr=Dr;var Cr=function(e){var t,r=e.trigger,n=e.onUpdate,a=e.messages,s=function(e){return[{value:0,label:e.immediate},{value:5,label:e.fiveMinutes},{value:30,label:e.thirtyMinutes},{value:60,label:e.oneHour},{value:240,label:e.fourHours},{value:1440,label:e.twentyFourHours}]}(a),i=null!==(t=r.delay_minutes)&&void 0!==t?t:0;return(0,h.jsxs)("div",{className:"space-y-2",children:[(0,h.jsxs)("label",{className:"block text-sm font-medium text-gray-700",htmlFor:"delay_".concat(r.id),children:[a.timeBeforeSendingSurvey," ",(0,h.jsx)("span",{className:"text-red-500",children:"*"})]}),(0,h.jsxs)(p.l6,{value:String(i),onValueChange:function(e){var t=parseInt(e,10);n("delay_minutes",t)},children:[(0,h.jsx)(p.bq,{id:"delay_".concat(r.id),className:"w-full","aria-label":a.selectDelay,children:(0,h.jsx)(p.yv,{placeholder:a.selectDelay})}),(0,h.jsx)(p.gC,{children:s.map(function(e){return(0,h.jsx)(p.eb,{value:String(e.value),children:e.label},e.value)})})]})]})};Cr.propTypes={trigger:g().shape({id:g().string.isRequired,delay_minutes:g().number}).isRequired,onUpdate:g().func.isRequired,messages:g().object.isRequired};const Nr=Cr;var wr=function(e){var t=e.trigger,r=e.onUpdate,n=e.onSave,a=e.messages,s=nr(a),i=function(e,t){var r=nr(t),n=[];return e.event||n.push(r.EVENT_REQUIRED),n}(t,a),o=i.length>0;return(0,h.jsx)(vr.Ke,{children:(0,h.jsxs)("div",{className:"p-4 space-y-4 border-t border-gray-200",children:[o&&(0,h.jsx)("div",{className:"flex items-center justify-between px-4 py-2 text-sm text-white bg-gray-700 rounded-lg",role:"alert","aria-live":"polite",children:(0,h.jsx)("span",{children:s.COMPLETE_FIELDS})}),(0,h.jsxs)("div",{className:"space-y-2",children:[(0,h.jsx)("label",{className:"block text-sm font-medium text-gray-700",htmlFor:"name_".concat(t.id),children:a.triggerName}),(0,h.jsx)(d.p,{id:"name_".concat(t.id),type:"text",value:t.name||"",onChange:function(e){return r("name",e.target.value)},placeholder:a.enterTriggerName,className:"w-full"})]}),(0,h.jsx)(jr,{value:t.event,onChange:function(e){return r("event",e)},triggerId:t.id,messages:a}),(0,h.jsx)(Nr,{trigger:t,onUpdate:r,messages:a}),(0,h.jsxs)("div",{className:"space-y-2",children:[(0,h.jsx)("label",{className:"block text-sm font-medium text-gray-700",htmlFor:"action_".concat(t.id),children:a.action}),(0,h.jsx)("div",{className:"bg-brand-primary-light-5 text-brand-primary border-brand-primary-light-4 p-3 text-sm border rounded-lg",id:"action_".concat(t.id),children:t.action})]}),o&&(0,h.jsx)("div",{className:"bg-red-1.0/10 p-3 space-y-1 border border-red-1.0/20 rounded-lg",role:"alert",children:i.map(function(e){return(0,h.jsx)("p",{className:"text-sm text-red-1.0",children:e},e)})}),(0,h.jsx)("div",{className:"flex justify-end pt-2",children:(0,h.jsxs)("button",{type:"button",onClick:function(){return n(t.id)},className:"hover:bg-action-primary/90 bg-action-primary inline-flex items-center px-4 py-2 text-sm font-medium text-white transition-colors rounded-lg","aria-label":a.save,children:[(0,h.jsx)(yr.A,{className:"w-4 h-4 mr-2"}),a.save]})})]})})};
2wr.propTypes={trigger:g().shape({id:g().string.isRequired,name:g().string,event:g().string.isRequired,action:g().string.isRequired}).isRequired,onUpdate:g().func.isRequired,onSave:g().func.isRequired,messages:g().object.isRequired};const Ar=wr;var Er=r(33632),Fr=r(20),Sr=function(e){var t=e.trigger,r=e.isExpanded,n=e.onToggleEnabled,a=e.onDelete,s=e.index,i=e.messages,o=!1!==t.is_enabled;return(0,h.jsx)(vr.R6,{asChild:!0,children:(0,h.jsxs)("div",{className:"flex items-center justify-between p-4 transition-colors cursor-pointer",children:[(0,h.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,h.jsx)(Er.A,{className:"w-4 h-4 text-gray-400"}),(0,h.jsx)("h3",{className:"text-lg font-medium text-gray-900",children:t.name||"Trigger #".concat(s)}),(0,h.jsx)("span",{className:"text-xs px-2 py-0.5 rounded-full ".concat(o?"bg-green-100 text-green-700":"bg-gray-100 text-gray-500"),children:o?i.enabled:i.disabled})]}),(0,h.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,h.jsx)("div",{className:"flex items-center space-x-2",onClick:function(e){return e.stopPropagation()},onKeyDown:function(e){return e.stopPropagation()},role:"presentation",children:(0,h.jsx)(Fr.d,{checked:o,onCheckedChange:function(e){return n(t.id,e)},"aria-label":o?i.disableTrigger:i.enableTrigger})}),(0,h.jsx)("button",{type:"button",onClick:function(e){e.stopPropagation(),a(t.id)},className:"hover:text-red-1.0 p-1 text-gray-400 transition-colors","aria-label":i.deleteTrigger,children:(0,h.jsx)(Bt.A,{className:"w-4 h-4"})}),r?(0,h.jsx)(Rt.A,{className:"w-5 h-5 text-gray-400"}):(0,h.jsx)(kt.A,{className:"w-5 h-5 text-gray-400"})]})]})})};Sr.propTypes={trigger:g().shape({id:g().string.isRequired,name:g().string,is_enabled:g().bool}).isRequired,isExpanded:g().bool.isRequired,onToggleEnabled:g().func.isRequired,onDelete:g().func.isRequired,index:g().number.isRequired,messages:g().object.isRequired};const Tr=Sr;var _r=function(e){var t=e.trigger,r=e.isExpanded,n=e.onToggleExpanded,a=e.onUpdate,s=e.onToggleEnabled,i=e.onSave,o=e.onDelete,l=e.index,u=e.messages;return(0,h.jsx)(vr.Nt,{open:r,onOpenChange:n,children:(0,h.jsxs)("div",{className:"bg-white border rounded-lg",children:[(0,h.jsx)(Tr,{trigger:t,isExpanded:r,onToggleEnabled:s,onDelete:o,index:l,messages:u}),(0,h.jsx)(Ar,{trigger:t,onUpdate:function(e,r){a(t.id,e,r)},onSave:i,messages:u})]})})};_r.propTypes={trigger:g().shape({id:g().string.isRequired,is_enabled:g().bool}).isRequired,isExpanded:g().bool.isRequired,onToggleExpanded:g().func.isRequired,onUpdate:g().func.isRequired,onToggleEnabled:g().func.isRequired,onSave:g().func.isRequired,onDelete:g().func.isRequired,index:g().number.isRequired,messages:g().object.isRequired};const Or=_r;var Rr=(0,T.A)((0,T.A)({},rr.TURN_COMPLETED,"post_turno_completed"),rr.TURN_NO_SHOW,"post_turno_no_show"),kr={post_turno_completed:rr.TURN_COMPLETED,post_turno_no_show:rr.TURN_NO_SHOW},Br=function(e,t){var r;return{name:e.name,module:t,trigger_type:Rr[e.event]||e.event,is_enabled:!1!==e.is_enabled,delay_minutes:null!==(r=e.delay_minutes)&&void 0!==r?r:0,conditions:{}}},Pr=function(e,t){var r;return{id:e.id||e.uuid,name:e.name||"Trigger #".concat(e.id),event:kr[e.trigger_type]||e.trigger_type,delay_minutes:null!==(r=e.delay_minutes)&&void 0!==r?r:0,action:(null==t?void 0:t.sendSatisfactionSurveyCall)||"Send Satisfaction Survey (Call)",isNew:!1,is_enabled:e.is_enabled}};function qr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Lr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?qr(Object(r),!0).forEach(function(t){(0,T.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):qr(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Mr(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,a,s){var l=n&&n.prototype instanceof o?n:o,u=Object.create(l.prototype);return Ir(u,"_invoke",function(r,n,a){var s,o,l,u=0,c=a||[],d=!1,p={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,r){return s=t,o=0,l=e,p.n=r,i}};function m(r,n){for(o=r,l=n,t=0;!d&&u&&!a&&t<c.length;t++){var a,s=c[t],m=p.p,f=s[2];r>
23?(a=f===n)&&(l=s[(o=s[4])?5:(o=3,3)],s[4]=s[5]=e):s[0]<=m&&((a=r<2&&m<s[1])?(o=0,p.v=n,p.n=s[1]):m<f&&(a=r<3||s[0]>n||n>f)&&(s[4]=r,s[5]=n,p.n=f,o=0))}if(a||r>1)return i;throw d=!0,n}return function(a,c,f){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&m(c,f),o=c,l=f;(t=o<2?e:l)||!d;){s||(o?o<3?(o>1&&(p.n=-1),m(o,l)):p.n=l:p.v=l);try{if(u=2,s){if(o||(a="next"),t=s[a]){if(!(t=t.call(s,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,o<2&&(o=0)}else 1===o&&(t=s.return)&&t.call(s),o<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),o=1);s=e}else if((t=(d=p.n<0)?l:r.call(n,p))!==i)break}catch(t){s=e,o=1,l=t}finally{u=1}}return{value:t,done:d}}}(r,a,s),!0),u}var i={};function o(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(Ir(t={},n,function(){return this}),t),d=u.prototype=o.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Ir(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,Ir(d,"constructor",u),Ir(u,"constructor",l),l.displayName="GeneratorFunction",Ir(u,a,"GeneratorFunction"),Ir(d),Ir(d,a,"Generator"),Ir(d,n,function(){return this}),Ir(d,"toString",function(){return"[object Generator]"}),(Mr=function(){return{w:s,m:p}})()}function Ir(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}Ir=function(e,t,r,n){function s(t,r){Ir(e,t,function(e){return this._invoke(t,r,e)})}t?a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(s("next",0),s("throw",1),s("return",2))},Ir(e,t,r,n)}function Gr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Ur(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Gr(Object(r),!0).forEach(function(t){(0,T.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Gr(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var zr=function(e){var t=e.moduleId,r=e.onSaveTrigger,s=void 0===r?null:r,i=e.messages,o=function(e,t){var r=(0,a.useState)([]),s=(0,n.A)(r,2),i=s[0],o=s[1],l=(0,a.useState)({}),c=(0,n.A)(l,2),d=c[0],p=c[1],m=(0,a.useState)(!0),f=(0,n.A)(m,2),g=f[0],x=f[1],h=(0,a.useState)(null),b=(0,n.A)(h,2),v=b[0],D=b[1],j=(0,a.useCallback)((0,y.A)(Mr().m(function r(){var n,a,s,i;return Mr().w(function(r){for(;;)switch(r.p=r.n){case 0:if(e){r.n=1;break}return r.a(2);case 1:return x(!0),D(null),r.p=2,r.n=3,Q(e);case 3:n=r.v,a=n.data.results||n.data||[],s=a.map(function(e){return Pr(e,t)}),o(s),r.n=5;break;case 4:r.p=4,i=r.v,D(i),u.oR.error(t.errorLoadingTriggers||"Error loading triggers",{className:"bg-white-1.0 p-4 rounded border-l-8 shadow border-red-1.0 w-84",closeButton:!1,bodyClassName:"flex flex-grow",containerId:"notification"});case 5:return r.p=5,x(!1),r.f(5);case 6:return r.a(2)}},r,null,[[2,4,5,6]])})),[e,t]);(0,a.useEffect)(function(){j()},[j]);var C=(0,a.useCallback)(function(){var e=function(e,t){var r=Date.now();return{id:"trigger_".concat(r),name:"".concat(t.triggerName||"Trigger"," #").concat(e),event:"",delay_minutes:0,action:t.sendSatisfactionSurveyCall,is_enabled:!0,isNew:!0}}(i.length+1,t);o(function(t){return[].concat((0,F.A)(t),[e])}),p(function(t){return Lr(Lr({},t),{},(0,T.A)({},e.id,!0))})},[i.length,t]),N=(0,a.useCallback)(function(){var r=(0,y.A)(Mr().m(function r(n){var a,s,i,l,c,d,p;return Mr().w(function(r){for(;;)switch(r.p=r.n){case 0:if(e){r.n=1;break}return r.a(2,!1);case 1:if(r.p=1,a=Br(n,e),!n.isNew){r.n=3;break}return r.n=2,W(a);case 2:s=r.v,i=Pr(s.data,t),o(function(e){return e.map(function(e){return e.id===n.id?i:e})}),u.oR.success(t.triggerCreated||"Trigger created successfully",{className:"bg-white-1.0 p-4 rounded border-l-8 shadow border-green-1.0 w-84",closeButton:!1,bodyClassName:"flex flex-grow",containerId:"notification"}),r.n=5;break;case 3:return r.n=4,$(n.id,a);case 4:u.oR.success(t.triggerUpdated||"Trigger updated successfully",{className:"bg-white-1.0 p-4 rounded border-l-8 shadow border-green-1.0 w-84",closeButton:!1,bodyClassName:"flex flex-grow",containerId:"notification"});case 5:return r.a(2,!0);case 6:return r.p=6,p=r.v,c=null===(l=p.response)||void 0===l||null===(l=l.data)||void 0===l||null===(l=l.non_field_errors)||void 0===l?void 0:l.some(function(e){return e.toLowerCase().includes("already exists")}),d=c?t.duplicateTriggerError||"A trigger for this event already exists":t.errorSavingTrigger||"Error saving trigger",u.oR.error(d,{className:"bg-white-1.0 p-4 rounded border-l-8 shadow border-red-1.0 w-84",closeButton:!1,bodyClassName:"flex flex-grow",containerId:"notification"}),r.a(2,!1)}},r,null,[[1,6]])}));return function(e){return r.apply(this,arguments)}}(),[e,t]),w=(0,a.useCallback)(function(){var e=(0,y.A)(Mr().m(function e(r){var n;return Mr().w(function(e){for(;;)switch(e.p=e.n){case 0:if(n=i.find(function(e){return e.id===r}),o(function(e){return e.filter(function(e){return e.id!==r})}),p(function(e){var t=Lr({},e);return delete t[r],t}),!n||n.isNew){e.n=4;break}return e.p=1,e.n=2,K(r);case 2:u.oR.success(t.triggerDeleted||"Trigger deleted successfully",{className:"bg-white-1.0 p-4 rounded border-l-8 shadow border-green-1.0 w-84",closeButton:!1,bodyClassName:"flex flex-grow",containerId:"notification"}),e.n=4;break;case 3:e.p=3,e.v,o(function(e){return[].concat((0,F.A)(e),[n])}),u.oR.error(t.errorDeletingTrigger||"Error deleting trigger",{className:"bg-white-1.0 p-4 rounded border-l-8 shadow border-red-1.0 w-84",closeButton:!1,bodyClassName:"flex flex-grow",containerId:"notification"});case 4:return e.a(2)}},e,null,[[1,3]])}
2));return function(t){return e.apply(this,arguments)}}(),[i,t]),A=(0,a.useCallback)(function(e,t,r){o(function(n){return n.map(function(n){return n.id===e?Lr(Lr({},n),{},(0,T.A)({},t,r)):n})})},[]),E=(0,a.useCallback)(function(e){p(function(t){return Lr(Lr({},t),{},(0,T.A)({},e,!t[e]))})},[]);return{triggers:i,expandedTriggers:d,isLoading:g,error:v,addTrigger:C,deleteTrigger:w,updateTrigger:A,toggleExpanded:E,saveTrigger:N}}(t,i),l=o.triggers,c=o.expandedTriggers,d=o.isLoading,p=o.addTrigger,m=o.deleteTrigger,f=o.updateTrigger,g=o.toggleExpanded,x=o.saveTrigger,b=(0,a.useState)(!1),v=(0,n.A)(b,2),D=v[0],j=v[1],C=(0,a.useState)(null),N=(0,n.A)(C,2),w=N[0],A=N[1],E=function(e){A(e),j(!0)},S=function(e,t,r){f(e,t,r)},_=function(e,t){f(e,"is_enabled",t);var r=l.find(function(t){return t.id===e});r&&!r.isNew&&x(Ur(Ur({},r),{},{is_enabled:t}))},O=function(e){var t=l.find(function(t){return t.id===e});t&&(x(t),s&&s(t))};return(0,h.jsxs)("div",{className:"space-y-6",children:[(0,h.jsxs)("header",{className:"flex items-center justify-between",children:[(0,h.jsxs)("div",{children:[(0,h.jsx)("h2",{className:"text-xl font-semibold text-gray-900",children:i.automationsTitle}),(0,h.jsx)("p",{className:"mt-1 text-sm text-gray-600",children:i.automationsDescription})]}),(0,h.jsxs)("button",{type:"button",onClick:p,className:"hover:bg-action-primary/90 bg-action-primary inline-flex items-center px-4 py-2 text-sm font-medium text-white transition-colors rounded-lg","aria-label":i.addTrigger,children:[(0,h.jsx)(qt.A,{className:"w-4 h-4 mr-2","aria-hidden":"true"}),i.addTrigger]})]}),(0,h.jsx)("main",{className:"space-y-4",children:d?(0,h.jsx)("div",{className:"flex items-center justify-center p-8",children:(0,h.jsx)("div",{className:"border-brand-primary animate-spin border-t-transparent w-8 h-8 border-4 rounded-full"})}):0===l.length?(0,h.jsx)(Zt,{messages:i}):l.map(function(e,t){return(0,h.jsx)(Or,{trigger:e,isExpanded:c[e.id]||!1,onToggleExpanded:function(){return t=e.id,void g(t);var t},onUpdate:S,onToggleEnabled:_,onSave:O,onDelete:E,index:t+1,messages:i},e.id)})}),(0,h.jsx)(Kt,{isOpen:D,onClose:function(){j(!1),A(null)},onConfirm:function(){w&&(m(w),A(null))},messages:i}),(0,h.jsx)(br,{moduleId:t,messages:i})]})};
2zr.propTypes={moduleId:g().string.isRequired,onSaveTrigger:g().func,messages:g().object.isRequired};var Vr=r(89608),Yr=r(66782),Hr=r(86749),Qr=r(97665),Wr=r(97286),$r=r(57097);function Kr(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function Xr(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?Kr(Object(r),!0).forEach(function(t){(0,T.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):Kr(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}function Zr(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,a,s){var l=n&&n.prototype instanceof o?n:o,u=Object.create(l.prototype);return Jr(u,"_invoke",function(r,n,a){var s,o,l,u=0,c=a||[],d=!1,p={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,r){return s=t,o=0,l=e,p.n=r,i}};function m(r,n){for(o=r,l=n,t=0;!d&&u&&!a&&t<c.length;t++){var a,s=c[t],m=p.p,f=s[2];r>3?(a=f===n)&&(l=s[(o=s[4])?5:(o=3,3)],s[4]=s[5]=e):s[0]<=m&&((a=r<2&&m<s[1])?(o=0,p.v=n,p.n=s[1]):m<f&&(a=r<3||s[0]>n||n>f)&&(s[4]=r,s[5]=n,p.n=f,o=0))}if(a||r>1)return i;throw d=!0,n}return function(a,c,f){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&m(c,f),o=c,l=f;(t=o<2?e:l)||!d;){s||(o?o<3?(o>1&&(p.n=-1),m(o,l)):p.n=l:p.v=l);try{if(u=2,s){if(o||(a="next"),t=s[a]){if(!(t=t.call(s,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,o<2&&(o=0)}else 1===o&&(t=s.return)&&t.call(s),o<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),o=1);s=e}else if((t=(d=p.n<0)?l:r.call(n,p))!==i)break}catch(t){s=e,o=1,l=t}finally{u=1}}return{value:t,done:d}}}(r,a,s),!0),u}var i={};function o(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(Jr(t={},n,function(){return this}),t),d=u.prototype=o.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,Jr(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,Jr(d,"constructor",u),Jr(u,"constructor",l),l.displayName="GeneratorFunction",Jr(u,a,"GeneratorFunction"),Jr(d),Jr(d,a,"Generator"),Jr(d,n,function(){return this}),Jr(d,"toString",function(){return"[object Generator]"}),(Zr=function(){return{w:s,m:p}})()}function Jr(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}Jr=function(e,t,r,n){function s(t,r){Jr(e,t,function(e){return this._invoke(t,r,e)})}t?a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(s("next",0),s("throw",1),s("return",2))},Jr(e,t,r,n)}var en=function(e){var t,r=null==e||null===(t=e.response)||void 0===t?void 0:t.data;if(!r)return(null==e?void 0:e.message)||"An unexpected error occurred";if(r.detail)return r.detail;var a=[],s={field_name:"Field name",field_type:"Field type",extraction_prompt:"Extraction prompt",choices:"Choices",is_required:"Required",question:"Question",field_ids:"Field IDs",non_field_errors:""};return Object.entries(r).forEach(function(e){var t=(0,n.A)(e,2),r=t[0],i=t[1];if(Array.isArray(i)){var o=r in s?s[r]:r;
2i.forEach(function(e){o?a.push("".concat(o,": ").concat(e)):a.push(e)})}}),a.length>0?a.join("\n"):"An unexpected error occurred"};function tn(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,a,s){var l=n&&n.prototype instanceof o?n:o,u=Object.create(l.prototype);return rn(u,"_invoke",function(r,n,a){var s,o,l,u=0,c=a||[],d=!1,p={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,r){return s=t,o=0,l=e,p.n=r,i}};function m(r,n){for(o=r,l=n,t=0;!d&&u&&!a&&t<c.length;t++){var a,s=c[t],m=p.p,f=s[2];r>3?(a=f===n)&&(l=s[(o=s[4])?5:(o=3,3)],s[4]=s[5]=e):s[0]<=m&&((a=r<2&&m<s[1])?(o=0,p.v=n,p.n=s[1]):m<f&&(a=r<3||s[0]>n||n>f)&&(s[4]=r,s[5]=n,p.n=f,o=0))}if(a||r>1)return i;throw d=!0,n}return function(a,c,f){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&m(c,f),o=c,l=f;(t=o<2?e:l)||!d;){s||(o?o<3?(o>1&&(p.n=-1),m(o,l)):p.n=l:p.v=l);try{if(u=2,s){if(o||(a="next"),t=s[a]){if(!(t=t.call(s,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,o<2&&(o=0)}else 1===o&&(t=s.return)&&t.call(s),o<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),o=1);s=e}else if((t=(d=p.n<0)?l:r.call(n,p))!==i)break}catch(t){s=e,o=1,l=t}finally{u=1}}return{value:t,done:d}}}(r,a,s),!0),u}var i={};function o(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(rn(t={},n,function(){return this}),t),d=u.prototype=o.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,rn(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,rn(d,"constructor",u),rn(u,"constructor",l),l.displayName="GeneratorFunction",rn(u,a,"GeneratorFunction"),rn(d),rn(d,a,"Generator"),rn(d,n,function(){return this}),rn(d,"toString",function(){return"[object Generator]"}),(tn=function(){return{w:s,m:p}})()}function rn(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}rn=function(e,t,r,n){function s(t,r){rn(e,t,function(e){return this._invoke(t,r,e)})}t?a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(s("next",0),s("throw",1),s("return",2))},rn(e,t,r,n)}var nn=function(e){var t,r=null==e||null===(t=e.response)||void 0===t?void 0:t.data;return r?r.detail?r.detail:"An unexpected error occurred":(null==e?void 0:e.message)||"An unexpected error occurred"},an=r(48697),sn=r(37946),on=r(50180);const ln=(0,N.A)("lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]]);var un=r(73977);const cn=(0,N.A)("square-check-big",[["path",{d:"M21 10.656V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h12.344",key:"2acyp4"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]]),dn=(0,N.A)("type",[["path",{d:"M12 4v16",key:"1654pz"}],["path",{d:"M4 7V5a1 1 0 0 1 1-1h14a1 1 0 0 1 1 1v2",key:"e0r10z"}],["path",{d:"M9 20h6",key:"s66wpe"}]]),pn=(0,N.A)("list",[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]]);var mn=r(40073),fn="FIELD_ROW",gn={fieldName:{maxLength:100,pattern:/^(?:[\t-\r 0-9A-Za-z\xA0\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088E\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u
20C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5D\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2000-\u200A\u2028\u2029\u202F\u205F\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3000\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7CD\uA7D0\uA7D1\uA7D3\uA7D5-\uA7DC\uA7F2-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFEFF\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDD70-\uDD7A\uDD7C-\uDD8A\uDD8C-\uDD92\uDD94\uDD95\uDD97-\uDDA1\uDDA3-\uDDB1\uDDB3-\uDDB9\uDDBB\uDDBC\uDDC0-\uDDF3\uDE00-\uDF36\uDF40-\uDF55\uD
2F60-\uDF67\uDF80-\uDF85\uDF87-\uDFB0\uDFB2-\uDFBA]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDD40-\uDD65\uDD6F-\uDD85\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDEC2-\uDEC4\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDF70-\uDF81\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC71\uDC72\uDC75\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE3F\uDE40\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61\uDF80-\uDF89\uDF8B\uDF8E\uDF90-\uDFB5\uDFB7\uDFD1\uDFD3]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDED0-\uDEE3\uDF00-\uDF1A\uDF30-\uDF3B\uDF40-\uDF46]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEB0-\uDEF8\uDFC0-\uDFE0\uDFF0-\uDFF9]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDF02\uDF04-\uDF10\uDF12-\uDF33\uDF50-\uDF59\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|\uD80B[\uDF90-\uDFF0]|[\uD80C\uD80E\uD80F\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883\uD885-\uD887][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2F\uDC41-\uDC46\uDC60-\uDFFF]|\uD810[\uDC00-\uDFFA]|\uD811[\uDC00-\uDE46]|\uD818[\uDD00-\uDD1D\uDD30-\uDD39]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDE70-\uDEBE\uDEC0-\uDEC9\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDD40-\uDD6C\uDD70-\uDD79\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDCFF-\uDD08]|\uD82B[\uDFF0-\uDFF3\uDFF5-\uDFFB\uDFFD\uDFFE]|\uD82C[\uDC00-\uDD22\uDD32\uDD50-\uDD52\uDD55\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD833[\uDCF0-\uDCF9]|\uD834[\uDEC0-\uDED3\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD837[\uDF00-\uDF1E\uDF25-\uDF2A]|\uD838[\uDC30-\uDC6D\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDE90-\uDEAD\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD839[\uDCD0-\uDCEB\uDCF0-\uDCF9\uDDD0-\uDDED\uDDF0-\uDDFA\uDFE0-\uDFE6\uDFE8-\uDFEB\uDFED\uDFEE\uDFF0-\uDFFE]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDF\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF39\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0\uDFF0-\uDFFF]|\uD87B[\uDC00-\uDE5D]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A\uDF50-\uDFFF]|\uD888[\uDC00-\uDFAF])+$/},prompt:{minLength:10,maxLength:1e3},choices:{minCount:2,maxCount:20,maxLength:50}};function xn(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function hn(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
2t%2?xn(Object(r),!0).forEach(function(t){(0,T.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):xn(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var bn=function(e){var t,r,s,i,o,l,u,c,m,f=e.onSave,g=e.onCancel,b=e.editField,v=void 0===b?null:b,y=e.existingFieldNames,D=void 0===y?[]:y,j=e.isSaving,C=void 0!==j&&j,N=e.saveError,w=void 0===N?null:N,A=e.messages,E=function(e){return{boolean:{icon:cn,label:e.fieldTypeBooleanLabel,description:e.fieldTypeBooleanDescription},string:{icon:dn,label:e.fieldTypeStringLabel,description:e.fieldTypeStringDescription},"single-choice":{icon:pn,label:e.fieldTypeSingleChoiceLabel,description:e.fieldTypeSingleChoiceDescription},number:{icon:mn.A,label:e.fieldTypeNumberLabel,description:e.fieldTypeNumberDescription}}}(A),S=function(e){return{boolean:{good:[e.booleanGoodExample1,e.booleanGoodExample2],bad:[e.booleanBadExample1,e.booleanBadExample2],tips:[e.booleanTip1,e.booleanTip2,e.booleanTip3]},string:{good:[e.stringGoodExample1,e.stringGoodExample2],bad:[e.stringBadExample1,e.stringBadExample2],tips:[e.stringTip1,e.stringTip2,e.stringTip3]},"single-choice":{good:[e.singleChoiceGoodExample1,e.singleChoiceGoodExample2],bad:[e.singleChoiceBadExample1,e.singleChoiceBadExample2],tips:[e.singleChoiceTip1,e.singleChoiceTip2,e.singleChoiceTip3,e.singleChoiceTip4]},number:{good:[e.numberGoodExample1,e.numberGoodExample2],bad:[e.numberBadExample1,e.numberBadExample2],tips:[e.numberTip1,e.numberTip2,e.numberTip3]}}}(A),T=function(e){return{boolean:e.promptTemplateBoolean,string:e.promptTemplateString,"single-choice":e.promptTemplateSingleChoice,number:e.promptTemplateNumber}}(A),_=(0,a.useState)(""),O=(0,n.A)(_,2),R=O[0],k=O[1],B=(0,a.useState)(""),P=(0,n.A)(B,2),q=P[0],L=P[1],M=(0,a.useState)("boolean"),I=(0,n.A)(M,2),G=I[0],U=I[1],z=(0,a.useState)(""),V=(0,n.A)(z,2),Y=V[0],H=V[1],Q=(0,a.useState)(["",""]),W=(0,n.A)(Q,2),$=W[0],K=W[1],X=(0,a.useState)(!1),Z=(0,n.A)(X,2),J=Z[0],ee=Z[1],te=(0,a.useState)(!1),re=(0,n.A)(te,2),ne=re[0],ae=re[1],se=(0,a.useState)(!1),ie=(0,n.A)(se,2),oe=ie[0],le=ie[1],ue=(0,a.useState)([]),ce=(0,n.A)(ue,2),de=ce[0],pe=ce[1],me=(0,a.useState)({name:!1,question:!1,prompt:!1,choices:!1}),fe=(0,n.A)(me,2),ge=fe[0],xe=fe[1],he=(0,a.useState)(!1),be=(0,n.A)(he,2),ve=be[0],ye=be[1],De=(0,a.useState)("default"),je=(0,n.A)(De,2),Ce=je[0],Ne=je[1],we=function(e){return e.trim()?e.length>100?{field:"name",message:null==A?void 0:A.fieldNameMaxLength,type:"error"}:gn.fieldName.pattern.test(e)?!D.includes(e)||v&&v.name===e?null:{field:"name",message:null==A?void 0:A.fieldNameExists,type:"error"}:{field:"name",message:null==A?void 0:A.fieldNameInvalidChars,type:"error"}:{field:"name",message:null==A?void 0:A.fieldNameRequired,type:"error"}},Ae=function(e){return e.trim()?e.length>100?{field:"question",message:null==A?void 0:A.fieldQuestionMaxLength,type:"error"}:null:{field:"question",message:null==A?void 0:A.fieldQuestionRequired,type:"error"}},Ee=function(e){return e.trim()?e.length<10?{field:"prompt",message:null==A?void 0:A.promptTooShort,type:"warning"}:e.length>1e3?{field:"prompt",message:null==A?void 0:A.promptTooLong,type:"error"}:null:{field:"prompt",message:null==A?void 0:A.promptRequired,type:"error"}},Fe=function(){if("single-choice"!==G)return null;var e=$.filter(function(e){return""!==e.trim()});return e.length<2?{field:"choices",message:null==A?void 0:A.choicesMinRequired,type:"error"}:e.length>20?{field:"choices",message:null==A?void 0:A.choicesMaxAllowed,type:"error"}:e.length!==new Set(e).size?{field:"choices",message:null==A?void 0:A.choicesDuplicate,type:"error"}:e.some(function(e){return e.length>50})?{field:"choices",message:null==A?void 0:A.choiceMaxLength,type:"error"}:null};(0,a.useEffect)(function(){v?(k(v.name),L(v.question||""),U(v.type),H(v.prompt),K(v.choices||["",""]),ee(v.required)):(k(""),L(""),U("boolean"),H(T.boolean),K(["",""]),ee(!1)),pe([]),xe({name:!1,question:!1,prompt:!1,choices:!1}),ye(!1)},[v]),(0,a.useEffect)(function(){v||H(T[G])},[G,v]),(0,a.useEffect)(function(){var e=[];
2if(ge.name||ve){var t=we(R);t&&e.push(t)}if(ge.question||ve){var r=Ae(q);r&&e.push(r)}if(ge.prompt||ve){var n=Ee(Y);n&&e.push(n)}if((ge.choices||ve)&&"single-choice"===G){var a=Fe();a&&e.push(a)}pe(e)},[R,q,Y,$,G,ge,ve]);var Se,Te=function(e){return de.find(function(t){return t.field===e})},_e=de.some(function(e){return"error"===e.type}),Oe=S[G],Re=function(e){var t=Te(e);return"error"===(null==t?void 0:t.type)?"border-[2px] border-[#ef4444]":"warning"===(null==t?void 0:t.type)?"border border-[#f59e0b]":"border-[#bdc0c7]"};return(0,h.jsx)(x.Zp,{className:"border border-[#dddee2] bg-white shadow-sm",children:(0,h.jsxs)(x.Wu,{className:"p-6 space-y-[14px]",children:[(0,h.jsxs)("div",{className:"flex items-center justify-between h-[32px]",children:[(0,h.jsxs)("div",{className:"flex items-center gap-2",children:[(0,h.jsx)(Nt.A,{className:"h-5 w-5 text-[#717182]",strokeWidth:1.5}),(0,h.jsx)("h3",{className:"font-['Montserrat'] text-[18px] font-bold text-[#25282d] leading-[24px]",children:v?"".concat(null==A?void 0:A.editFieldTitle,": ").concat(v.name):null==A?void 0:A.newDataField})]}),(0,h.jsxs)("div",{className:"flex items-center gap-2",children:[(0,h.jsxs)(un.m_,{children:[(0,h.jsx)(un.k$,{asChild:!0,children:(0,h.jsx)("button",{type:"button",onClick:g,disabled:C,className:"hover:bg-gray-100 disabled:opacity-50 flex items-center justify-center w-8 h-8 transition-colors rounded-lg",children:(0,h.jsx)(an.A,{className:"h-3 w-3 text-[#545964]"})})}),(0,h.jsx)(un.ZI,{side:"top",className:"bg-[#25282d] text-white",children:(0,h.jsx)("p",{children:null==A?void 0:A.cancel})})]}),C?(0,h.jsx)("button",{type:"button",className:"h-8 w-8 flex items-center justify-center rounded-lg bg-[#10B06C] opacity-70",children:(0,h.jsx)(Ve.A,{className:"animate-spin w-4 h-4 text-white"})}):_e?(0,h.jsxs)(un.m_,{children:[(0,h.jsx)(un.k$,{asChild:!0,children:(0,h.jsx)("button",{type:"button",className:"hover:bg-gray-100 flex items-center justify-center w-8 h-8 transition-colors rounded-lg opacity-50 cursor-not-allowed",children:(0,h.jsx)(Pt.A,{className:"h-3 w-3 text-[#10B06C]"})})}),(0,h.jsx)(un.ZI,{side:"top",className:"bg-[#25282d] text-white",children:(0,h.jsx)("p",{children:null==A?void 0:A.completeRequiredFields})})]}):(0,h.jsxs)(un.m_,{children:[(0,h.jsx)(un.k$,{asChild:!0,children:(0,h.jsx)("button",{type:"button",onClick:function(){ye(!0);var e=we(R),t=Ae(q),r=Ee(Y),n=Fe();if(!(e||t||r||n)){var a={id:null==v?void 0:v.id,name:R,question:q,type:G,prompt:Y,choices:"single-choice"===G?$.filter(function(e){return""!==e.trim()}):void 0,required:J};f(a)}},className:"h-8 w-8 flex items-center justify-center rounded-lg bg-[#10B06C] hover:bg-[#0e9d5f] transition-all hover:scale-105 active:scale-95",children:(0,h.jsx)(Pt.A,{className:"w-4 h-4 text-white"})})}),(0,h.jsx)(un.ZI,{side:"top",className:"bg-[#25282d] text-white",children:(0,h.jsx)("p",{children:null==A?void 0:A.clickToSaveField})})]}),(0,h.jsx)("button",{type:"button",onClick:function(){return le(!oe)},className:"hover:bg-gray-100 flex items-center justify-center w-8 h-8 transition-colors rounded-lg",children:(0,h.jsx)(Rt.A,{className:"h-4 w-4 text-[#717182] transition-transform ".concat(oe?"rotate-180":""),strokeWidth:1.33})})]})]}),!oe&&(0,h.jsxs)(h.Fragment,{children:[w&&(0,h.jsxs)("div",{className:"bg-[#fee2e2] border border-[#ef4444] rounded-[6px] p-3 flex items-start gap-2",children:[(0,h.jsx)(sn.A,{className:"h-[18px] w-[18px] text-[#ef4444] flex-shrink-0 mt-0.5"}),(0,h.jsxs)("div",{children:[(0,h.jsx)("p",{className:"font-['Open_Sans'] text-[14px] font-bold text-[#ef4444]",children:null==A?void 0:A.error}),(0,h.jsx)("p",{className:"font-['Open_Sans'] text-[13px] text-[#991b1b] leading-[1.5]",children:w})]})]}),(0,h.jsxs)("div",{className:"flex gap-6",children:[(0,h.jsxs)("div",{className:"flex-1 space-y-[18px]",children:[(0,h.jsxs)("div",{className:"space-y-2",children:[(0,h.jsxs)("span",{className:"font-['Inter'] text-[14px] font-medium text-[#3d4148]",children:[null==A?void 0:A.fieldNameLabel," ",(0,h.jsx)("span",{className:"text-[#e7000b]",children:"*"})]}),(0,h.jsxs)("div",{className:"relative",children:[(0,h.jsx)(d.p,{value:R,onChange:function(e){return k(e.target.value)},onBlur:function(){return xe(function(e){return hn(hn({},e),{},{name:!0})})},placeholder:null==A?void 0:A.fieldNamePlaceholder,className:"bg-white h-9 pr-10 transition-all ".concat(Re("name")),maxLength:100}),Te("name")&&(0,h.jsx)(on.A,{className:"absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-[#ef4444]"})]}),Te("name")&&(0,h.jsxs)("div",{className:"flex items-start gap-2 px-3 py-2 rounded border-l-[3px] bg-[#fee2e2] border-l-[#ef4444]",children:[(0,h.jsx)(sn.A,{className:"h-4 w-4 flex-shrink-0 mt-0.5 text-[#ef4444]"}),(0,h.jsx)("p",{className:"text-[12px] font-['Open_Sans'] font-medium text-[#ef4444]",children:null===(t=Te("name"))||void 0===t?void 0:t.message})]}),(0,h.jsxs)("p",{className:"text-[12px] text-[#717182]",children:[R.length,"/100 ",null==A?void 0:A.characters]})]}),(0,h.jsxs)("div",{className:"space-y-2",children:[(0,h.jsxs)("span",{className:"font-['Inter'] text-[14px] font-medium text-[#3d4148]",children:[null==A?void 0:A.fieldQuestionLabel," ",(0,h.jsx)("span",{className:"text-[#e7000b]",children:"*"})]}),(0,h.jsxs)("div",{className:"relative",children:[(0,h.jsx)(d.p,{value:q,onChange:function(e){return L(e.target.value)},onBlur:function(){return xe(function(e){return hn(hn({},e),{},{question:!0}
2)})},placeholder:null==A?void 0:A.fieldQuestionPlaceholder,className:"bg-white h-9 pr-10 transition-all ".concat(Re("question")),maxLength:100}),Te("question")&&(0,h.jsx)(on.A,{className:"absolute right-3 top-1/2 -translate-y-1/2 h-4 w-4 text-[#ef4444]"})]}),Te("question")&&(0,h.jsxs)("div",{className:"flex items-start gap-2 px-3 py-2 rounded border-l-[3px] bg-[#fee2e2] border-l-[#ef4444]",children:[(0,h.jsx)(sn.A,{className:"h-4 w-4 flex-shrink-0 mt-0.5 text-[#ef4444]"}),(0,h.jsx)("p",{className:"text-[12px] font-['Open_Sans'] font-medium text-[#ef4444]",children:null===(r=Te("question"))||void 0===r?void 0:r.message})]}),(0,h.jsxs)("p",{className:"text-[12px] text-[#717182]",children:[q.length,"/100 ",null==A?void 0:A.characters]})]}),(0,h.jsxs)("div",{className:"space-y-2",children:[(0,h.jsxs)("span",{className:"font-['Inter'] text-[14px] font-medium text-[#3d4148]",children:[null==A?void 0:A.fieldTypeLabel," ",(0,h.jsx)("span",{className:"text-[#e7000b]",children:"*"})]}),(0,h.jsx)("div",{className:"grid grid-cols-2 gap-3",children:Object.keys(E).map(function(e){var t=E[e],r=t.icon,n=G===e;return(0,h.jsxs)("div",{onClick:function(){return U(e)},onKeyDown:function(t){"Enter"!==t.key&&" "!==t.key||U(e)},role:"button",tabIndex:0,className:"border-2 rounded-lg p-3 cursor-pointer transition-all hover:scale-102 active:scale-98 ".concat(n?"border-[#3d5d98] bg-[rgba(61,93,152,0.05)]":"border-[#bdc0c7] bg-white hover:border-[#3d5d98] hover:bg-[rgba(61,93,152,0.02)]"),children:[(0,h.jsxs)("div",{className:"flex items-center gap-2 mb-1",children:[(0,h.jsx)("div",{className:"w-4 h-4 rounded-full border-2 flex items-center justify-center ".concat(n?"border-[#3d5d98]":"border-[#bdc0c7]"),children:n&&(0,h.jsx)("div",{className:"w-2 h-2 rounded-full bg-[#3d5d98]"})}),(0,h.jsx)(r,{className:"h-[16px] w-[16px] text-[#3d5d98]"}),(0,h.jsx)("span",{className:"font-['Inter'] text-[13px] font-medium text-[#3D4148]",children:t.label})]}),(0,h.jsx)("p",{className:"text-[11px] text-[#717182] ml-6",children:t.description})]},e)})})]}),(0,h.jsx)("div",{className:"bg-[#f9fafb] border border-[#e5e7eb] rounded-[10px] p-3",children:(0,h.jsxs)("div",{className:"space-y-[18px]",children:[(0,h.jsxs)("div",{className:"flex flex-col gap-[2px]",children:[(0,h.jsxs)("div",{className:"flex items-center gap-1",children:[(0,h.jsx)("span",{className:"font-['Inter'] text-[14px] font-medium text-[#3d4148]",children:null==A?void 0:A.extractionPromptLabel}),(0,h.jsx)("span",{className:"text-[14px] font-medium text-[#e7000b]",children:"*"})]}),(0,h.jsx)("p",{className:"font-['Inter'] text-[11px] text-[#717182] leading-[16.5px]",children:null==A?void 0:A.extractionPromptDescription})]}),(0,h.jsxs)(p.l6,{value:Ce,onValueChange:function(e){H("custom"===e?"":T[G]),Ne(e)},children:[(0,h.jsx)(p.bq,{className:"bg-white border-[#bdc0c7] h-[50px] px-[13px]",children:(0,h.jsx)(p.yv,{placeholder:null==A?void 0:A.useDefaultTemplate})}),(0,h.jsxs)(p.gC,{className:"bg-white",children:[(0,h.jsx)(p.eb,{value:"default",className:"!py-1",children:(0,h.jsxs)("div",{className:"flex flex-col items-start",children:[(0,h.jsx)("span",{className:"font-['Inter'] text-[14px] font-medium text-[#0a0a0a] tracking-[-0.1504px]",children:null==A?void 0:A.useDefaultTemplate}),(0,h.jsx)("span",{className:"font-['Inter'] text-[11px] text-[#717182] tracking-[0.0645px]",children:null==A||null===(s=A.fillPromptWithTemplate)||void 0===s?void 0:s.replace("{type}",E[G].label)})]})}),(0,h.jsx)(p.eb,{value:"custom",className:"!py-1",children:(0,h.jsxs)("div",{className:"flex flex-col items-start",children:[(0,h.jsx)("span",{className:"font-['Inter'] text-[14px] font-medium text-[#0a0a0a] tracking-[-0.1504px]",children:null==A?void 0:A.startFromScratch}),(0,h.jsx)("span",{className:"font-['Inter'] text-[11px] text-[#717182] tracking-[0.0645px]",children:null==A?void 0:A.clearPromptAndWrite})]})})]})]}),(0,h.jsx)(Et.T,{value:Y,onChange:function(e){return H(e.target.value)},onBlur:function(){return xe(function(e){return hn(hn({},e),{},{prompt:!0})})},placeholder:null==A?void 0:A.promptPlaceholder,className:"bg-white min-h-[100px] resize-y transition-all font-['Inter'] text-[14px] font-medium tracking-[-0.1504px] ".concat(Re("prompt")),maxLength:1e3}),Te("prompt")&&(0,h.jsxs)("div",{className:"flex items-start gap-2 px-3 py-2 rounded border-l-[3px] ".concat("error"===(null===(i=Te("prompt"))||void 0===i?void 0:i.type)?"bg-[#fee2e2] border-l-[#ef4444]":"bg-[#fef3c7] border-l-[#f59e0b]"),children:[(0,h.jsx)(sn.A,{className:"h-4 w-4 flex-shrink-0 mt-0.5 ".concat("error"===(null===(o=Te("prompt"))||void 0===o?void 0:o.type)?"text-[#ef4444]":"text-[#f59e0b]")}),(0,h.jsx)("p",{className:"text-[12px] font-['Open_Sans'] font-medium ".concat("error"===(null===(l=Te("prompt"))||void 0===l?void 0:l.type)?"text-[#ef4444]":"text-[#f59e0b]"),children:null===(u=Te("prompt"))||void 0===u?void 0:u.message})]}),(0,h.jsxs)("p",{className:"text-[12px] text-right ".concat((Se=Y.length,Se>1e3?"text-[#e7000b]":Se<10?"text-[#f59e0b]":"text-[#717182]")),children:[Y.length,"/1000 ",null==A?void 0:A.characters]})]})}),"single-choice"===G&&(0,h.jsxs)("div",{className:"space-y-2 p-[0px] mt-[0px] mr-[0px] mb-[18px] ml-[0px]",children:[(0,h.jsxs)("span",{className:"font-['Inter'] text-[14px] font-medium text-[#3d4148] px-[0px] py-[4px]",children:[null==A?void 0:A.choicesLabel," ",(0,h.jsx)("span",{className:"text-[#e7000b]",children:"*"})," ",(0,h.jsxs)("span",{className:"text-[#717182] font-normal text-[12px]",children:["(",null==A?void 0:A.choicesMinMax,")"]})]}),(0,h.jsxs)("div",{className:"space-y-2 px-[0px] py-[-7px]",children:[$.map(function(e,t){return(0,h.jsxs)("div",{className:"flex items-center gap-2 px-[0px] py-[4px]",children:[(0,h.jsxs)("span",{className:"font-['Inter'] text-[12px] font-medium text-[#717182] w-[60
2px] text-center",children:[null==A?void 0:A.choice," ",t+1]}),(0,h.jsx)(d.p,{value:e,onChange:function(e){!function(e,t){var r=(0,F.A)($);r[e]=t,K(r)}(t,e.target.value),xe(function(e){return hn(hn({},e),{},{choices:!0})})},placeholder:(r=t,0===r?null==A?void 0:A.choicePlaceholder1:1===r?null==A?void 0:A.choicePlaceholder2:null==A?void 0:A.choicePlaceholder3),className:"flex-1 bg-white border-[#bdc0c7] h-9 px-[12px] py-[0px]",maxLength:50}),(0,h.jsx)("button",{type:"button",onClick:function(){return function(e){$.length>2&&K($.filter(function(t,r){return r!==e}))}(t)},disabled:$.length<=2,className:"w-9 hover:bg-gray-200 disabled:opacity-30 disabled:cursor-not-allowed flex items-center justify-center h-8 transition-colors rounded-lg",children:(0,h.jsx)(an.A,{className:"h-4 w-4 text-[#6b7280]"})})]},"choice-".concat(t));var r}),Te("choices")&&(0,h.jsxs)("div",{className:"flex items-start gap-2 px-3 py-2 rounded border-l-[3px] bg-[#fee2e2] border-l-[#ef4444]",children:[(0,h.jsx)(sn.A,{className:"h-4 w-4 flex-shrink-0 mt-0.5 text-[#ef4444]"}),(0,h.jsx)("p",{className:"text-[12px] font-['Open_Sans'] font-medium text-[#ef4444]",children:null===(c=Te("choices"))||void 0===c?void 0:c.message})]}),(0,h.jsxs)("button",{type:"button",onClick:function(){$.length<20&&K([].concat((0,F.A)($),[""]))},disabled:$.length>=20,className:"h-8 px-3 flex items-center gap-2 border border-[#6b7280] rounded-[8px] bg-white text-[#6b7280] text-[14px] font-medium disabled:opacity-50 disabled:cursor-not-allowed hover:bg-gray-50 transition-all hover:scale-105 active:scale-95",children:[(0,h.jsx)(qt.A,{className:"w-4 h-4"}),null==A?void 0:A.addChoice]})]})]}),(0,h.jsxs)("div",{className:"space-y-2",children:[(0,h.jsx)("span",{className:"font-['Inter'] text-[14px] font-medium text-[#3d4148]",children:null==A?void 0:A.requiredLabel}),(0,h.jsxs)("div",{className:"flex items-center gap-3",children:[(0,h.jsx)(Fr.d,{checked:J,onCheckedChange:ee,className:"data-[state=checked]:bg-[#10b06c] data-[state=checked]:border-[#10b06c]"}),(0,h.jsx)("span",{className:"text-[#3d4148] text-[14px] font-medium",children:null==A?void 0:A.extractFromEveryCall})]})]})]}),(0,h.jsxs)("div",{className:"w-[280px] bg-[#f9fafb] rounded-lg border border-[#dddee2]",children:[(0,h.jsxs)("div",{className:"bg-[#f1f2f7] px-4 py-3 flex items-center justify-between cursor-pointer rounded-t-lg",onClick:function(){return ae(!ne)},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||ae(!ne)},role:"button",tabIndex:0,children:[(0,h.jsxs)("div",{className:"flex items-center gap-2",children:[(0,h.jsx)(ln,{className:"h-4 w-4 text-[#f59e0b]"}),(0,h.jsx)("span",{className:"font-['Inter'] text-[13px] font-semibold text-[#3D4148]",children:null==A?void 0:A.examplesAndTips})]}),(0,h.jsx)("button",{type:"button",className:"text-[#717182] hover:text-[#3D4148]",children:ne?(0,h.jsx)(kt.A,{className:"w-3 h-3"}):(0,h.jsx)(Rt.A,{className:"w-3 h-3"})})]}),!ne&&(0,h.jsxs)("div",{className:"p-4 space-y-3 max-h-[500px] overflow-y-auto custom-scrollbar",children:[(0,h.jsxs)("div",{className:"space-y-2",children:[(0,h.jsxs)("h4",{className:"font-['Inter'] text-[12px] font-semibold text-[#10b981]",children:[null==A?void 0:A.goodExamples,":"]}),Oe.good.map(function(e){return(0,h.jsxs)("div",{className:"flex gap-2",children:[(0,h.jsx)(Pt.A,{className:"h-3 w-3 text-[#10b981] mt-0.5 flex-shrink-0"}),(0,h.jsx)("p",{className:"text-[12px] text-[#3D4148] leading-relaxed",children:e})]},e)})]}),(0,h.jsxs)("div",{className:"space-y-2",children:[(0,h.jsxs)("h4",{className:"font-['Inter'] text-[12px] font-semibold text-[#ef4444]",children:[null==A?void 0:A.badExamples,":"]}),Oe.bad.map(function(e){return(0,h.jsxs)("div",{className:"flex gap-2",children:[(0,h.jsx)(an.A,{className:"h-3 w-3 text-[#ef4444] mt-0.5 flex-shrink-0"}),(0,h.jsx)("p",{className:"text-[12px] text-[#717182] leading-relaxed line-through",children:e})]},e)})]}),(0,h.jsxs)("div",{className:"space-y-2",children:[(0,h.jsxs)("h4",{className:"font-['Inter'] text-[12px] font-semibold text-[#3D4148]",children:[null==A||null===(m=A.tipsFor)||void 0===m?void 0:m.replace("{type}",E[G].label),":"]}),(0,h.jsx)("ul",{className:"ml-1 space-y-1.5",children:Oe.tips.map(function(e){return(0,h.jsxs)("li",{className:"text-[12px] text-[#3D4148] leading-relaxed flex gap-2",children:[(0,h.jsx)("span",{className:"text-[#3d5d98]",children:"-"}),(0,h.jsx)("span",{children:e})]},e)})})]})]})]})]})]})]})})};bn.propTypes={onSave:g().func.isRequired,onCancel:g().func.isRequired,editField:g().shape({id:g().str
2ing,name:g().string.isRequired,question:g().string,type:g().oneOf(["boolean","string","single-choice","number"]).isRequired,prompt:g().string.isRequired,choices:g().arrayOf(g().string),required:g().bool.isRequired}),existingFieldNames:g().arrayOf(g().string),isSaving:g().bool,saveError:g().string,messages:g().object};var vn=r(418),yn=r(78239),Dn=function(e){var t=e.open,r=e.onOpenChange,n=e.fieldName,a=e.submissionCount,s=e.isLoadingCount,i=e.onConfirm,o=e.messages,l=a>0;return(0,h.jsx)(yn.Lt,{open:t,onOpenChange:r,children:(0,h.jsxs)(yn.EO,{className:"max-w-[480px] bg-white p-0",children:[(0,h.jsx)(yn.wd,{className:"px-6 pt-6 pb-4",children:(0,h.jsx)(yn.r7,{className:"font-['Montserrat'] text-[18px] font-bold text-[#3D4148]",children:null==o?void 0:o.deleteFieldTitle})}),(0,h.jsxs)("div",{className:"px-6 pb-6 space-y-4",children:[(0,h.jsx)(yn.$v,{className:"text-[14px] text-[#3D4148] font-['Open_Sans']",children:null==o?void 0:o.deleteFieldConfirmation}),(0,h.jsx)("div",{className:"bg-[#f1f2f7] border border-[#dddee2] rounded-[6px] px-3 py-3",children:(0,h.jsxs)("p",{className:"font-['Open_Sans'] text-[14px] font-bold text-[#3d5d98]",children:['"',n,'"']})}),s?(0,h.jsxs)("div",{className:"flex items-center gap-2 py-2",children:[(0,h.jsx)(Ve.A,{className:"h-4 w-4 animate-spin text-[#717182]"}),(0,h.jsx)("p",{className:"font-['Open_Sans'] text-[14px] text-[#717182]",children:(null==o?void 0:o.loadingSubmissionCount)||"Checking submissions..."})]}):l?(0,h.jsxs)("div",{className:"space-y-3",children:[(0,h.jsxs)("div",{className:"flex items-center gap-2",children:[(0,h.jsx)(vn.A,{className:"h-5 w-5 text-[#f59e0b]"}),(0,h.jsxs)("span",{className:"font-['Open_Sans'] text-[14px] font-bold text-[#f59e0b]",children:[null==o?void 0:o.warning,":"]})]}),(0,h.jsxs)("p",{className:"font-['Open_Sans'] text-[14px] font-semibold text-[#3D4148]",children:[a.toLocaleString()," ",1!==a?null==o?void 0:o.submissions:null==o?void 0:o.submission," ",null==o?void 0:o.useThisField,"."]}),(0,h.jsx)("div",{className:"bg-[#fef3c7] border-l-[3px] border-l-[#f59e0b] rounded-[6px] px-3 py-3",children:(0,h.jsx)("p",{className:"font-['Open_Sans'] text-[13px] text-[#717182] leading-[1.6]",children:null==o?void 0:o.historicalDataWarning})})]}):(0,h.jsx)("p",{className:"font-['Open_Sans'] text-[14px] text-[#717182]",children:null==o?void 0:o.actionCannotBeUndone})]}),(0,h.jsxs)(yn.ck,{className:"px-6 py-5 border-t border-[#dddee2] flex justify-end gap-3",children:[(0,h.jsx)(yn.Zr,{className:"bg-white border border-[#dddee2] text-[#3D4148] hover:bg-[#f9fafb] font-['Open_Sans'] text-[14px] font-medium px-5 py-2.5 rounded-md",children:null==o?void 0:o.cancel}),(0,h.jsx)(yn.Rx,{onClick:i,disabled:s,className:"bg-[#ef4444] hover:bg-[#dc2626] text-white font-['Open_Sans'] text-[14px] font-semibold px-6 py-2.5 rounded-md disabled:opacity-50",children:null==o?void 0:o.deleteField})]})]})})};Dn.propTypes={open:g().bool.isRequired,onOpenChange:g().func.isRequired,fieldName:g().string.isRequired,submissionCount:g().number,isLoadingCount:g().bool,onConfirm:g().func.isRequired,messages:g().object};var jn=r(21436),Cn=r(86241),Nn=r(25005),wn=r(58410),An=r(5079),En=function(e){var t,r=e.field,s=e.index,i=e.moveRow,o=e.onDrop,l=e.onEdit,u=e.onDelete,d={boolean:{label:(t=e.messages).typeBadgeBoolean,bgColor:"#E1E7F3",textColor:"#2E477A"},string:{label:t.typeBadgeString,bgColor:"#F3E8FF",textColor:"#6B21A8"},"single-choice":{label:t.typeBadgeSingleChoice,bgColor:"#DBEAFE",textColor:"#1E40AF"},number:{label:t.typeBadgeNumber,bgColor:"#FEF3C7",textColor:"#92400E"}},p=(0,a.useRef)(s),m=(0,wn.i)({type:fn,item:function(){return p.current=s,{index:s,originalIndex:s}},end:function(e,t){t.didDrop()&&e.index!==e.originalIndex&&o()},collect:function(e){return{isDragging:e.isDragging()}}}),f=(0,n.A)(m,3),g=f[0].isDragging,x=f[1],b=f[2],v=(0,An.H)({accept:fn,hover:function(e){e.index!==s&&(i(e.index,s),e.index=s)},collect:function(e){return{isOver:e.isOver()}}}),y=(0,n.A)(v,2),D=y[0].isOver,j=y[1],C=d[r.type]||d.string;return(0,h.jsxs)(h.Fragment,{children:[D&&(0,h.jsx)("tr",{children:(0,h.jsx)("td",{colSpan:5,className:"p-0",children:(0,h.jsx)("div",{className:"h-[2px] bg-[#3d5d98]"})})}),(0,h.jsxs)("tr",{ref:function(e){return b(j(e))},className:"group border-b border-[#dddee2] last:border-b-0 transition-all duration-150 ".concat(g?"opacity-50 scale-[1.02]":""," hover:bg-[#f9fafb] hover:border-l-2 hover:border-l-[#3d5d98]"),style:{cursor:g?"grabbing":"default",boxShadow:g?"0 8px 16px rgba(0,0,0,0.15)":"none"},children:[(0,h.jsx)("td",{className:"px-4 py-3 w-[60px]",children:(0,h.jsxs)("div",{className:"flex items-center gap-2",children:[(0,h.jsx)("div",{ref:x,className:"cursor-grab hover:text-[#3d5d98] text-[#717182] transition-colors active:cursor-grabbing",children:(0,h.jsx)(jn.A,{className:"w-4 h-4"})}),(0,h.jsx)("span",{className:"font-['Open_Sans'] text-[14px] font-medium text-[#717182]",children:s+1})]})}),(0,h.jsx)("td",{className:"px-4 py-3",style:{width:"40%"},children:(0,h.jsx)("span",{className:"font-['Open_Sans'] text-[14px] font-medium text-[#3D4148] truncate block",children:r.name})}),(0,h.jsx)("td",{className:"px-4 py-3 w-[140px]",children:(0,h.jsx)(c.E,{style:{backgroundColor:C.bgColor,color:C.textColor},className:"font-['Open_Sans'] text-[12px] font-medium px-2 py-1 rounded",children:C.label})}),(0,h.jsx)("td",{className:"px-4 py-3 w-[80px] text-center",children:r.required?(0,h.jsx)(Pt.A,{className:"h-4 w-4 text-[#10b981] inline-block"}):(0,h.jsx)(Cn.A,{className:"h-4 w-4 text-[#717182] inline-block"})}),(0,h.jsx)("td",{className:"px-4 py-3 w-[100px]",children:(0,h.jsxs)("div",{className:"flex items-center gap-2",children:[(0,h.jsx)("button",{type:"button",onClick:function(){return u(r.id)},className:"size-[32px] rounded-[8px] flex items-center justify-center hover:bg-destructive/10 transition-colors",title:"Delete field",children:(0,h.jsx)(Bt.A,{className:"text-red-1.0 w-4 h-4"})}),(0,h.jsx)("button",{type:"button",onClick:function(){return l(r.id)},className:"size-[32px] rounded-[8px] flex items-center justify-center hover:bg-blue-50 transition-colors",title:"Edit field",children:(0,h.jsx)(Nn.A,{className:"h-4 w-4 text-[#3d5d98]"})})]})})]})]})};
2En.propTypes={field:g().shape({id:g().string.isRequired,name:g().string.isRequired,question:g().string,type:g().oneOf(["boolean","string","single-choice","number"]).isRequired,prompt:g().string,choices:g().arrayOf(g().string),required:g().bool.isRequired,order:g().number}).isRequired,index:g().number.isRequired,moveRow:g().func.isRequired,onDrop:g().func.isRequired,onEdit:g().func.isRequired,onDelete:g().func.isRequired,messages:g().object};var Fn=r(78576),Sn=r(23151),Tn=function(e){var t=e.availableVersions,r=e.selectedVersions,s=e.onToggleVersion,i=e.onClearVersions,l=e.dateRange,u=e.onDateRangeChange,p=e.fields,m=e.visibleColumns,f=e.onToggleColumn,g=e.searchQuery,x=e.onSearchChange,b=e.onExport,v=e.isExporting,y=void 0!==v&&v,D=e.messages,C=void 0===D?{}:D,N=(0,a.useState)(!1),w=(0,n.A)(N,2),A=w[0],E=w[1],F=(0,a.useState)(!1),S=(0,n.A)(F,2),T=S[0],_=S[1];return(0,h.jsx)("div",{className:"bg-white border border-[#dddee2] rounded-lg p-4",children:(0,h.jsxs)("div",{className:"flex flex-wrap items-center gap-3",children:[(0,h.jsxs)(Xe.AM,{open:A,onOpenChange:E,children:[(0,h.jsx)(Xe.Wv,{asChild:!0,children:(0,h.jsxs)(me.$,{variant:"outline",className:"bg-white border-[#dddee2] text-action-secondary-dark-2 hover:bg-[#F1F2F7] px-4 py-2 rounded-md font-['Open_Sans'] text-[13px] font-medium",children:[(0,h.jsx)(er.A,{className:"w-4 h-4 mr-2"}),null==C?void 0:C.responseVersion,r.length>0&&(0,h.jsx)(c.E,{className:"ml-2 bg-brand-primary text-white text-miniscule px-1.5 py-0.5 border-transparent",children:r.length}),(0,h.jsx)(kt.A,{className:"w-4 h-4 ml-2"})]})}),(0,h.jsxs)(Xe.hl,{align:"start",className:"w-48 p-2",children:[(0,h.jsx)("p",{className:"text-[12px] font-semibold text-[#717182] px-2 py-1.5",children:null==C?void 0:C.responseFilterByVersion}),(0,h.jsx)("div",{className:"h-px bg-[#dddee2] my-1"}),t.map(function(e){return(0,h.jsxs)("button",{type:"button",onClick:function(){return s(e)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-[13px] text-action-secondary-dark-2 rounded hover:bg-[#F1F2F7] transition-colors",children:[(0,h.jsx)("div",{className:"flex h-4 w-4 items-center justify-center rounded border border-[#dddee2]",children:r.includes(e)&&(0,h.jsx)(Pt.A,{className:"text-brand-primary w-3 h-3"})}),null==C?void 0:C.responseVersion," ",e]},e)}),r.length>0&&(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)("div",{className:"h-px bg-[#dddee2] my-1"}),(0,h.jsx)("button",{type:"button",onClick:i,className:"w-full px-2 py-1.5 text-[13px] text-red-600 rounded hover:bg-red-100 transition-colors text-left",children:null==C?void 0:C.responseClearFilters})]})]})]}),(0,h.jsxs)(Xe.AM,{children:[(0,h.jsx)(Xe.Wv,{asChild:!0,children:(0,h.jsxs)(me.$,{variant:"outline",className:"bg-white border-[#dddee2] text-action-secondary-dark-2 hover:bg-[#F1F2F7] px-4 py-2 rounded-md font-['Open_Sans'] text-[13px] font-medium",children:[(0,h.jsx)(j.A,{className:"w-4 h-4 mr-2"}),l.from?(0,h.jsxs)(h.Fragment,{children:[l.from.toLocaleDateString("en-US",{month:"short",day:"numeric"}),l.to&&" - ".concat(l.to.toLocaleDateString("en-US",{month:"short",day:"numeric"}))]}):null==C?void 0:C.responseDateRange,l.from&&(0,h.jsx)("span",{role:"button",tabIndex:-1,"aria-label":"Clear date filter",onClick:function(e){e.stopPropagation(),e.preventDefault(),u({})},onKeyDown:function(e){"Enter"!==e.key&&" "!==e.key||(e.stopPropagation(),e.preventDefault(),u({}))},onPointerDown:function(e){e.stopPropagation(),e.preventDefault()},children:(0,h.jsx)(an.A,{className:"w-3 h-3 ml-2"})})]})}),(0,h.jsx)(Xe.hl,{className:"w-auto p-0",align:"start",children:(0,h.jsx)(Sn.V,{mode:"range",selected:l.from?l:void 0,onSelect:function(e){if(e)if(l.from&&l.to){var t,r,n=(null===(t=e.from)||void 0===t?void 0:t.getTime())!==l.from.getTime()?e.from:null!==(r=e.to)&&void 0!==r?r:e.from;u({from:n,to:void 0})}else u(e);else u({})},numberOfMonths:2})})]}),(0,h.jsxs)(Xe.AM,{open:T,onOpenChange:_,children:[(0,h.jsx)(Xe.Wv,{asChild:!0,children:(0,h.jsxs)(me.$,{variant:"outline",className:"bg-white border-[#dddee2] text-action-secondary-dark-2 hover:bg-[#F1F2F7] px-4 py-2 rounded-md font-['Open_Sans'] text-[13px] font-medium",children:[(0,h.jsx)(Fn.A,{className:"w-4 h-4 mr-2"}),null==C?void 0:C.responseColumns,(0,h.jsxs)(c.E,{className:"ml-2 bg-brand-primary-light-5 text-brand-primary-text text-miniscule px-1.5 py-0.5 border-transparent",children:[m.size,"/",p.length]})]})}),(0,h.jsxs)(Xe.hl,{align:"start",className:"w-56 p-2",children:[(0,h.jsx)("p",{className:"text-[12px] font-semibold text-[#717182] px-2 py-1.5",children:null==C?void 0:C.responseShowHideColumns}),(0,h.jsx)("div",{className:"h-px bg-[#dddee2] my-1"}),p.map(function(e){return(0,h.jsxs)("button",{type:"button",onClick:function(){return f(e.id)},className:"flex items-center gap-2 w-full px-2 py-1.5 text-[13px] text-action-secondary-dark-2 rounded hover:bg-[#F1F2F7] transition-colors",children:[(0,h.jsx)("div",{className:"flex h-4 w-4 items-center justify-center rounded border border-[#dddee2]",children:m.has(e.id)&&(0,h.jsx)(Pt.A,{className:"text-brand-primary w-3 h-3"})}),e.name]},e.id)})]})]}),(0,h.jsxs)("div",{className:"relative flex-1 min-w-[200px] max-w-[300px]",children:[(0,h.jsx)(o.A,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 h-4 w-4 text-[#717182]"}),(0,h.jsx)(d.p,{placeholder:null==C?void 0:C.responseSearchPlaceholder,value:g,onChange:function(e){return x(e.target.value)},className:"pl-9 bg-white border-[#dddee2] text-[13px] h-9"})]}),(0,h.jsx)(me.$,{onClick:b,disabled:y,className:"bg-action-primary text-white hover:opacity-90 transition-colors duration-200 px-4 py-2 rounded-md font-['Open_Sans'] text-[13px] font-medium ml-auto disabled:opacity-50 disabled:cursor-not-allowed",children:y?(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(Ve.A,{className:"animate-spin w-4 h-4 mr-2"}),(null==C?void 0:C.responseExporting)||"Exporting..."]}):(0,h.jsxs)(h.Fragment,{children:[(0,h.jsx)(de.A,{className:"w-4 h-4 mr-2"}),null==C?void 0:C.responseExportCsv]})})]})})};Tn.propTypes={availableVersions:g().arrayOf(g().string).isRequired,selectedVersions:g().arrayOf(g().string).isRequired,onToggleVersion:g().func.isRequired,onClearVersions:g().func.isRequired,dateRange:g().shape({from:g().instanceOf(Date),to:g().instanceOf(Date)}).isRequired,onDateRangeChange:g().func.isRequired,fields:g().arrayOf(g().shape({id:g().str
2ing.isRequired,name:g().string.isRequired})).isRequired,visibleColumns:g().instanceOf(Set).isRequired,onToggleColumn:g().func.isRequired,searchQuery:g().string.isRequired,onSearchChange:g().func.isRequired,onExport:g().func.isRequired,isExporting:g().bool,messages:g().object};var _n=function(e){var t=e.pageIndex,r=e.pageSize,n=e.totalCount,a=e.onPageChange,s=e.onPageSizeChange,i=e.messages,o=void 0===i?{}:i,l=Math.ceil(n/r),u=t>0,c=t<l-1,d=n>0?t*r+1:0,m=Math.min((t+1)*r,n);return(0,h.jsxs)("div",{className:"flex items-center justify-between px-4 py-3 border-t border-[#dddee2] bg-white rounded-b-lg",children:[(0,h.jsx)("div",{className:"flex items-center space-x-2",children:(0,h.jsxs)("p",{className:"text-[13px] text-[#717182]",children:[null==o?void 0:o.showingXToY," ",d," ",null==o?void 0:o.toX," ",m," ",null==o?void 0:o.ofX," ",n," ",null==o?void 0:o.entries]})}),(0,h.jsxs)("div",{className:"flex items-center space-x-6",children:[(0,h.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,h.jsx)("p",{className:"text-[13px] font-medium text-[#3D4148]",children:null==o?void 0:o.rowsPerPage}),(0,h.jsxs)(p.l6,{value:"".concat(r),onValueChange:function(e){return s(Number(e))},children:[(0,h.jsx)(p.bq,{className:"h-8 w-[70px]",children:(0,h.jsx)(p.yv,{placeholder:r})}),(0,h.jsx)(p.gC,{side:"top",children:[10,20,30,40,50].map(function(e){return(0,h.jsx)(p.eb,{value:"".concat(e),children:e},e)})})]})]}),(0,h.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,h.jsx)(me.$,{variant:"outline",size:"sm",onClick:function(){return a(0)},disabled:!u,children:(0,h.jsx)(ut,{className:"w-4 h-4"})}),(0,h.jsx)(me.$,{variant:"outline",size:"sm",onClick:function(){return a(t-1)},disabled:!u,children:(0,h.jsx)(ct.A,{className:"w-4 h-4"})}),(0,h.jsxs)("div",{className:"flex items-center justify-center text-[13px] font-medium text-[#3D4148] w-[100px]",children:[null==o?void 0:o.page," ",t+1," ",null==o?void 0:o.of," ",l]}),(0,h.jsx)(me.$,{variant:"outline",size:"sm",onClick:function(){return a(t+1)},disabled:!c,children:(0,h.jsx)(dt.A,{className:"w-4 h-4"})}),(0,h.jsx)(me.$,{variant:"outline",size:"sm",onClick:function(){return a(l-1)},disabled:!c,children:(0,h.jsx)(pt.A,{className:"w-4 h-4"})})]})]})]})};function On(e,t){var r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"][e.getMonth()],n=e.getDate(),a=e.getFullYear(),s=e.getHours(),i=e.getMinutes(),o=s>=12?"PM":"AM",l=s%12||12;switch(t){case"MMM d, yyyy":return"".concat(r," ").concat(n,", ").concat(a);case"MMM d":return"".concat(r," ").concat(n);case"h:mm a":return"".concat(l,":").concat(i.toString().padStart(2,"0")," ").concat(o);case"MMM d, yyyy h:mm a":return"".concat(r," ").concat(n,", ").concat(a," ").concat(l,":").concat(i.toString().padStart(2,"0")," ").concat(o);case"yyyy-MM-dd":return"".concat(a,"-").concat((e.getMonth()+1).toString().padStart(2,"0"),"-").concat(n.toString().padStart(2,"0"));default:return e.toLocaleString()}}function Rn(e){var t=String(e);return t.includes('"')||t.includes(",")||t.includes("\n")||t.includes("\r")?'"'.concat(t.replace(/"/g,'""'),'"'):t}function kn(e,t){var r=[["Phone Number","Call Date","Version"].concat((0,F.A)(t.map(function(e){return e.name}))).map(Rn).join(",")];e.forEach(function(e){var n=[e.phoneNumber,On(e.callDate,"yyyy-MM-dd"),e.version].concat((0,F.A)(t.map(function(t){var r=e.responses[t.id];return null==r?"---":r})));r.push(n.map(Rn).join(","))});var n=r.join("\n"),a=new Blob([n],{type:"text/csv;charset=utf-8;"}),s=document.createElement("a"),i=URL.createObjectURL(a);s.setAttribute("href",i),s.setAttribute("download","patient_responses_".concat(On(new Date,"yyyy-MM-dd"),".csv")),s.style.visibility="hidden",document.body.appendChild(s),s.click(),document.body.removeChild(s)}_n.propTypes={pageIndex:g().number.isRequired,pageSize:g().number.isRequired,totalCount:g().number.isRequired,onPageChange:g().func.isRequired,onPageSizeChange:g().func.isRequired,messages:g().object};var Bn=[{bg:"#C8F3E0",text:"#10B06C"},{bg:"#D4F4E7",text:"#0D8F57"},{bg:"#FFF9E6",text:"#E4C100"},{bg:"#FFE8E6",text:"#FF6B35"},{bg:"#FFE0E0",text:"#DC0000"},{bg:"#E1E7F3",text:"#2E477A"},{bg:"#EDE9FE",text:"#6D28D9"},{bg:"#DBEAFE",text:"#2563EB"},{bg:"#FEF3C7",text:"#D97706"},{bg:"#FCE7F3",text:"#DB2777"}],Pn={bg:"#E1E7F3",text:"#2E477A"};function qn(e,t,r){if(null==t)return(0,h.jsx)("span",{className:"text-[#9CA3AF] font-mono text-[13px]",children:"---"});if("boolean"==typeof t)return t?(0,h.jsx)(c.E,{className:"bg-[#D1FAE5] text-[#065F46] text-[11px] font-medium px-2 py-0.5 border-transparent",children:null==r?void 0:r.responseYes}):(0,h.jsx)(c.E,{className:"bg-[#FEE2E2] text-[#991B1B] text-[11px] font-medium px-2 py-0.5 border-transparent",children:null==r?void 0:r.responseNo});switch(e.type){case"boolean":return Boolean(t)?(0,h.jsx)(c.E,{className:"bg-[#D1FAE5] text-[#065F46] text-[11px] font-medium px-2 py-0.5 border-transparent",children:null==r?void 0:r.responseYes}):(0,h.jsx)(c.E,{className:"bg-[#FEE2E2] text-[#991B1B] text-[11px] font-medium px-2 py-0.5 border-transparent",children:null==r?void 0:r.responseNo});case"number":return(0,h.jsx)("span",{className:"font-mono text-[13px] font-semibold text-[#3D4148]",children:String(t)});case"single-choice":var n=String(t),a=function(e,t){if(!e.choices||0===e.choices.length)return Pn;var r=e.choices.indexOf(t);return-1===r?Pn:Bn[r%Bn.length]}
2(e,n);return(0,h.jsx)(c.E,{style:{backgroundColor:a.bg,color:a.text},className:"text-[11px] font-medium px-2 py-0.5 border-transparent",children:n});case"string":var s=String(t);return(0,h.jsx)("span",{className:"text-[#3D4148] text-[13px] truncate block max-w-[300px]",title:s,children:s});default:return(0,h.jsx)("span",{className:"text-[13px]",children:String(t)})}}var Ln=function(e){var t=e.responses,r=e.visibleFields,n=e.messages,s=void 0===n?{}:n,i=(0,a.useRef)(null);return(0,h.jsx)("div",{className:"bg-white border-t border-x border-[#dddee2] rounded-t-lg overflow-hidden",children:(0,h.jsx)("div",{className:"overflow-x-auto",ref:i,children:(0,h.jsxs)("table",{className:"w-full border-collapse min-w-[1200px]",children:[(0,h.jsx)("thead",{className:"sticky top-0 z-10",children:(0,h.jsxs)("tr",{className:"bg-[#F1F2F7] border-b border-[#dddee2]",children:[(0,h.jsx)("th",{className:"px-4 py-3 text-left font-['Open_Sans'] text-[12px] font-semibold text-[#717182] uppercase tracking-wide w-[160px] border-r border-[#dddee2]",children:null==s?void 0:s.responsePhoneNumber}),(0,h.jsx)("th",{className:"px-4 py-3 text-left font-['Open_Sans'] text-[12px] font-semibold text-[#717182] uppercase tracking-wide w-[160px] border-r border-[#dddee2]",children:null==s?void 0:s.responseCallDate}),(0,h.jsx)("th",{className:"px-4 py-3 text-left font-['Open_Sans'] text-[12px] font-semibold text-[#717182] uppercase tracking-wide w-[100px]",children:null==s?void 0:s.responseVersion}),r.map(function(e){return(0,h.jsx)("th",{className:"px-4 py-3 text-left font-['Open_Sans'] text-[12px] font-semibold text-[#717182] uppercase tracking-wide min-w-[200px]",children:(0,h.jsxs)("div",{className:"flex items-center gap-1",children:[e.name,e.required&&(0,h.jsx)("span",{className:"text-[#DC2626]",children:"*"})]})},e.id)})]})}),(0,h.jsx)("tbody",{children:0===t.length?(0,h.jsx)("tr",{children:(0,h.jsx)("td",{colSpan:3+r.length,className:"px-4 py-12 text-center",children:(0,h.jsx)("p",{className:"text-[#717182] text-[14px]",children:null==s?void 0:s.responseNoMatchingFilters})})}):t.map(function(e,t){return(0,h.jsxs)("tr",{className:"border-b border-[#dddee2] last:border-b-0 hover:bg-[#F9FAFB] transition-colors ".concat(t%2==0?"bg-white":"bg-[#FAFBFC]"),children:[(0,h.jsx)("td",{className:"px-4 py-3 border-r border-[#dddee2]",children:(0,h.jsx)("span",{className:"font-mono text-[13px] font-semibold text-[#3d5d98]",children:e.phoneNumber})}),(0,h.jsxs)("td",{className:"px-4 py-3 border-r border-[#dddee2]",children:[(0,h.jsx)("span",{className:"font-['Open_Sans'] text-[13px] text-[#3D4148]",children:On(e.callDate,"MMM d, yyyy")}),(0,h.jsx)("br",{}),(0,h.jsx)("span",{className:"text-[11px] text-[#9CA3AF]",children:On(e.callDate,"h:mm a")})]}),(0,h.jsx)("td",{className:"px-4 py-3",children:(0,h.jsx)(c.E,{style:{backgroundColor:"#E1E7F3",color:"#2E477A"},className:"font-['Open_Sans'] text-[11px] font-medium px-2 py-0.5 border-transparent",children:e.version})}),r.map(function(t){return(0,h.jsx)("td",{className:"px-4 py-3 text-left",children:qn(t,e.responses[t.id],s)},t.id)})]},e.id)})})]})})})};function Mn(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,a,s){var l=n&&n.prototype instanceof o?n:o,u=Object.create(l.prototype);return In(u,"_invoke",function(r,n,a){var s,o,l,u=0,c=a||[],d=!1,p={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,r){return s=t,o=0,l=e,p.n=r,i}};function m(r,n){for(o=r,l=n,t=0;!d&&u&&!a&&t<c.length;t++){var a,s=c[t],m=p.p,f=s[2];r>3?(a=f===n)&&(l=s[(o=s[4])?5:(o=3,3)],s[4]=s[5]=e):s[0]<=m&&((a=r<2&&m<s[1])?(o=0,p.v=n,p.n=s[1]):m<f&&(a=r<3||s[0]>n||n>f)&&(s[4]=r,s[5]=n,p.n=f,o=0))}if(a||r>1)return i;throw d=!0,n}return function(a,c,f){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&m(c,f),o=c,l=f;(t=o<2?e:l)||!d;){s||(o?o<3?(o>1&&(p.n=-1),m(o,l)):p.n=l:p.v=l);try{if(u=2,s){if(o||(a="next"),t=s[a]){if(!(t=t.call(s,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,o<2&&(o=0)}else 1===o&&(t=s.return)&&t.call(s),o<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),o=1);s=e}else if((t=(d=p.n<0)?l:r.call(n,p))!==i)break}catch(t){s=e,o=1,l=t}finally{u=1}}return{value:t,done:d}}}(r,a,s),!0),u}var i={};function o(){}function l(){}function u(){}t=Object.getPrototypeOf;
2var c=[][n]?t(t([][n]())):(In(t={},n,function(){return this}),t),d=u.prototype=o.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,In(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,In(d,"constructor",u),In(u,"constructor",l),l.displayName="GeneratorFunction",In(u,a,"GeneratorFunction"),In(d),In(d,a,"Generator"),In(d,n,function(){return this}),In(d,"toString",function(){return"[object Generator]"}),(Mn=function(){return{w:s,m:p}})()}function In(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}In=function(e,t,r,n){function s(t,r){In(e,t,function(e){return this._invoke(t,r,e)})}t?a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(s("next",0),s("throw",1),s("return",2))},In(e,t,r,n)}Ln.propTypes={responses:g().arrayOf(g().shape({id:g().string.isRequired,phoneNumber:g().string.isRequired,callDate:g().instanceOf(Date).isRequired,version:g().string.isRequired,responses:g().object.isRequired})).isRequired,visibleFields:g().arrayOf(g().shape({id:g().string.isRequired,name:g().string.isRequired,type:g().oneOf(["boolean","string","single-choice","number"]).isRequired,required:g().bool})).isRequired,messages:g().object};var Gn=function(e){var t=e.moduleId,r=void 0===t?null:t,s=e.fields,i=void 0===s?[]:s,o=e.responses,l=void 0===o?[]:o,c=e.lastUpdated,d=void 0===c?new Date:c,p=e.messages,m=void 0===p?{}:p,f=(0,a.useState)([]),g=(0,n.A)(f,2),x=g[0],b=g[1],v=(0,a.useState)(""),D=(0,n.A)(v,2),j=D[0],C=D[1],N=(0,a.useState)(function(){return new Set(i.map(function(e){return e.id}))}),w=(0,n.A)(N,2),A=w[0],E=w[1];(0,a.useEffect)(function(){E(new Set(i.map(function(e){return e.id})))},[i]);var S=(0,a.useState)({}),T=(0,n.A)(S,2),_=T[0],O=T[1],R=(0,a.useState)(0),k=(0,n.A)(R,2),B=k[0],P=k[1],q=(0,a.useState)(10),L=(0,n.A)(q,2),M=L[0],I=L[1],G=(0,a.useState)(!1),U=(0,n.A)(G,2),z=U[0],V=U[1],Y=(0,a.useMemo)(function(){var e=new Set(l.map(function(e){return e.version}));return Array.from(e).sort()},[l]),H=(0,a.useMemo)(function(){return l.filter(function(e){if(x.length>0&&!x.includes(e.version))return!1;if(_.from&&e.callDate<_.from)return!1;if(_.to&&e.callDate>_.to)return!1;if(j.trim()){var t=j.toLowerCase(),r=e.phoneNumber.toLowerCase().includes(t),n=Object.values(e.responses).some(function(e){return String(e).toLowerCase().includes(t)});return r||n}return!0})},[l,x,_,j]),Q=(0,a.useMemo)(function(){var e=B*M;return H.slice(e,e+M)},[H,B,M]),W=i.filter(function(e){return A.has(e.id)}),$=function(){var e=(0,y.A)(Mn().m(function e(){var t,a,s,i,o,l,c,d,p;return Mn().w(function(e){for(;;)switch(e.p=e.n){case 0:if(r){e.n=1;break}return kn(H,W),e.a(2);case 1:return V(!0),e.p=2,t={},_.from&&(a=_.from.toISOString().split("T"),s=(0,n.A)(a,1),t.date_range_after=s[0]),_.to&&(i=_.to.toISOString().split("T"),o=(0,n.A)(i,1),t.date_range_before=o[0]),(l=W.map(function(e){return e.name}).join(","))&&(t.fields=l),e.n=3,se(r,t);case 3:c=e.v,d=window.URL.createObjectURL(new Blob([c.data])),(p=document.createElement("a")).href=d,p.setAttribute("download","data_submissions_".concat(On(new Date,"yyyy-MM-dd"),".csv")),document.body.appendChild(p),p.click(),p.parentNode.removeChild(p),window.URL.revokeObjectURL(d),u.oR.success((null==m?void 0:m.exportSuccess)||"Export completed successfully",{className:"bg-white-1.0 p-4 rounded border-l-8 shadow border-green-1.0 w-84",closeButton:!1,bodyClassName:"flex flex-grow",containerId:"notification"}),e.n=5;break;case 4:e.p=4,e.v,u.oR.error((null==m?void 0:m.exportError)||"Failed to export data. Please try again.",{className:"bg-white-1.0 p-4 rounded border-l-8 shadow border-red-1.0 w-84",closeButton:!1,bodyClassName:"flex flex-grow",containerId:"notification"});case 5:return e.p=5,V(!1),e.f(5);case 6:return e.a(2)}},e,null,[[2,4,5,6]])}));return function(){return e.apply(this,arguments)}}();return 0===l.length?(0,h.jsxs)("div",{className:"mt-8",children:[(0,h.jsx)("h3",{className:"font-['Open_Sans'] text-[16px] font-semibold text-[#3D4148] mb-6",children:null==m?void 0:m.responseDataTitle}),(0,h.jsx)("div",{className:"flex flex-col items-center justify-center py-16 border border-dashed border-[#dddee2] rounded-lg",children:(0,h.jsx)("p",{className:"text-[#717182] text-[14px]",children:null==m?void 0:m.responseEmptyState})})]}):(0,h.jsxs)("div",{className:"mt-8 space-y-4",children:[(0,h.jsx)("div",{className:"flex items-center justify-between",children:(0,h.jsxs)("div",{children:[(0,h.jsx)("h3",{className:"font-['Open_Sans'] text-[16px] font-semibold text-[#3D4148]",children:null==m?void 0:m.responseDataTitle}),(0,h.jsxs)("p",{className:"text-[#717182] text-[13px] mt-1",children:[H.length," ",null==m?void 0:m.responsesCount," â¢"," ",null==m?void 0:m.responseLastUpdated," ",On(d,"MMM d, yyyy h:mm a")]})]})}),(0,h.jsx)(Tn,{availableVersions:Y,selectedVersions:x,onToggleVersion:function(e){!function(e){b(function(t){return t.includes(e)?t.filter(function(t){return t!==e}):[].concat((0,F.A)(t),[e])})}(e),P(0)},onClearVersions:function(){b([]),P(0)},dateRange:_,onDateRangeChange:function(e){O(e),P(0)},fields:i,visibleColumns:A,onToggleColumn:function(e){E(function(t){var r=new Set(t);return r.has(e)?r.delete(e):r.add(e),r})},searchQuery:j,onSearchChange:function(e){C(e),P(0)},onExport:$,isExporting:z,messages:m}),(0,h.jsxs)("div",{children:[(0,h.jsx)(Ln,{responses:Q,visibleFields:W,messages:m}),H.length>0&&(0,h.jsx)(_n,{pageIndex:B,pageSize:M,totalCount:H.length,onPageChange:P,onPageSizeChange:function(e){I(e),P(0)},messages:m})]})]})};function Un(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,a,s){var l=n&&n.prototype instanceof o?n:o,u=Object.create(l.prototype);return zn(u,"_invoke",function(r,n,a){var s,o,l,u=0,c=a||[],d=!1,p={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,r){return s=t,o=0,l=e,p.n=r,i}};function m(r,n){for(o=r,l=n,t=0;!d&&u&&!a&&t<c.length;t++){var a,s=c[t],m=p.p,f=s[2];r>
23?(a=f===n)&&(l=s[(o=s[4])?5:(o=3,3)],s[4]=s[5]=e):s[0]<=m&&((a=r<2&&m<s[1])?(o=0,p.v=n,p.n=s[1]):m<f&&(a=r<3||s[0]>n||n>f)&&(s[4]=r,s[5]=n,p.n=f,o=0))}if(a||r>1)return i;throw d=!0,n}return function(a,c,f){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&m(c,f),o=c,l=f;(t=o<2?e:l)||!d;){s||(o?o<3?(o>1&&(p.n=-1),m(o,l)):p.n=l:p.v=l);try{if(u=2,s){if(o||(a="next"),t=s[a]){if(!(t=t.call(s,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,o<2&&(o=0)}else 1===o&&(t=s.return)&&t.call(s),o<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),o=1);s=e}else if((t=(d=p.n<0)?l:r.call(n,p))!==i)break}catch(t){s=e,o=1,l=t}finally{u=1}}return{value:t,done:d}}}(r,a,s),!0),u}var i={};function o(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(zn(t={},n,function(){return this}),t),d=u.prototype=o.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,zn(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,zn(d,"constructor",u),zn(u,"constructor",l),l.displayName="GeneratorFunction",zn(u,a,"GeneratorFunction"),zn(d),zn(d,a,"Generator"),zn(d,n,function(){return this}),zn(d,"toString",function(){return"[object Generator]"}),(Un=function(){return{w:s,m:p}})()}function zn(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}zn=function(e,t,r,n){function s(t,r){zn(e,t,function(e){return this._invoke(t,r,e)})}t?a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(s("next",0),s("throw",1),s("return",2))},zn(e,t,r,n)}Gn.propTypes={moduleId:g().string,fields:g().arrayOf(g().shape({id:g().string.isRequired,name:g().string.isRequired,type:g().oneOf(["boolean","string","single-choice","number"]).isRequired,required:g().bool,choices:g().arrayOf(g().string)})),responses:g().arrayOf(g().shape({id:g().string.isRequired,phoneNumber:g().string.isRequired,callDate:g().instanceOf(Date).isRequired,version:g().string.isRequired,responses:g().object.isRequired})),lastUpdated:g().instanceOf(Date),messages:g().object};var Vn=function(e){return{id:e.id,name:e.field_name,question:e.field_question,type:"single_choice"===e.field_type?"single-choice":e.field_type,prompt:e.extraction_prompt,choices:e.choices||[],required:e.is_required,order:e.display_order}},Yn=function(e){return{field_name:e.name,field_question:e.question,field_type:"single-choice"===e.type?"single_choice":e.type,extraction_prompt:e.prompt,choices:"single-choice"===e.type?e.choices:void 0,is_required:e.required}},Hn=function(e){var t=e.moduleId,r=e.messages,s=function(e){var t,r,n,s,i,o,l=(arguments.length>1&&void 0!==arguments[1]?arguments[1]:{}).messages,u=void 0===l?{}:l,c=(0,Qr.jE)(),d=(0,Wr.I)({queryKey:["data-field-configs",e],queryFn:(t=(0,y.A)(Zr().m(function t(){var r;return Zr().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,Z(e);case 1:return r=t.v,t.a(2,r.data)}},t)})),function(){return t.apply(this,arguments)}),enabled:!!e,staleTime:12e4,retry:1}),p=(0,$r.n)({mutationFn:(r=(0,y.A)(Zr().m(function t(r){var n;return Zr().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,J(e,r);case 1:return n=t.v,t.a(2,n.data)}},t)})),function(e){return r.apply(this,arguments)}),onSuccess:function(){c.invalidateQueries({queryKey:["data-field-configs",e]}),ge.y8.success((null==u?void 0:u.fieldCreatedSuccess)||"Field created successfully")},onError:function(e){var t=en(e);ge.y8.error(t)}}),m=(0,$r.n)({mutationFn:(n=(0,y.A)(Zr().m(function e(t){var r,n,a;return Zr().w(function(e){for(;;)switch(e.n){case 0:return r=t.fieldId,n=t.data,e.n=1,ee(r,n);case 1:return a=e.v,e.a(2,a.data)}},e)})),function(e){return n.apply(this,arguments)}),onSuccess:function(){c.invalidateQueries({queryKey:["data-field-configs",e]}),ge.y8.success((null==u?void 0:u.fieldUpdatedSuccess)||"Field updated successfully")},onError:function(e){var t=en(e);ge.y8.error(t)}}),f=(0,$r.n)({mutationFn:(s=(0,y.A)(Zr().m(function e(t){var r;return Zr().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,te(t);case 1:return r=e.v,e.a(2,r.data)}},e)})),function(e){return s.apply(this,arguments)}),onSuccess:function(){c.invalidateQueries({queryKey:["data-field-configs",e]}),ge.y8.success((null==u?void 0:u.fieldDeletedSuccess)||"Field deleted successfully")},onError:function(e){var t=en(e);ge.y8.error(t)}}),g=(0,$r.n)({mutationFn:(o=(0,y.A)(Zr().m(function t(r){var n;return Zr().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,re(e,r);case 1:return n=t.v,t.a(2,n.data)}},t)})),function(e){return o.apply(this,arguments)}),onMutate:(i=(0,y.A)(Zr().m(function t(r){var n,a,s;return Zr().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,c.cancelQueries({queryKey:["data-field-configs",e]});case 1:return(n=c.getQueryData(["data-field-configs",e]))&&(a=new Map(n.map(function(e){return[e.id,e]})),s=r.map(function(e,t){var r=a.get(e);return r?Xr(Xr({},r),{},{display_order:t+1}):null}
2).filter(Boolean),c.setQueryData(["data-field-configs",e],s)),t.a(2,{previousFields:n})}},t)})),function(e){return i.apply(this,arguments)}),onError:function(t,r,n){null!=n&&n.previousFields&&c.setQueryData(["data-field-configs",e],n.previousFields);var a=en(t);ge.y8.error((null==u?void 0:u.reorderFailedError)||"Failed to reorder fields: ".concat(a))},onSettled:function(){c.invalidateQueries({queryKey:["data-field-configs",e]})}}),x=(0,a.useCallback)(function(e){return p.mutateAsync(e)},[p]),h=(0,a.useCallback)(function(e,t){return m.mutateAsync({fieldId:e,data:t})},[m]),b=(0,a.useCallback)(function(e){return f.mutateAsync(e)},[f]),v=(0,a.useCallback)(function(e){return g.mutateAsync(e)},[g]),D=(0,a.useCallback)(function(){c.invalidateQueries({queryKey:["data-field-configs",e]})},[c,e]);return{fields:d.data||[],isLoading:d.isLoading,isError:d.isError,error:d.error,isCreating:p.isPending,isUpdating:m.isPending,isDeleting:f.isPending,isReordering:g.isPending,isMutating:p.isPending||m.isPending||f.isPending||g.isPending,createError:p.error,updateError:m.error,deleteError:f.error,reorderError:g.error,createField:x,updateField:h,deleteField:b,reorderFields:v,revalidateFields:D}}(t,{messages:r}),i=s.fields,o=s.isLoading,l=s.isError,u=s.createField,c=s.updateField,d=s.deleteField,p=s.reorderFields,m=s.isMutating,f=(i||[]).map(Vn),g=function(e){var t,r,n,s,i,o,l,u,c=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},d=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).enabled,p=void 0===d||d,m=(0,Qr.jE)(),f=["data-submissions",e,c],g=(0,Wr.I)({queryKey:f,queryFn:(u=(0,y.A)(tn().m(function t(){var r;return tn().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,ne(e,c);case 1:return r=t.v,t.a(2,r.data)}},t)})),function(){return u.apply(this,arguments)}),enabled:!!e&&p,staleTime:6e4,retry:1,onError:function(e){var t=nn(e);ge.y8.error(t)}}),x=(0,a.useCallback)(function(){m.invalidateQueries({queryKey:["data-submissions",e]})},[m,e]);return{submissions:(null===(t=g.data)||void 0===t?void 0:t.results)||[],count:(null===(r=g.data)||void 0===r?void 0:r.count)||0,next:(null===(n=g.data)||void 0===n?void 0:n.next)||null,previous:(null===(s=g.data)||void 0===s?void 0:s.previous)||null,isLoading:g.isLoading,isError:g.isError,error:g.error,page:c.page||1,pageSize:c.page_size||50,totalPages:null!==(i=g.data)&&void 0!==i&&i.count?Math.ceil(g.data.count/(c.page_size||50)):0,hasNextPage:!(null===(o=g.data)||void 0===o||!o.next),hasPreviousPage:!(null===(l=g.data)||void 0===l||!l.previous),revalidateSubmissions:x}}(t,{page_size:100,ordering:"-call_date"}).submissions,x=(0,a.useMemo)(function(){return(g||[]).map(function(e){return function(e){var t,r={};(arguments.length>1&&void 0!==arguments[1]?arguments[1]:[]).forEach(function(e){r[e.name]=e.id});var a={};return e.extracted_data&&Object.entries(e.extracted_data).forEach(function(e){var t=(0,n.A)(e,2),s=t[0],i=t[1],o=r[s];o&&(a[o]=i)}),{id:e.id,phoneNumber:(null===(t=e.agent_call)||void 0===t?void 0:t.telephone)||"N/A",callDate:new Date(e.call_date),version:"v".concat(e.config_version),responses:a,status:e.processing_status}}(e,f)})},[g,f]),b=(0,a.useMemo)(function(){return g&&0!==g.length?g.reduce(function(e,t){var r=new Date(t.processed_at);return r>e?r:e},new Date(0)):new Date},[g]),v=(0,a.useState)(!1),D=(0,n.A)(v,2),j=D[0],C=D[1],N=(0,a.useState)(null),w=(0,n.A)(N,2),A=w[0],E=w[1],S=(0,a.useState)(!1),T=(0,n.A)(S,2),_=T[0],O=T[1],R=(0,a.useState)(null),k=(0,n.A)(R,2),B=k[0],P=k[1],q=function(e){var t,r,n,a,s,i,o=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},l=(arguments.length>2&&void 0!==arguments[2]?arguments[2]:{}).enabled,u=void 0===l||l,c=["data-submissions-stats",e,o],d=(0,Wr.I)({queryKey:c,queryFn:(i=(0,y.A)(tn().m(function t(){var r;return tn().w(function(t){for(;;)switch(t.n){case 0:return t.n=1,ae(e,o);case 1:return r=t.v,t.a(2,r.data)}},t)})),function(){return i.apply(this,arguments)}),enabled:!!e&&u,staleTime:12e4,retry:1,onError:function(e){var t=nn(e);ge.y8.error(t)}});return{stats:d.data||null,totalSubmissions:(null===(t=d.data)||void 0===t?void 0:t.total_submissions)||0,successRate:(null===(r=d.data)||void 0===r?void 0:r.success_rate)||0,statusDistribution:(null===(n=d.data)||void 0===n?void 0:n.status_distribution)||{},fieldValueDistributions:(null===(a=d.data)||void 0===a?void 0:a.field_value_distributions)||{},fieldSubmissionCounts:(null===(s=d.data)||void 0===s?void 0:s.field_submission_counts)||{},isLoading:d.isLoading,isError:d.isError,error:d.error}}(t,{},{enabled:_}),L=q.fieldSubmissionCounts,M=q.isLoading,I=(0,a.useState)(null),G=(0,n.A)(I,2),U=G[0],z=G[1],V=U||f,Y=function(){E(null),C(!0)},H=(0,a.useCallback)(function(e){var t=f.find(function(t){return t.id===e});t&&(E(t),C(!0))},[f]),Q=(0,a.useCallback)(function(e){var t=f.find(function(t){return t.id===e});t&&(P(t),O(!0))},[f]),W=(0,a.useCallback)(function(){var e=(0,y.A)(Un().m(function e(t){var r;return Un().w(function(e){for(;;)switch(e.n){case 0:if(r=Yn(t),!t.id){e.n=2;break}return e.n=1,c(t.id,r);case 1:e.n=3;break;case 2:return e.n=3,u(r);case 3:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),[u,c]),$=(0,a.useCallback)((0,y.A)(Un().m(function e(){return Un().w(function(e){for(;;)switch(e.n){case 0:if(B){e.n=1;break}return e.a(2);case 1:return e.n=2,d(B.id);case 2:O(!1),P(null);case 3:return e.a(2)}},e)})),[B,d]),K=(0,a.useCallback)(function(e,t){var r=U||f,n=(0,F.A)(r),a=n[e];n.splice(e,1),n.splice(t,0,a),z(n)},[f,U]),X=(0,a.useCallback)((0,y.A)(Un().m(function e(){var t;return Un().w(function(e){for(;;)switch(e.n){case 0:if(U){e.n=1;break}return e.a(2);case 1:return t=U.map(function(e){return e.id}),z(null),e.n=2,p(t);case 2:return e.a(2)}},e)})),[U,p]),se=function(){C(!1),E(null)},ie=f.filter(function(e){return!A||e.id!==A.id}).map(function(e){return e.name}),oe=function(){return(0,h.jsxs)("div",{className:"space-y-2",children:[(0,h.jsx)("h2",{className:"font-['Montserrat'] text-[24px] font-bold text-[#3d5d98]",children:null==r?void 0:r.dataTabulationTitle}),(0,h.jsx)("p",{className:"text-[#717182] text-[14px]",children:null==r?void 0:r.dataTabulationDescription})]})};return o?(0,h.jsxs)("div",{className:"space-y-6",children:[oe(),(0,h.jsxs)("div",{className:"flex flex-col items-center justify-center px-4 py-20",children:[(0,h.jsx)(Ve.A,{className:"h-8 w-8 animate-spin text-[#3d5d98]"}),(0,h.jsx)("p",{className:"mt-4 text-[#717182] text-[14px]",children:null==r?void 0:r.loading})]})]}):l?(0,h.jsxs)("div",{className:"space-y-6",children:[oe(),(0,h.jsx)("div",{className:"flex flex-col items-center justify-center px-4 py-20",children:(0,h.jsx)("p",{className:"text-red-500 text-[14px]",children:null==r?void 0:r.errorLoadingFields})})]}):0!==f.length||j?0===f.length&&j?(0,h.jsxs)("div",{className:"space-y-6",children:[oe(),(0,h.jsx)(bn,{onSave:function(){var e=(0,y.A)(Un().m(function e(t){return Un().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,W(t);case 1:se();case 2:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),onCancel:se,editField:A,existingFieldNames:ie,messages:r,isSaving:m})]}):(0,h.jsx)(Yr.Q,{backend:Hr.t2,children:(0,h.jsxs)("div",{className:"space-y-6",children:[(0,h.jsxs)("div",{className:"flex items-start justify-between",children:[oe(),(0,h.jsxs)(me.$,{onClick:Y,disabled:m,style:{backgroundColor:"#10b981"},className:"text-white hover:bg-[#059669] transition-colors duration-200 px-6 py-3 rounded-md disabled:opacity-50",children:[(0,h.jsx)(qt.A,{className:"w-4 h-4 mr-2"}),null==r?void 0:r.addField]})]}),j&&(0,h.jsx)(bn,{onSave:function(){var e=(0,y.A)(Un().m(function e(t){return Un().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,W(t);case 1:se();case 2:return e.a(2)}},e)}));return function(t){return e.apply(this,arguments)}}(),onCancel:se,editField:A,existingFieldNames:ie,messages:r,isSaving:m}),(0,h.jsx)("div",{className:"flex items-center justify-between",children:(0,h.jsxs)("h3",{className:"font-['Open_Sans'] text-[16px] font-semibold text-[#3D4148]",children:[null==r?void 0:r.dataFields," (",V.length,")"]})}),(0,h.jsx)("div",{className:"bg-white border border-[#dddee2] rounded-lg overflow-hidden",children:(0,h.jsxs)("table",{className:"w-full border-collapse",children:[(0,h.jsx)("thead",{children:(0,h.jsxs)("tr",{className:"bg-[#f1f2f7]",children:[(0,h.jsx)("th",{className:"px-4 py-3 text-left w-[60px] font-['Open_Sans'] text-[12px] font-semibold text-[#717182] uppercase tracking-wide",children:null==r?void 0:r.order}),(0,h.jsx)("th",{className:"px-4 py-3 text-left font-['Open_Sans'] text-[12px] font-semibold text-[#717182] uppercase tracking-wide",style:{width:"40%"},children:null==r?void 0:r.fieldName}),(0,h.jsx)("th",{className:"px-4 py-3 text-left w-[140px] font-['Open_Sans'] text-[12px] font-semibold text-[#717182] uppercase tracking-wide",children:null==r?void 0:r.type}),(0,h.jsx)("th",{className:"px-4 py-3 text-center w-[80px] font-['Open_Sans'] text-[12px] font-semibold text-[#717182] uppercase tracking-wide",children:null==r?void 0:r.req}),(0,h.jsx)("th",{className:"px-4 py-3 text-left w-[100px] font-['Open_Sans'] text-[12px] font-semibold text-[#717182] uppercase tracking-wide",children:null==r?void 0:r.actions})]})}),(0,h.jsx)("tbody",{children:V.map(function(e,t){return(0,h.jsx)(En,{field:e,index:t,moveRow:K,onDrop:X,onEdit:H,onDelete:Q,messages:r},e.id)})})]})}),(0,h.jsx)(Dn,{open:_,onOpenChange:O,fieldName:null==B?void 0:B.name,submissionCount:L[null==B?void 0:B.name]||0,isLoadingCount:M,onConfirm:$,messages:r}),f.length>0&&(0,h.jsx)(Gn,{moduleId:t,fields:f,responses:x,lastUpdated:b,messages:r})]})}):(0,h.jsxs)("div",{className:"space-y-6",children:[oe(),(0,h.jsxs)("div",{className:"flex flex-col items-center justify-center px-4 py-20",children:[(0,h.jsx)("div",{className:"mb-6",children:(0,h.jsx)(Vr.A,{className:"h-16 w-16 text-[#717182]",
2strokeWidth:1.5})}),(0,h.jsx)("h3",{className:"font-['Montserrat'] text-[20px] font-bold text-[#3D4148] mb-4",children:null==r?void 0:r.noDataFieldsConfigured}),(0,h.jsx)("p",{className:"text-[#717182] text-[14px] text-center mb-8 max-w-[400px]",style:{lineHeight:"1.6"},children:null==r?void 0:r.emptyStateDescription}),(0,h.jsxs)(me.$,{onClick:Y,style:{backgroundColor:"#10b981"},className:"text-white hover:bg-[#059669] transition-colors duration-200 px-6 py-3 rounded-md",children:[(0,h.jsx)(qt.A,{className:"w-4 h-4 mr-2"}),null==r?void 0:r.addFirstField]})]})]})};Hn.propTypes={moduleId:g().string.isRequired,messages:g().object.isRequired};var Qn=r(19869),Wn=function(e){var t,r,n=e.module,a=e.callerId,s=e.onCallerIdChange,i=e.messages,o=e.isUpdating,l=void 0!==o&&o,u=(null==n||null===(t=n.assigned_phones)||void 0===t?void 0:t.map(function(e){return{id:e.id,number:e.phone_number,name:e.phone_display_name}}))||[],c=u.find(function(e){return e.id===a});return(0,h.jsx)("div",{className:"bg-[#f1f2f7] p-4 rounded-lg border mt-[0px] mr-[0px] mb-[0px] border-[#dddee2]",children:(0,h.jsxs)("div",{className:"flex items-center justify-between",children:[(0,h.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,h.jsx)("div",{className:"w-10 h-10 rounded-lg bg-primary/10 flex items-center justify-center bg-[#dddee2]",children:(0,h.jsx)(Qn.A,{className:"text-primary w-5 h-5"})}),(0,h.jsxs)("div",{children:[(0,h.jsx)("h1",{className:"font-[Montserrat] text-[rgba(61,93,152,1)] text-[24px] font-bold",children:(null==n||null===(r=n.agent)||void 0===r?void 0:r.name)||n.name}),(0,h.jsx)("p",{className:"text-[#717182]",children:n.description})]})]}),u.length>0&&(0,h.jsxs)("div",{className:"min-w-[296px] rounded-[166px]",children:[(0,h.jsx)("p",{className:"text-xs text-[#717182] mb-2",children:i.assignedCallerId}),(0,h.jsxs)(p.l6,{value:a,onValueChange:s,disabled:l,children:[(0,h.jsx)(p.bq,{className:"border-primary/20 hover:border-primary/40 h-8 text-left transition-colors bg-white border-2",children:(0,h.jsx)(p.yv,{children:c&&(0,h.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,h.jsx)("span",{className:"font-mono font-medium",children:c.number}),(0,h.jsx)("span",{className:"text-[#717182]",children:"-"}),(0,h.jsx)("span",{className:"text-[#717182]",children:c.name})]})})}),(0,h.jsx)(p.gC,{children:u.map(function(e){return(0,h.jsx)(p.eb,{value:e.id,className:"p-3",children:(0,h.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,h.jsx)("span",{className:"font-mono font-medium",children:e.number}),(0,h.jsx)("span",{className:"text-[#717182]",children:"-"}),(0,h.jsx)("span",{children:e.name})]})},e.id)})})]})]})]})})};Wn.propTypes={module:g().shape({name:g().string,description:g().string,agent:g().shape({name:g().string,category:g().string}),assigned_phones:g().arrayOf(g().shape({id:g().string.isRequired,phone_number:g().string.isRequired,phone_display_name:g().string.isRequired,is_primary:g().bool,created_at:g().string}))}).isRequired,callerId:g().string.isRequired,onCallerIdChange:g().func.isRequired,messages:g().object.isRequired,isUpdating:g().bool};const $n=Wn;var Kn=function(e){var t,r=e.module,n=e.messages;return(0,h.jsxs)("div",{className:"p-6 bg-white border rounded-lg",children:[(0,h.jsx)("div",{className:"flex items-center justify-between mb-4",children:(0,h.jsxs)("div",{className:"flex items-center space-x-3",children:[(0,h.jsx)(C.A,{className:"w-5 h-5"}),(0,h.jsx)("span",{className:"font-semibold",children:n.moduleOverview})]})}),(0,h.jsxs)("div",{className:"grid grid-cols-3 gap-6 pt-4 border-t",children:[(0,h.jsxs)("div",{children:[(0,h.jsx)("p",{className:"text-sm text-[#717182] mb-1",children:n.category}),(0,h.jsx)("div",{className:"inline-flex items-center px-2 py-1 text-sm font-medium capitalize rounded",style:{backgroundColor:"#E1E7F3",color:"#2E477A"},children:n[null==r||null===(t=r.agent)||void 0===t?void 0:t.category]||r.category})]}),(0,h.jsxs)("div",{children:[(0,h.jsx)("p",{className:"text-sm text-[#717182] mb-1",children:n.lastUpdated}),(0,h.jsx)("p",{className:"font-medium",children:new Date(r.updated_at).toLocaleDateString("en-US",{month:"numeric",day:"numeric",year:"numeric"})})]}),(0,h.jsxs)("div",{children:[(0,h.jsx)("p",{className:"text-sm text-[#717182] mb-1",children:n.campaignsUsed}),(0,h.jsxs)("p",{className:"font-medium",children:[r.campaigns_count," ",1===r.campaigns_count?n.campaign:n.campaigns]})]})]})]})};
2Kn.propTypes={module:g().shape({category:g().string,updated_at:g().string,campaigns_count:g().number,agent:g().shape({category:g().string})}).isRequired,messages:g().object.isRequired};const Xn=Kn;var Zn,Jn=(Zn={},(0,T.A)((0,T.A)((0,T.A)((0,T.A)((0,T.A)((0,T.A)((0,T.A)((0,T.A)((0,T.A)((0,T.A)(Zn,1,"moduleCreated"),2,"moduleUpdated"),3,"moduleEnabled"),4,"moduleDisabled"),5,"successCriteriaUpdated"),6,"callSummaryPromptUpdated"),7,"escalationRuleCreated"),8,"escalationRuleUpdated"),9,"flowConfigurationSaved"),10,"escalationRuleAdded"),(0,T.A)((0,T.A)((0,T.A)((0,T.A)((0,T.A)((0,T.A)((0,T.A)((0,T.A)((0,T.A)((0,T.A)(Zn,11,"escalationRuleModified"),12,"escalationRuleDeleted"),20,"campaignCreated"),21,"campaignStarted"),22,"campaignPaused"),23,"campaignCompleted"),24,"campaignScheduled"),25,"campaignTcpaPaused"),26,"campaignTcpaResumed"),27,"campaignCreditPaused"),(0,T.A)(Zn,28,"campaignCreditResumed"));function ea(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,a,s){var l=n&&n.prototype instanceof o?n:o,u=Object.create(l.prototype);return ta(u,"_invoke",function(r,n,a){var s,o,l,u=0,c=a||[],d=!1,p={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,r){return s=t,o=0,l=e,p.n=r,i}};function m(r,n){for(o=r,l=n,t=0;!d&&u&&!a&&t<c.length;t++){var a,s=c[t],m=p.p,f=s[2];r>3?(a=f===n)&&(l=s[(o=s[4])?5:(o=3,3)],s[4]=s[5]=e):s[0]<=m&&((a=r<2&&m<s[1])?(o=0,p.v=n,p.n=s[1]):m<f&&(a=r<3||s[0]>n||n>f)&&(s[4]=r,s[5]=n,p.n=f,o=0))}if(a||r>1)return i;throw d=!0,n}return function(a,c,f){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&m(c,f),o=c,l=f;(t=o<2?e:l)||!d;){s||(o?o<3?(o>1&&(p.n=-1),m(o,l)):p.n=l:p.v=l);try{if(u=2,s){if(o||(a="next"),t=s[a]){if(!(t=t.call(s,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,o<2&&(o=0)}else 1===o&&(t=s.return)&&t.call(s),o<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),o=1);s=e}else if((t=(d=p.n<0)?l:r.call(n,p))!==i)break}catch(t){s=e,o=1,l=t}finally{u=1}}return{value:t,done:d}}}(r,a,s),!0),u}var i={};function o(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(ta(t={},n,function(){return this}),t),d=u.prototype=o.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,ta(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,ta(d,"constructor",u),ta(u,"constructor",l),l.displayName="GeneratorFunction",ta(u,a,"GeneratorFunction"),ta(d),ta(d,a,"Generator"),ta(d,n,function(){return this}),ta(d,"toString",function(){return"[object Generator]"}),(ea=function(){return{w:s,m:p}})()}function ta(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}ta=function(e,t,r,n){function s(t,r){ta(e,t,function(e){return this._invoke(t,r,e)})}t?a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(s("next",0),s("throw",1),s("return",2))},ta(e,t,r,n)}const ra=function(){var e=(0,a.useState)([]),t=(0,n.A)(e,2),r=t[0],s=t[1],i=(0,a.useState)(!0),o=(0,n.A)(i,2),l=o[0],u=o[1],c=(0,a.useState)(null),d=(0,n.A)(c,2),p=d[0],f=d[1],g=(0,m.F7)().language,x=le[g],b=(0,a.useCallback)(function(e,t){var r=Jn[e];return x[r]||t||x.configurationChanged},[x]),v=(0,a.useCallback)(function(e){var t=new Date,r=new Date(e),n=Math.floor((t-r)/6e4);if(n<60)return n<=1?x.justNow:"".concat(n," ").concat(1===n?x.minuteAgo:x.minutesAgo);if(n<1440){var a=Math.floor(n/60);return"".concat(a," ").concat(1===a?x.hourAgo:x.hoursAgo)}var s=Math.floor(n/1440);return"".concat(s," ").concat(1===s?x.dayAgo:x.daysAgo)},[x]);return(0,a.useEffect)(function(){var e=function(){var e=(0,y.A)(ea().m(function e(){var t,r,n,a,i;return ea().w(function(e){for(;;)switch(e.p=e.n){case 0:return e.p=0,u(!0),f(null),e.n=1,Y();case 1:t=e.v,r=t.data,n=r.recent_changes||[],a=n.map(function(e){return{id:e.id,changeType:e.change_type,action:b(e.change_type,e.title),details:e.related_object_display,user:e.user_name,time:v(e.created_at),createdAt:e.created_at,objectDetails:e.object_details_snapshot}}),s(a),e.n=3;break;case 2:e.p=2,i=e.v,f(i.message||x.failedToFetchRecentChanges);case 3:return e.p=3,u(!1),e.f(3);case 4:return e.a(2)}},e,null,[[0,2,3,4]])}));return function(){return e.apply(this,arguments)}}();e()},[v,b,x.failedToFetchRecentChanges]),(0,h.jsxs)("div",{className:"bg-white border rounded-lg",children:[(0,h.jsxs)("div",{className:"p-6 pb-4",children:[(0,h.jsxs)("div",{className:"flex items-center mb-2 space-x-2",children:[(0,h.jsx)(j.A,{className:"w-5 h-5"}),(0,h.jsx)("span",{className:"font-semibold",children:x.recentConfigurationChanges})]}),(0,h.jsx)("p",{className:"text-sm text-[#717182]",children:x.latestUpdatesAndModifications})]}),(0,h.jsx)("div",{className:"px-6 pb-6",children:l?(0,h.jsx)("div",{className:"flex items-center justify-center h-32",children:(0,h.jsx)("div",{className:"animate-spin rounded-full h-6 w-6 border-b-2 border-[#3d5d98]"})}):p?(0,h.jsxs)("div",{className:"py-4 text-center",children:[(0,h.jsx)("p",{className:"mb-2 text-sm text-red-600",children:x.errorLoadingRecentChanges}),(0,h.jsx)("p",{className:"text-xs text-[#717182]",children:p})]}):r.length?(0,h.jsx)("div",{className:"space-y-4",children:r.map(function(e){return(0,h.jsxs)("div",{className:"flex space-x-4",children:[(0,h.jsx)("div",{className:"flex-shrink-0 w-2 h-2 mt-2 rounded-full bg-[#3d5d98]"}),(0,h.jsxs)("div",{className:"flex-1 min-w-0",children:[(0,h.jsxs)("div",{className:"flex items-center justify-between",children:[(0,h.jsx)("p",{className:"font-bold",children:e.action}),(0,h.jsxs)("div",{className:"flex items-center space-x-2",children:[(0,h.jsx)("span",{className:"text-xs text-[#717182]",children:e.user}),(0,h.jsx)("span",{className:"text-xs text-[#717182]",children:e.time})]})]}),(0,h.jsx)("p",{className:"text-sm text-[#717182]",children:e.details})]})]},e.id)})}):(0,h.jsx)("div",{className:"py-8 text-center",children:(0,h.jsx)("p",{className:"text-sm text-[#717182]",children:x.noRecentChangesFound})})})]})};function na(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,a,s){var l=n&&n.prototype instanceof o?n:o,u=Object.create(l.prototype);return aa(u,"_invoke",function(r,n,a){var s,o,l,u=0,c=a||[],d=!1,p={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,r){return s=t,o=0,l=e,p.n=r,i}};function m(r,n){for(o=r,l=n,t=0;!d&&u&&!a&&t<c.length;t++){var a,s=c[t],m=p.p,f=s[2];r>
23?(a=f===n)&&(l=s[(o=s[4])?5:(o=3,3)],s[4]=s[5]=e):s[0]<=m&&((a=r<2&&m<s[1])?(o=0,p.v=n,p.n=s[1]):m<f&&(a=r<3||s[0]>n||n>f)&&(s[4]=r,s[5]=n,p.n=f,o=0))}if(a||r>1)return i;throw d=!0,n}return function(a,c,f){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&m(c,f),o=c,l=f;(t=o<2?e:l)||!d;){s||(o?o<3?(o>1&&(p.n=-1),m(o,l)):p.n=l:p.v=l);try{if(u=2,s){if(o||(a="next"),t=s[a]){if(!(t=t.call(s,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,o<2&&(o=0)}else 1===o&&(t=s.return)&&t.call(s),o<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),o=1);s=e}else if((t=(d=p.n<0)?l:r.call(n,p))!==i)break}catch(t){s=e,o=1,l=t}finally{u=1}}return{value:t,done:d}}}(r,a,s),!0),u}var i={};function o(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(aa(t={},n,function(){return this}),t),d=u.prototype=o.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,aa(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,aa(d,"constructor",u),aa(u,"constructor",l),l.displayName="GeneratorFunction",aa(u,a,"GeneratorFunction"),aa(d),aa(d,a,"Generator"),aa(d,n,function(){return this}),aa(d,"toString",function(){return"[object Generator]"}),(na=function(){return{w:s,m:p}})()}function aa(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}aa=function(e,t,r,n){function s(t,r){aa(e,t,function(e){return this._invoke(t,r,e)})}t?a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(s("next",0),s("throw",1),s("return",2))},aa(e,t,r,n)}const sa=function(){var e=(0,l.g)().moduleId,t=(0,l.W6)(),r=(0,m.Ff)(le),i=(0,a.useState)("activity"),o=(0,n.A)(i,2),c=o[0],d=o[1],p=(0,a.useState)("overview"),f=(0,n.A)(p,2),g=f[0],x=f[1],b=(0,a.useState)(""),v=(0,n.A)(b,2),N=v[0],F=v[1],S=(0,a.useState)(!1),T=(0,n.A)(S,2),_=T[0],O=T[1],R=(0,a.useState)(""),k=(0,n.A)(R,2),B=k[0],P=k[1],L=(0,a.useState)(!1),M=(0,n.A)(L,2),I=M[0],G=M[1],U=(0,a.useState)(!1),z=(0,n.A)(U,2),V=z[0],Y=z[1],Q=function(e){var t=(0,a.useState)(null),r=(0,n.A)(t,2),s=r[0],i=r[1],o=(0,a.useState)(!0),l=(0,n.A)(o,2),u=l[0],c=l[1],d=(0,a.useState)(!1),p=(0,n.A)(d,2),m=p[0],f=p[1];return(0,a.useEffect)(function(){var t=function(){var t=(0,y.A)(ie().m(function t(){var r;return ie().w(function(t){for(;;)switch(t.p=t.n){case 0:if(e){t.n=1;break}return c(!1),t.a(2);case 1:return t.p=1,c(!0),f(!1),t.n=2,q(e);case 2:r=t.v,i(r.data),t.n=4;break;case 3:t.p=3,t.v,f(!0);case 4:return t.p=4,c(!1),t.f(4);case 5:return t.a(2)}},t,null,[[1,3,4,5]])}));return function(){return t.apply(this,arguments)}}();t()},[e]),{module:s,isLoading:u,isError:m}}(e),W=Q.module,$=Q.isLoading,K=Q.isError;(0,a.useEffect)(function(){var e;(null==W||null===(e=W.assigned_phones)||void 0===e?void 0:e.length)>0&&!N&&F(W.assigned_phones[0].id)},[W,N]),(0,a.useEffect)(function(){K&&u.oR.error(r.errorLoadingModule,{className:"bg-white-1.0 p-4 rounded border-l-8 shadow border-red-1.0 w-84",closeButton:!1,bodyClassName:"flex flex-grow",containerId:"notification"})},[K,r.errorLoadingModule]);var X=function(){t.push("/app/outreach/modules")},Z=function(){var t=(0,y.A)(na().m(function t(n){var a;return na().w(function(t){for(;;)switch(t.p=t.n){case 0:if(!_){t.n=1;break}return t.a(2);case 1:return a=N,F(n),O(!0),t.p=2,t.n=3,H(e,n);case 3:u.oR.success(r.primaryPhoneUpdated||"Primary phone updated successfully",{className:"bg-white-1.0 p-4 rounded border-l-8 shadow border-green-1.0 w-84",closeButton:!1,bodyClassName:"flex flex-grow",containerId:"notification"}),t.n=5;break;case 4:t.p=4,t.v,F(a),u.oR.error(r.errorUpdatingPrimaryPhone||"Error updating primary phone",{className:"bg-white-1.0 p-4 rounded border-l-8 shadow border-red-1.0 w-84",closeButton:!1,bodyClassName:"flex flex-grow",containerId:"notification"});case 5:return t.p=5,O(!1),t.f(5);case 6:return t.a(2)}},t,null,[[2,4,5,6]])}));return function(e){return t.apply(this,arguments)}}();return(0,a.useEffect)(function(){var t=function(){var t=(0,y.A)(na().m(function t(){var n,a,s;return na().w(function(t){for(;;)switch(t.p=t.n){case 0:if("analytics"!==c||!e){t.n=5;break}return G(!0),Y(!1),t.p=1,n="https://brainhi.metabaseapp.com",t.n=2,(0,E.u3)(2135,!1);
2case 2:a=t.v,s="".concat(n,"/embed/dashboard/").concat(a.dashboard_token,"#theme=transparent&bordered=false&titled=true"),P(s),t.n=4;break;case 3:t.p=3,t.v,Y(!0),u.oR.error(r.errorLoadingAnalytics||"Error loading analytics dashboard",{className:"bg-white-1.0 p-4 rounded border-l-8 shadow border-red-1.0 w-84",closeButton:!1,bodyClassName:"flex flex-grow",containerId:"notification"});case 4:return t.p=4,G(!1),t.f(4);case 5:return t.a(2)}},t,null,[[1,3,4,5]])}));return function(){return t.apply(this,arguments)}}();t()},[c,e,r]),$?(0,h.jsx)("div",{className:"view-width bg-brand-primary-light-6 flex flex-col h-full",children:(0,h.jsx)("div",{className:"flex flex-col flex-grow flex-shrink-0",children:(0,h.jsx)(s.DotBricksLoading,{})})}):K||!W?(0,h.jsx)("div",{className:"view-width bg-brand-primary-light-6 flex flex-col h-full",children:(0,h.jsxs)("div",{className:"flex flex-col items-center justify-center h-64",children:[(0,h.jsx)("p",{className:"text-gray-700",children:r.errorLoadingModule}),(0,h.jsx)("button",{onClick:X,type:"button",className:"hover:text-blue-700 mt-4 font-medium text-blue-600",children:r.backToModuleSettings})]})}):(0,h.jsxs)("div",{className:"view-width bg-brand-primary-light-6 flex flex-col h-full",children:[(0,h.jsx)("div",{className:"shrink-0 border-border relative w-full bg-white border-b",children:(0,h.jsx)("div",{className:"size-full relative",children:(0,h.jsx)("div",{className:"box-border content-stretch flex gap-4 items-start justify-start relative w-full px-[80px] py-[16px]",children:(0,h.jsx)("div",{className:"font-['Montserrat:Bold',_sans-serif] font-bold leading-[0] relative shrink-0 text-brand-primary text-[24px] text-nowrap",children:(0,h.jsx)("p",{className:"font-['Open_Sans'] font-semibold text-[20px] leading-[25px] whitespace-pre text-action-secondary-dark-2",children:r.moduleSettings})})})})}),(0,h.jsxs)("div",{className:"flex flex-col flex-1 p-8 overflow-y-auto",children:[(0,h.jsxs)("button",{type:"button",onClick:X,className:"hover:text-gray-900 w-fit flex items-center mb-6 text-gray-600",children:[(0,h.jsx)(D.A,{className:"w-4 h-4 mr-2"}),r.backToModuleSettings]}),(0,h.jsx)($n,{module:W,callerId:N,onCallerIdChange:Z,messages:r,isUpdating:_}),(0,h.jsxs)(A.tU,{value:c,onValueChange:d,className:"w-full my-6",children:[(0,h.jsx)("div",{className:"mb-6",children:(0,h.jsxs)(A.j7,{className:"bg-action-secondary-light-5 grid w-full grid-cols-3",children:[(0,h.jsxs)(A.Xi,{value:"activity",children:[(0,h.jsx)(j.A,{className:"w-4 h-4 mr-2"}),r.activity]}),(0,h.jsxs)(A.Xi,{value:"settings",children:[(0,h.jsx)(C.A,{className:"w-4 h-4 mr-2"}),r.settings]}),(0,h.jsxs)(A.Xi,{value:"analytics",children:[(0,h.jsx)(w,{className:"w-4 h-4 mr-2"}),r.analytics]})]})}),(0,h.jsx)(A.av,{value:"activity",children:(0,h.jsx)(Ct,{module:W,moduleId:e})}),(0,h.jsx)(A.av,{value:"settings",children:(0,h.jsxs)(A.tU,{value:g,onValueChange:function(e){x(e)},className:"w-full",children:[(0,h.jsx)("div",{className:"mb-6",children:(0,h.jsxs)(A.j7,{className:"bg-action-secondary-light-5 grid w-full grid-cols-6 gap-0",children:[(0,h.jsx)(A.Xi,{value:"overview",className:"px-4",children:r.overview}),(0,h.jsx)(A.Xi,{value:"automations",className:"px-4",children:r.automations}),(0,h.jsx)(A.Xi,{value:"dataTabulation",className:"px-4",children:r.dataTabulation||"Data Tabulation"}),(0,h.jsx)(A.Xi,{value:"calllog",className:"px-4",children:r.callLogAndSuccess}),(0,h.jsx)(A.Xi,{value:"escalation",className:"px-4",children:r.escalationRules}),(0,h.jsx)(A.Xi,{value:"testing",className:"px-4",children:r.testing})]})}),(0,h.jsxs)(A.av,{value:"overview",className:"space-y-6",children:[(0,h.jsx)(Xn,{module:W,messages:r}),(0,h.jsx)(ra,{})]}),(0,h.jsx)(A.av,{value:"automations",className:"space-y-6",children:(0,h.jsx)(zr,{moduleId:W.id,messages:r})}),(0,h.jsx)(A.av,{value:"dataTabulation",className:"space-y-6",children:(0,h.jsx)(Hn,{moduleId:W.id,messages:r})}),(0,h.jsx)(A.av,{value:"calllog",className:"space-y-6",children:(0,h.jsx)(_t,{moduleId:W.id,initialCallLogPrompt:W.call_summary_prompt,successCriteriaPrompt:W.success_criteria_prompt})}),(0,h.jsx)(A.av,{value:"escalation",className:"space-y-6",children:(0,h.jsx)(Yt,{escalationRules:W.escalation_rules||[],messages:r,moduleId:W.id})}),(0,h.jsx)(A.av,{value:"testing",className:"space-y-6",children:(0,h.jsx)("div",{className:"p-8 text-center bg-white border rounded-lg",children:(0,h.jsx)("p",{className:"text-gray-500",children:r.testingContent})})})]})}),(0,h.jsx)(A.av,{value:"analytics",children:(0,h.jsx)(Qt,{analyticsLoading:I,analyticsError:V,iframeUrl:B,messages:r,onRetry:function(){Y(!1);var e=c;d("settings"),setTimeout(function(){return d(e)},100)}})})]})]})]})},ia=(0,N.A)("power",[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]]);var oa=r(96640),la=function(e){var t=e.claimedCount,r=void 0===t?0:t,n=e.activeCount,a=void 0===n?0:n,s=e.claimedLabel,i=void 0===s?"Claimed":s,o=e.activeLabel,l=void 0===o?"Active":o,u=(0,oa.A)().language,c=le[u];return(0,h.jsxs)("div",{className:"flex items-center gap-6 px-4 py-3 bg-white border border-gray-100 rounded-lg",children:[(0,h.jsx)(un.Bc,{children:(0,h.jsxs)(un.m_,{children:[(0,h.jsx)(un.k$,{asChild:!0,children:(0,h.jsxs)("div",{className:"cursor-help flex items-center gap-2",children:[(0,h.jsx)("div",{className:"bg-blue-100 p-1.5 rounded-full",children:(0,h.jsx)(C.A,{className:"w-3 h-3 text-blue-600"})}),(0,h.jsxs)("div",{className:"text-right",children:[(0,h.jsx)("div",{className:"text-lg font-semibold text-gray-900",children:r}),(0,h.jsx)("div",{className:"text-xs leading-none text-gray-500",children:i})]})]})}),(0,h.jsx)(un.ZI,{children:(0,h.jsx)("p",{children:c.claimedModulesTooltip})})]})}),(0,h.jsx)("div",{className:"w-px h-8 bg-gray-200"}),(0,h.jsxs)("div",{className:"flex items-center gap-2",children:[(0,h.jsx)("div",{className:"p-1.5 rounded-full bg-[#E7E1F3]",children:(0,h.jsx)(ia,{className:"w-3 h-3 text-[#593C99]"})}),(0,h.jsxs)("div",{className:"text-right",children:[(0,h.jsx)("div",{className:"text-lg font-semibold text-gray-900",children:a}),(0,h.jsx)("div",{className:"text-xs leading-none text-gray-500",children:l})]})]})]})};la.propTypes={claimedCount:g().number,activeCount:g().number,claimedLabel:g().string,activeLabel:g().string};const ua=la;function ca(){var e,t,r="function"==typeof Symbol?Symbol:{},n=r.iterator||"@@iterator",a=r.toStringTag||"@@toStringTag";function s(r,n,a,s){var l=n&&n.prototype instanceof o?n:o,u=Object.create(l.prototype);return da(u,"_invoke",function(r,n,a){var s,o,l,u=0,c=a||[],d=!1,p={p:0,n:0,v:e,a:m,f:m.bind(e,4),d:function(t,r){return s=t,o=0,l=e,p.n=r,i}};function m(r,n){for(o=r,l=n,t=0;!d&&u&&!a&&t<c.length;t++){var a,s=c[t],m=p.p,f=s[2];r>
23?(a=f===n)&&(l=s[(o=s[4])?5:(o=3,3)],s[4]=s[5]=e):s[0]<=m&&((a=r<2&&m<s[1])?(o=0,p.v=n,p.n=s[1]):m<f&&(a=r<3||s[0]>n||n>f)&&(s[4]=r,s[5]=n,p.n=f,o=0))}if(a||r>1)return i;throw d=!0,n}return function(a,c,f){if(u>1)throw TypeError("Generator is already running");for(d&&1===c&&m(c,f),o=c,l=f;(t=o<2?e:l)||!d;){s||(o?o<3?(o>1&&(p.n=-1),m(o,l)):p.n=l:p.v=l);try{if(u=2,s){if(o||(a="next"),t=s[a]){if(!(t=t.call(s,l)))throw TypeError("iterator result is not an object");if(!t.done)return t;l=t.value,o<2&&(o=0)}else 1===o&&(t=s.return)&&t.call(s),o<2&&(l=TypeError("The iterator does not provide a '"+a+"' method"),o=1);s=e}else if((t=(d=p.n<0)?l:r.call(n,p))!==i)break}catch(t){s=e,o=1,l=t}finally{u=1}}return{value:t,done:d}}}(r,a,s),!0),u}var i={};function o(){}function l(){}function u(){}t=Object.getPrototypeOf;var c=[][n]?t(t([][n]())):(da(t={},n,function(){return this}),t),d=u.prototype=o.prototype=Object.create(c);function p(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,u):(e.__proto__=u,da(e,a,"GeneratorFunction")),e.prototype=Object.create(d),e}return l.prototype=u,da(d,"constructor",u),da(u,"constructor",l),l.displayName="GeneratorFunction",da(u,a,"GeneratorFunction"),da(d),da(d,a,"Generator"),da(d,n,function(){return this}),da(d,"toString",function(){return"[object Generator]"}),(ca=function(){return{w:s,m:p}})()}function da(e,t,r,n){var a=Object.defineProperty;try{a({},"",{})}catch(e){a=0}da=function(e,t,r,n){function s(t,r){da(e,t,function(e){return this._invoke(t,r,e)})}t?a?a(e,t,{value:r,enumerable:!n,configurable:!n,writable:!n}):e[t]=r:(s("next",0),s("throw",1),s("return",2))},da(e,t,r,n)}const pa=function(){var e=(0,l.g)().moduleId,t=(0,l.W6)(),r=(0,m.F7)().language,f=le[r],g=(0,a.useState)(""),x=(0,n.A)(g,2),b=x[0],D=x[1],j=(0,a.useState)("all"),C=(0,n.A)(j,2),N=C[0],w=C[1],A=function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},r=(0,Qr.jE)(),n=(0,Wr.I)({queryKey:["agent-modules",t],queryFn:(e=(0,y.A)(ca().m(function e(){var r;return ca().w(function(e){for(;;)switch(e.n){case 0:return e.n=1,P(t);case 1:return r=e.v,e.a(2,r.data)}},e)})),function(){return e.apply(this,arguments)}),staleTime:3e5,retry:1}),s=(0,a.useCallback)(function(){r.invalidateQueries({queryKey:["agent-modules"]})},[r]);return{modules:n.data,isLoading:n.isLoading,isError:n.isError,error:n.error,revalidateModules:s}}(),E=A.modules,F=A.isLoading,S=A.isError;if((0,a.useEffect)(function(){S&&u.oR.error(f.errorLoadingModules,{className:"bg-white-1.0 p-4 rounded border-l-8 shadow border-red-1.0 w-84",closeButton:!1,bodyClassName:"flex flex-grow",containerId:"notification"})},[S,f.errorLoadingModules]),e)return(0,h.jsx)(sa,{});var T=(null==E?void 0:E.map(function(e){var t,r;return{id:e.id,title:(null==e||null===(t=e.agent)||void 0===t?void 0:t.name)||e.title,tag:f[null==e||null===(r=e.agent)||void 0===r?void 0:r.category]||e.category,description:e.description||"",updatedDate:new Date(e.updated_at).toLocaleDateString("en-US",{month:"numeric",day:"numeric",year:"numeric"}),campaignsCount:e.campaigns_count,status:e.is_enabled?"enabled":"disabled"}}))||[],_=T.filter(function(e){var t=e.title.toLowerCase().includes(b.toLowerCase())||e.description.toLowerCase().includes(b.toLowerCase()),r="all"===N||N===f.enabled&&"enabled"===e.status||N===f.disabled&&"disabled"===e.status;return t&&r}),O=T.filter(function(e){return"enabled"===e.status}).length;return(0,h.jsxs)("div",{className:"view-width bg-brand-primary-light-6 flex flex-col h-full",children:[(0,h.jsx)("div",{className:"shrink-0 border-border relative w-full bg-white border-b",children:(0,h.jsx)("div",{className:"size-full relative",children:(0,h.jsx)("div",{className:"box-border content-stretch flex gap-4 items-start justify-start relative w-full px-[80px] py-[16px]",children:(0,h.jsx)("div",{className:"font-['Montserrat:Bold',_sans-serif] font-bold leading-[0] relative shrink-0 text-[#3d5d98] text-[24px] text-nowrap",children:(0,h.jsx)("p",{className:"font-['Open_Sans'] font-semibold text-[20px] leading-[25px] whitespace-pre text-[#3D4148]",children:f.moduleSettings})})})})}),(0,h.jsx)("div",{className:"flex flex-col flex-1 p-8 overflow-y-auto",children:(0,h.jsxs)("div",{className:"mb-8",children:[(0,h.jsxs)("div",{className:"mb-6",children:[(0,h.jsxs)("div",{className:"flex items-start justify-between mb-6",children:[(0,h.jsxs)("div",{children:[(0,h.jsxs)("div",{className:"flex items-center mb-2 space-x-3",children:[(0,h.jsx)("h1",{className:"font-[Montserrat] text-[rgba(61,93,152,1)] text-[24px] font-bold",children:f.yourModules}),(0,h.jsxs)(c.E,{className:"bg-[#E7E1F3] text-[#593C99] border-[#593C99]/20",variant:"outline",children:[(0,h.jsx)(i.A,{className:"w-3 h-3 mr-1"}),"AI"]})]}),(0,h.jsx)("p",{className:"text-muted-foreground",children:f.yourModulesDescription})]}),(0,h.jsx)(ua,{claimedCount:0,activeCount:O,claimedLabel:f.claimed,activeLabel:f.active})]}),(0,h.jsxs)("div",{className:"sm:flex-row flex flex-col gap-4 mb-6",children:[(0,h.jsxs)("div",{className:"relative flex-1",children:[(0,h.jsx)(o.A,{className:"left-3 top-3 text-muted-foreground absolute w-4 h-4"}),(0,h.jsx)(d.p,{placeholder:f.searchPlaceholder,value:b,onChange:function(e){return D(e.target.value)},className:"pl-9 bg-white"})]}),(0,h.jsxs)(p.l6,{value:N,onValueChange:w,children:[(0,h.jsx)(p.bq,{className:"w-full sm:w-[150px]",children:(0,h.jsx)(p.yv,{})}),(0,h.jsxs)(p.gC,{children:[(0,h.jsx)(p.eb,{value:"all",children:f.allStatus}),(0,h.jsx)(p.eb,{value:f.enabled,children:f.enabled}),(0,h.jsx)(p.eb,{value:f.disabled,children:f.disabled})]})]})]})]}),F?(0,h.jsx)("div",{className:"flex flex-col flex-grow flex-shrink-0",children:(0,h.jsx)(s.DotBricksLoading,{})}):(0,h.jsx)("div",{className:"lg:grid-cols-2 grid grid-cols-1 gap-6",children:_.map(function(e){return(0,h.jsx)(v,{title:e.title,tag:e.tag,description:e.description,updatedDate:e.updatedDate,campaignsCount:e.campaignsCount,status:e.status,updatedLabel:f.updated,campaignsLabel:1===e.campaignsCount?f.campaign:f.campaigns,enabledLabel:f.enabled,disabledLabel:f.disabled,onClick:function(){return function(e){t.push("/app/outreach/modules/".concat(e.id))}(e)}},e.id)})}),0===_.length&&!F&&(0,h.jsx)("div",{className:"py-12 text-center",children:(0,h.jsx)("p",{className:"text-gray-500",children:f.noModulesFound})})]})})]})}},50180:(e,t,r)=>{r.d(t,{A:()=>n});const n=(0,r(9407).A)("circle-x",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])},74967:(e,t,r)=>{r.d(t,{BT:()=>y,Wu:()=>D,ZB:()=>v,Zp:()=>h,aR:()=>b});var n=r(64467),a=r(80045),s=r(96540),i=r(5556),o=r.n(i),l=r(71300),u=r(74848),c=["className"],d=["className"],p=["className"],m=["className"],f=["className"];function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};
2t%2?g(Object(r),!0).forEach(function(t){(0,n.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var h=(0,s.forwardRef)(function(e,t){var r=e.className,n=void 0===r?"":r,s=(0,a.A)(e,c);return(0,u.jsx)("div",x({ref:t,"data-slot":"card",className:(0,l.cn)("bg-card text-card-foreground flex flex-col gap-6 rounded-xl border py-6 shadow-sm",n)},s))});h.displayName="Card",h.propTypes={className:o().string};var b=function(e){var t=e.className,r=void 0===t?"":t,n=(0,a.A)(e,d);return(0,u.jsx)("div",x({"data-slot":"card-header",className:(0,l.cn)("@container/card-header grid auto-rows-min grid-rows-[auto_auto] items-start gap-1.5 px-6 has-data-[slot=card-action]:grid-cols-[1fr_auto] [.border-b]:pb-6",r)},n))};b.propTypes={className:o().string};var v=function(e){var t=e.className,r=void 0===t?"":t,n=(0,a.A)(e,p);return(0,u.jsx)("div",x({"data-slot":"card-title",className:(0,l.cn)("leading-none font-semibold",r)},n))};v.propTypes={className:o().string};var y=function(e){var t=e.className,r=void 0===t?"":t,n=(0,a.A)(e,m);return(0,u.jsx)("div",x({"data-slot":"card-description",className:(0,l.cn)("text-muted-foreground text-sm",r)},n))};y.propTypes={className:o().string},o().string;var D=function(e){var t=e.className,r=(0,a.A)(e,f);return(0,u.jsx)("div",x({"data-slot":"card-content",className:(0,l.cn)("px-6",t)},r))};D.propTypes={className:o().string},o().string},80333:(e,t,r)=>{r.d(t,{Xi:()=>D,av:()=>j,j7:()=>y,tU:()=>v});var n=r(64467),a=r(80045),s=r(22732),i=r(5556),o=r.n(i),l=r(44514),u=r(71300),c=r(74848),d=["className"],p=["className","variant"],m=["className","variant"],f=["className"];function g(e,t){var r=Object.keys(e);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(e);t&&(n=n.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),r.push.apply(r,n)}return r}function x(e){for(var t=1;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?g(Object(r),!0).forEach(function(t){(0,n.A)(e,t,r[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):g(Object(r)).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))})}return e}var h=(0,s.F)("inline-flex items-center justify-center",{variants:{variant:{default:"bg-gray-100 text-gray-600 h-9 w-fit rounded-xl p-[3px]",underlined:"w-full bg-transparent border-b border-gray-200 rounded-none p-0 h-auto gap-0"}},defaultVariants:{variant:"default"}}),b=(0,s.F)("focus-visible:ring-gray-400 focus-visible:outline-none inline-flex flex-1 items-center justify-center gap-1.5 text-sm font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",{variants:{variant:{default:"data-[state=active]:bg-white data-[state=active]:text-gray-900 text-gray-700 h-[calc(100%-1px)] rounded-xl border border-transparent px-2 py-1",underlined:"data-[state=active]:border-brand-primary data-[state=active]:text-brand-primary text-action-secondary border-action-secondary border-b-[6px] rounded-none px-4 py-2 hover:border-brand-primary/50 hover:bg-brand-primary/10"}},defaultVariants:{variant:"default"}}),v=function(e){var t=e.className,r=void 0===t?"":t,n=(0,a.A)(e,d);return(0,c.jsx)(l.bL,x({"data-slot":"tabs",className:(0,u.cn)("flex flex-col gap-2",r)},n))};v.propTypes={className:o().string};var y=function(e){var t=e.className,r=void 0===t?"":t,n=e.variant,s=void 0===n?"default":n,i=(0,a.A)(e,p);return(0,c.jsx)(l.B8,x({"data-slot":"tabs-list",className:(0,u.cn)(h({variant:s}),r)},i))};y.propTypes={className:o().string,variant:o().oneOf(["default","underlined"])};var D=function(e){var t=e.className,r=void 0===t?"":t,n=e.variant,s=void 0===n?"default":n,i=(0,a.A)(e,m);return(0,c.jsx)(l.l9,x({"data-slot":"tabs-trigger",className:(0,u.cn)(b({variant:s}),r)}
2,i))};D.propTypes={className:o().string,variant:o().oneOf(["default","underlined"])};var j=function(e){var t=e.className,r=void 0===t?"":t,n=(0,a.A)(e,f);return(0,c.jsx)(l.UC,x({"data-slot":"tabs-content",className:(0,u.cn)("flex-1 outline-none",r)},n))};j.propTypes={className:o().string}}}]);//# sourceMappingURL=274.d1a6c848.chunk.js.map
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.